gut TF13

There's enough wrong here that it's best to start fresh.

Change-Id: If95bf77aa92bb0ee6c46d5c21bde17b540b13e2f
Reviewed-on: https://skia-review.googlesource.com/123420
Auto-Submit: Mike Klein <mtklein@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
diff --git a/build/targets b/build/targets
index 5d72c25..c25cfd1 100644
--- a/build/targets
+++ b/build/targets
@@ -33,6 +33,5 @@
 build $out/src/ICCProfile.o:       compile src/ICCProfile.c
 build $out/src/LinearAlgebra.o:    compile src/LinearAlgebra.c
 build $out/src/PortableMath.o:     compile src/PortableMath.c
-build $out/src/TF13.o:             compile src/TF13.c
 build $out/src/TransferFunction.o: compile src/TransferFunction.c
 build $out/src/Transform.o:        compile src/Transform.c
diff --git a/iccdump.c b/iccdump.c
index ed08707..13f1a4b 100644
--- a/iccdump.c
+++ b/iccdump.c
@@ -179,18 +179,6 @@
     fprintf(fp, "},\n");
 }
 
-static void desmos_TF13(FILE* fp, const skcms_TF13* tf, const char* color) {
-    double A = tf->A,
-           B = tf->B;
-    fprintf(fp, "{\n");
-    fprintf(fp, " \"type\": \"expression\",\n");
-    fprintf(fp, " \"id\": \"%d\",\n", desmos_id++);
-    fprintf(fp, " \"color\": \"%s\",\n", color);
-    fprintf(fp, " \"latex\": \"%.5fx^3 + %.5fx^2 + %.5fx"
-            "\\\\left\\\\{0 \\\\le x \\\\le 1 \\\\right\\\\}\"\n", A, B, (1.0 - A - B));
-    fprintf(fp, "},\n");
-}
-
 static void desmos_curve(FILE* fp, const skcms_Curve* curve, const char* color) {
     if (!curve->table_entries) {
         desmos_transfer_function(fp, &curve->parametric, color);
@@ -264,10 +252,6 @@
     if (skcms_ApproximateCurve(curve, &approx_tf, &max_error)) {
         desmos_transfer_function(fp, &approx_tf, approx_color);
     }
-    skcms_TF13 tf13;
-    if (skcms_ApproximateCurve13(curve, &tf13, &max_error)) {
-        desmos_TF13(fp, &tf13, approx_color);
-    }
 }
 
 static void desmos_curves(FILE* fp, uint32_t num_curves, const skcms_Curve* curves,
diff --git a/profiles/color.org/Lower_Left.icc.txt b/profiles/color.org/Lower_Left.icc.txt
index cf34bae..d9aaae0 100644
--- a/profiles/color.org/Lower_Left.icc.txt
+++ b/profiles/color.org/Lower_Left.icc.txt
@@ -17,13 +17,9 @@
  'bXYZ' : 'XYZ ' :     20 : 512
 
 rTRC : 2.19922, 1, 0, 0, 0, 0, 0
- ~13 : 0.175675x^3 + 0.86245x^2 + -0.0381256x (Max error: 0.0013342)
 gTRC : 2.19922, 1, 0, 0, 0, 0, 0
- ~13 : 0.175675x^3 + 0.86245x^2 + -0.0381256x (Max error: 0.0013342)
 bTRC : 2.19922, 1, 0, 0, 0, 0, 0
- ~13 : 0.175675x^3 + 0.86245x^2 + -0.0381256x (Max error: 0.0013342)
 Best : 2.19922, 1, 0, 0, 0, 0, 0
- ~13 : 0.175675x^3 + 0.86245x^2 + -0.0381256x (Max error: 0.0013342)
  XYZ : | 0.385116577 0.143051147 0.436035156 |
        | 0.716903687 0.060607910 0.222488403 |
        | 0.097061157 0.713912964 0.013916016 |
diff --git a/profiles/color.org/Lower_Right.icc.txt b/profiles/color.org/Lower_Right.icc.txt
index 8b35a8d..d2ed876 100644
--- a/profiles/color.org/Lower_Right.icc.txt
+++ b/profiles/color.org/Lower_Right.icc.txt
@@ -17,13 +17,9 @@
  'bXYZ' : 'XYZ ' :     20 : 540
 
 rTRC : 2.19922, 1, 0, 0, 0, 0, 0
- ~13 : 0.175675x^3 + 0.86245x^2 + -0.0381256x (Max error: 0.0013342)
 gTRC : 2.19922, 1, 0, 0, 0, 0, 0
- ~13 : 0.175675x^3 + 0.86245x^2 + -0.0381256x (Max error: 0.0013342)
 bTRC : 2.19922, 1, 0, 0, 0, 0, 0
- ~13 : 0.175675x^3 + 0.86245x^2 + -0.0381256x (Max error: 0.0013342)
 Best : 2.19922, 1, 0, 0, 0, 0, 0
- ~13 : 0.175675x^3 + 0.86245x^2 + -0.0381256x (Max error: 0.0013342)
  XYZ : | 0.609741211 0.205276489 0.149185181 |
        | 0.311111450 0.625671387 0.063217163 |
        | 0.019470215 0.060867310 0.744567871 |
diff --git a/profiles/color.org/Upper_Left.icc.txt b/profiles/color.org/Upper_Left.icc.txt
index f68316d..ec692fc 100644
--- a/profiles/color.org/Upper_Left.icc.txt
+++ b/profiles/color.org/Upper_Left.icc.txt
@@ -18,7 +18,6 @@
  'B2A1' : 'mBA ' :   1792 : 5668
 
 Best : 2.4, 0.947867, 0.0521327, 0.0773994, 0.04045, 0, 0 (D-gap: -1.28057e-08)
- ~13 : 0.305657x^3 + 0.681706x^2 + 0.0126376x (Max error: 0.00166379)
  A2B : "M", Matrix, "B"
  "M" : 3 inputs
   M0 : 16-bit table with 256 entries
diff --git a/profiles/color.org/Upper_Right.icc.txt b/profiles/color.org/Upper_Right.icc.txt
index 3a00dfc..392696c 100644
--- a/profiles/color.org/Upper_Right.icc.txt
+++ b/profiles/color.org/Upper_Right.icc.txt
@@ -15,7 +15,6 @@
  'A2B1' : 'mAB ' :   1792 : 2264
 
 Best : 2.4, 0.947867, 0.0521327, 0.0773994, 0.04045, 0, 0 (D-gap: -1.28057e-08)
- ~13 : 0.305657x^3 + 0.681706x^2 + 0.0126376x (Max error: 0.00166379)
  A2B : "A", CLUT, "M", Matrix, "B"
  "A" : 3 inputs
   A0 : 1, 1, 0, 0, 0, 0, 0 (Identity)
diff --git a/profiles/color.org/sRGB2014.icc.txt b/profiles/color.org/sRGB2014.icc.txt
index eda8d36..739ec5f 100644
--- a/profiles/color.org/sRGB2014.icc.txt
+++ b/profiles/color.org/sRGB2014.icc.txt
@@ -24,15 +24,11 @@
 
 rTRC : 16-bit table with 1024 entries
   ~= : 2.39978, 0.947934, 0.052081, 0.0777105, 0.0449658, -1.28639e-06, 0 (Max error: 0.000239041) (D-gap: 0)
- ~13 : 0.305305x^3 + 0.682172x^2 + 0.012523x (Max error: 0.00167628)
 gTRC : 16-bit table with 1024 entries
   ~= : 2.39978, 0.947934, 0.052081, 0.0777105, 0.0449658, -1.28639e-06, 0 (Max error: 0.000239041) (D-gap: 0)
- ~13 : 0.305305x^3 + 0.682172x^2 + 0.012523x (Max error: 0.00167628)
 bTRC : 16-bit table with 1024 entries
   ~= : 2.39978, 0.947934, 0.052081, 0.0777105, 0.0449658, -1.28639e-06, 0 (Max error: 0.000239041) (D-gap: 0)
- ~13 : 0.305305x^3 + 0.682172x^2 + 0.012523x (Max error: 0.00167628)
 Best : 2.39978, 0.947934, 0.052081, 0.0777105, 0.0449658, -1.28639e-06, 0 (D-gap: 0)
- ~13 : 0.305292x^3 + 0.682192x^2 + 0.0125157x (Max error: 0.00166641)
  XYZ : | 0.436065674 0.385147095 0.143066406 |
        | 0.222488403 0.716873169 0.060607910 |
        | 0.013916016 0.097076416 0.714096069 |
diff --git a/profiles/color.org/sRGB_ICC_v4_Appearance.icc.txt b/profiles/color.org/sRGB_ICC_v4_Appearance.icc.txt
index 06d22fc..7550522 100644
--- a/profiles/color.org/sRGB_ICC_v4_Appearance.icc.txt
+++ b/profiles/color.org/sRGB_ICC_v4_Appearance.icc.txt
@@ -16,7 +16,6 @@
  'rig0' : 'sig ' :     12 : 63856
 
 Best : 2.4, 0.947867, 0.0521327, 0.0773994, 0.04045, 0, 0 (D-gap: -1.28057e-08)
- ~13 : 0.305657x^3 + 0.681706x^2 + 0.0126376x (Max error: 0.00166379)
  A2B : "A", CLUT, "M", Matrix, "B"
  "A" : 3 inputs
   A0 : 1, 1, 0, 0, 0, 0, 0 (Identity)
diff --git a/profiles/color.org/sRGB_v4_ICC_preference.icc.txt b/profiles/color.org/sRGB_v4_ICC_preference.icc.txt
index b87368c..ff1af3a 100644
--- a/profiles/color.org/sRGB_v4_ICC_preference.icc.txt
+++ b/profiles/color.org/sRGB_v4_ICC_preference.icc.txt
@@ -16,7 +16,6 @@
  'chad' : 'sf32' :     44 : 60916
 
 Best : 2.4, 0.947867, 0.0521327, 0.0773994, 0.04045, 0, 0 (D-gap: -1.28057e-08)
- ~13 : 0.305657x^3 + 0.681706x^2 + 0.0126376x (Max error: 0.00166379)
  A2B : "A", CLUT, "M", Matrix, "B"
  "A" : 3 inputs
   A0 : 1, 1, 0, 0, 0, 0, 0 (Identity)
diff --git a/profiles/misc/AdobeColorSpin.icc.txt b/profiles/misc/AdobeColorSpin.icc.txt
index 41155a5..e79e975 100644
--- a/profiles/misc/AdobeColorSpin.icc.txt
+++ b/profiles/misc/AdobeColorSpin.icc.txt
@@ -16,13 +16,9 @@
  'bTRC' : 'curv' :     14 : 476
 
 rTRC : 2.19922, 1, 0, 0, 0, 0, 0
- ~13 : 0.175675x^3 + 0.86245x^2 + -0.0381256x (Max error: 0.0013342)
 gTRC : 2.19922, 1, 0, 0, 0, 0, 0
- ~13 : 0.175675x^3 + 0.86245x^2 + -0.0381256x (Max error: 0.0013342)
 bTRC : 2.19922, 1, 0, 0, 0, 0, 0
- ~13 : 0.175675x^3 + 0.86245x^2 + -0.0381256x (Max error: 0.0013342)
 Best : 2.19922, 1, 0, 0, 0, 0, 0
- ~13 : 0.175675x^3 + 0.86245x^2 + -0.0381256x (Max error: 0.0013342)
  XYZ : | 0.205276489 0.149185181 0.609741211 |
        | 0.625671387 0.063217163 0.311111450 |
        | 0.060867310 0.744552612 0.019470215 |
diff --git a/profiles/misc/AdobeRGB.icc.txt b/profiles/misc/AdobeRGB.icc.txt
index 8b35a8d..d2ed876 100644
--- a/profiles/misc/AdobeRGB.icc.txt
+++ b/profiles/misc/AdobeRGB.icc.txt
@@ -17,13 +17,9 @@
  'bXYZ' : 'XYZ ' :     20 : 540
 
 rTRC : 2.19922, 1, 0, 0, 0, 0, 0
- ~13 : 0.175675x^3 + 0.86245x^2 + -0.0381256x (Max error: 0.0013342)
 gTRC : 2.19922, 1, 0, 0, 0, 0, 0
- ~13 : 0.175675x^3 + 0.86245x^2 + -0.0381256x (Max error: 0.0013342)
 bTRC : 2.19922, 1, 0, 0, 0, 0, 0
- ~13 : 0.175675x^3 + 0.86245x^2 + -0.0381256x (Max error: 0.0013342)
 Best : 2.19922, 1, 0, 0, 0, 0, 0
- ~13 : 0.175675x^3 + 0.86245x^2 + -0.0381256x (Max error: 0.0013342)
  XYZ : | 0.609741211 0.205276489 0.149185181 |
        | 0.311111450 0.625671387 0.063217163 |
        | 0.019470215 0.060867310 0.744567871 |
diff --git a/profiles/misc/Apple_Color_LCD.icc.txt b/profiles/misc/Apple_Color_LCD.icc.txt
index 1dd5b4f..39c1fd1 100644
--- a/profiles/misc/Apple_Color_LCD.icc.txt
+++ b/profiles/misc/Apple_Color_LCD.icc.txt
@@ -25,15 +25,11 @@
 
 rTRC : 16-bit table with 1024 entries
   ~= : 2.39978, 0.947934, 0.052081, 0.0777105, 0.0449658, -1.28639e-06, 0 (Max error: 0.000251848) (D-gap: 0)
- ~13 : 0.305304x^3 + 0.682173x^2 + 0.0125225x (Max error: 0.00167631)
 gTRC : 16-bit table with 1024 entries
   ~= : 2.39978, 0.947934, 0.052081, 0.0777105, 0.0449658, -1.28639e-06, 0 (Max error: 0.000251848) (D-gap: 0)
- ~13 : 0.305304x^3 + 0.682173x^2 + 0.0125225x (Max error: 0.00167631)
 bTRC : 16-bit table with 1024 entries
   ~= : 2.39978, 0.947934, 0.052081, 0.0777105, 0.0449658, -1.28639e-06, 0 (Max error: 0.000251848) (D-gap: 0)
- ~13 : 0.305304x^3 + 0.682173x^2 + 0.0125225x (Max error: 0.00167631)
 Best : 2.39978, 0.947934, 0.052081, 0.0777105, 0.0449658, -1.28639e-06, 0 (D-gap: 0)
- ~13 : 0.305292x^3 + 0.682192x^2 + 0.0125157x (Max error: 0.00166641)
  XYZ : | 0.444335938 0.379440308 0.140411377 |
        | 0.224761963 0.726165771 0.049072266 |
        | 0.005477905 0.077972412 0.741455078 |
diff --git a/profiles/misc/Apple_Wide_Color.icc.txt b/profiles/misc/Apple_Wide_Color.icc.txt
index 0bb5383..1d18636 100644
--- a/profiles/misc/Apple_Wide_Color.icc.txt
+++ b/profiles/misc/Apple_Wide_Color.icc.txt
@@ -15,7 +15,6 @@
  'A2B1' : 'mAB ' :  29772 : 408
 
 Best : 2.4, 0.947867, 0.0521327, 0.0773994, 0.04045, 0, 0 (D-gap: -1.28057e-08)
- ~13 : 0.305657x^3 + 0.681706x^2 + 0.0126376x (Max error: 0.00166379)
  A2B : "A", CLUT, "M", Matrix, "B"
  "A" : 3 inputs
   A0 : 1, 1, 0, 0, 0, 0, 0 (Identity)
@@ -24,11 +23,8 @@
 CLUT : 17 x 17 x 17 (16 bpp)
  "M" : 3 inputs
   M0 : 2.39999, 0.947906, 0.0520935, 0.0773926, 0.0393066, 0, 0 (D-gap: -3.51714e-06)
- ~13 : 0.305693x^3 + 0.681724x^2 + 0.0125826x (Max error: 0.00166329)
   M1 : 2.39999, 0.947906, 0.0520935, 0.0773926, 0.0393066, 0, 0 (D-gap: -3.51714e-06)
- ~13 : 0.305693x^3 + 0.681724x^2 + 0.0125826x (Max error: 0.00166329)
   M2 : 2.39999, 0.947906, 0.0520935, 0.0773926, 0.0393066, 0, 0 (D-gap: -3.51714e-06)
- ~13 : 0.305693x^3 + 0.681724x^2 + 0.0125826x (Max error: 0.00166329)
 Mtrx : | 0.507255435 0.301234424 0.155698314 0.000000000 |
        | 0.239345714 0.694691539 0.065977998 0.000000000 |
        | 0.000457757 0.047393076 0.777148783 0.000000000 |
diff --git a/profiles/misc/Coated_FOGRA39_CMYK.icc.txt b/profiles/misc/Coated_FOGRA39_CMYK.icc.txt
index d4a6cfa..c718211 100644
--- a/profiles/misc/Coated_FOGRA39_CMYK.icc.txt
+++ b/profiles/misc/Coated_FOGRA39_CMYK.icc.txt
@@ -21,7 +21,6 @@
  'gamt' : 'mft1' :  37009 : 617340
 
 Best : 2.4, 0.947867, 0.0521327, 0.0773994, 0.04045, 0, 0 (D-gap: -1.28057e-08)
- ~13 : 0.305657x^3 + 0.681706x^2 + 0.0126376x (Max error: 0.00166379)
  A2B : "A", CLUT, "B"
  "A" : 4 inputs
   A0 : 16-bit table with 256 entries
@@ -31,7 +30,6 @@
   A2 : 16-bit table with 256 entries
   ~= : 1.16035, 1.00803, 0.0113021, 0.708171, 0.00784314, -0.00463676, 0 (Max error: 0.0152175) (D-gap: 0)
   A3 : 16-bit table with 256 entries
- ~13 : 0.158843x^3 + 0.0863403x^2 + 0.754817x (Max error: 0.00133204)
 CLUT : 11 x 11 x 11 x 11 (16 bpp)
  "B" : 3 outputs
   B0 : 1, 1, 0, 0, 0, 0, 0 (Identity)
diff --git a/profiles/misc/ColorLogic_ISO_Coated_CMYK.icc.txt b/profiles/misc/ColorLogic_ISO_Coated_CMYK.icc.txt
index 3bad49b..267d907 100644
--- a/profiles/misc/ColorLogic_ISO_Coated_CMYK.icc.txt
+++ b/profiles/misc/ColorLogic_ISO_Coated_CMYK.icc.txt
@@ -21,7 +21,6 @@
  'Info' : 'text' :    902 : 1824620
 
 Best : 2.4, 0.947867, 0.0521327, 0.0773994, 0.04045, 0, 0 (D-gap: -1.28057e-08)
- ~13 : 0.305657x^3 + 0.681706x^2 + 0.0126376x (Max error: 0.00166379)
  A2B : "A", CLUT, "B"
  "A" : 4 inputs
   A0 : 16-bit table with 256 entries
diff --git a/profiles/misc/Color_Spin_Gamma_18.icc.txt b/profiles/misc/Color_Spin_Gamma_18.icc.txt
index 57e3d75..3bb2d7d 100644
--- a/profiles/misc/Color_Spin_Gamma_18.icc.txt
+++ b/profiles/misc/Color_Spin_Gamma_18.icc.txt
@@ -16,13 +16,9 @@
  'bTRC' : 'curv' :     14 : 460
 
 rTRC : 1.80078, 1, 0, 0, 0, 0, 0
- ~13 : -0.14516x^3 + 1.07371x^2 + 0.0714537x (Max error: 0.00193666)
 gTRC : 1.80078, 1, 0, 0, 0, 0, 0
- ~13 : -0.14516x^3 + 1.07371x^2 + 0.0714537x (Max error: 0.00193666)
 bTRC : 1.80078, 1, 0, 0, 0, 0, 0
- ~13 : -0.14516x^3 + 1.07371x^2 + 0.0714537x (Max error: 0.00193666)
 Best : 1.80078, 1, 0, 0, 0, 0, 0
- ~13 : -0.14516x^3 + 1.07371x^2 + 0.0714537x (Max error: 0.00193666)
  XYZ : | 0.385116577 0.143035889 0.436050415 |
        | 0.716903687 0.060607910 0.222488403 |
        | 0.097061157 0.713912964 0.013916016 |
diff --git a/profiles/misc/DisplayCal_ASUS_NonMonotonic.icc.txt b/profiles/misc/DisplayCal_ASUS_NonMonotonic.icc.txt
index 8cf1f79..b29fa23 100644
--- a/profiles/misc/DisplayCal_ASUS_NonMonotonic.icc.txt
+++ b/profiles/misc/DisplayCal_ASUS_NonMonotonic.icc.txt
@@ -36,7 +36,6 @@
   ~= : 2.27403, 0.980813, 0.0314167, 0.0311284, 0.192157, -0.0259432, 0 (Max error: 0.0558824) (D-gap: 0)
 bTRC : 16-bit table with 256 entries
   ~= : 2.19997, 1.0228, -0.0143504, 0.00389105, 0.160784, -0.0147935, 0 (Max error: 0.152941) (D-gap: -2.32831e-10)
- ~13 : 0.0959603x^3 + 1.05493x^2 + -0.150893x (Max error: 0.00555612)
 Best : 2.27403, 0.980813, 0.0314167, 0.0311284, 0.192157, -0.0259432, 0 (D-gap: 0)
  XYZ : | 0.436737061 0.380325317 0.147140503 |
        | 0.217636108 0.729843140 0.052520752 |
diff --git a/profiles/misc/Dot_Gain_20_Grayscale.icc.txt b/profiles/misc/Dot_Gain_20_Grayscale.icc.txt
index 67d84c6..39d476f 100644
--- a/profiles/misc/Dot_Gain_20_Grayscale.icc.txt
+++ b/profiles/misc/Dot_Gain_20_Grayscale.icc.txt
@@ -13,15 +13,11 @@
 
 rTRC : 16-bit table with 256 entries
   ~= : 1.73715, 0.999979, 6.92596e-05, 0.0629053, 0.0235294, -1.07513e-05, 0 (Max error: 0.000202142) (D-gap: 0)
- ~13 : -0.183519x^3 + 1.08054x^2 + 0.102974x (Max error: 0.00263338)
 gTRC : 16-bit table with 256 entries
   ~= : 1.73715, 0.999979, 6.92596e-05, 0.0629053, 0.0235294, -1.07513e-05, 0 (Max error: 0.000202142) (D-gap: 0)
- ~13 : -0.183519x^3 + 1.08054x^2 + 0.102974x (Max error: 0.00263338)
 bTRC : 16-bit table with 256 entries
   ~= : 1.73715, 0.999979, 6.92596e-05, 0.0629053, 0.0235294, -1.07513e-05, 0 (Max error: 0.000202142) (D-gap: 0)
- ~13 : -0.183519x^3 + 1.08054x^2 + 0.102974x (Max error: 0.00263338)
 Best : 1.73715, 0.999979, 6.92596e-05, 0.0629053, 0.0235294, -1.07513e-05, 0 (D-gap: 0)
- ~13 : -0.183504x^3 + 1.08052x^2 + 0.10298x (Max error: 0.00262766)
  XYZ : | 0.964202881 0.000000000 0.000000000 |
        | 0.000000000 1.000000000 0.000000000 |
        | 0.000000000 0.000000000 0.824905396 |
diff --git a/profiles/misc/Generic_RGB_Gamma_18.icc.txt b/profiles/misc/Generic_RGB_Gamma_18.icc.txt
index dbc38cb..0066a19 100644
--- a/profiles/misc/Generic_RGB_Gamma_18.icc.txt
+++ b/profiles/misc/Generic_RGB_Gamma_18.icc.txt
@@ -18,13 +18,9 @@
  'gTRC' : 'curv' :     14 : 1900
 
 rTRC : 1.80078, 1, 0, 0, 0, 0, 0
- ~13 : -0.14516x^3 + 1.07371x^2 + 0.0714537x (Max error: 0.00193666)
 gTRC : 1.80078, 1, 0, 0, 0, 0, 0
- ~13 : -0.14516x^3 + 1.07371x^2 + 0.0714537x (Max error: 0.00193666)
 bTRC : 1.80078, 1, 0, 0, 0, 0, 0
- ~13 : -0.14516x^3 + 1.07371x^2 + 0.0714537x (Max error: 0.00193666)
 Best : 1.80078, 1, 0, 0, 0, 0, 0
- ~13 : -0.14516x^3 + 1.07371x^2 + 0.0714537x (Max error: 0.00193666)
  XYZ : | 0.454299927 0.353347778 0.156646729 |
        | 0.241912842 0.673629761 0.084457397 |
        | 0.014892578 0.090637207 0.719573975 |
diff --git a/profiles/misc/Gray_Gamma_22.icc.txt b/profiles/misc/Gray_Gamma_22.icc.txt
index 3329dfe..314c089 100644
--- a/profiles/misc/Gray_Gamma_22.icc.txt
+++ b/profiles/misc/Gray_Gamma_22.icc.txt
@@ -12,13 +12,9 @@
  'kTRC' : 'curv' :     14 : 392
 
 rTRC : 2.19922, 1, 0, 0, 0, 0, 0
- ~13 : 0.175675x^3 + 0.86245x^2 + -0.0381256x (Max error: 0.0013342)
 gTRC : 2.19922, 1, 0, 0, 0, 0, 0
- ~13 : 0.175675x^3 + 0.86245x^2 + -0.0381256x (Max error: 0.0013342)
 bTRC : 2.19922, 1, 0, 0, 0, 0, 0
- ~13 : 0.175675x^3 + 0.86245x^2 + -0.0381256x (Max error: 0.0013342)
 Best : 2.19922, 1, 0, 0, 0, 0, 0
- ~13 : 0.175675x^3 + 0.86245x^2 + -0.0381256x (Max error: 0.0013342)
  XYZ : | 0.964202881 0.000000000 0.000000000 |
        | 0.000000000 1.000000000 0.000000000 |
        | 0.000000000 0.000000000 0.824905396 |
diff --git a/profiles/misc/HD_709.icc.txt b/profiles/misc/HD_709.icc.txt
index 7867362..8deb3eb 100644
--- a/profiles/misc/HD_709.icc.txt
+++ b/profiles/misc/HD_709.icc.txt
@@ -25,15 +25,11 @@
 
 rTRC : 16-bit table with 1024 entries
   ~= : 2.39978, 0.947934, 0.052081, 0.0777105, 0.0449658, -1.28639e-06, 0 (Max error: 0.000251848) (D-gap: 0)
- ~13 : 0.305304x^3 + 0.682173x^2 + 0.0125225x (Max error: 0.00167631)
 gTRC : 16-bit table with 1024 entries
   ~= : 2.39978, 0.947934, 0.052081, 0.0777105, 0.0449658, -1.28639e-06, 0 (Max error: 0.000251848) (D-gap: 0)
- ~13 : 0.305304x^3 + 0.682173x^2 + 0.0125225x (Max error: 0.00167631)
 bTRC : 16-bit table with 1024 entries
   ~= : 2.39978, 0.947934, 0.052081, 0.0777105, 0.0449658, -1.28639e-06, 0 (Max error: 0.000251848) (D-gap: 0)
- ~13 : 0.305304x^3 + 0.682173x^2 + 0.0125225x (Max error: 0.00167631)
 Best : 2.39978, 0.947934, 0.052081, 0.0777105, 0.0449658, -1.28639e-06, 0 (D-gap: 0)
- ~13 : 0.305292x^3 + 0.682192x^2 + 0.0125157x (Max error: 0.00166641)
  XYZ : | 0.358963013 0.446350098 0.158889771 |
        | 0.195922852 0.742843628 0.061233521 |
        | 0.009674072 0.043518066 0.771713257 |
diff --git a/profiles/misc/Japan_Color_2001_Coated.icc.txt b/profiles/misc/Japan_Color_2001_Coated.icc.txt
index 53f071e..f67aad6 100644
--- a/profiles/misc/Japan_Color_2001_Coated.icc.txt
+++ b/profiles/misc/Japan_Color_2001_Coated.icc.txt
@@ -17,14 +17,12 @@
  'gamt' : 'mft1' :  37009 : 520156
 
 Best : 2.4, 0.947867, 0.0521327, 0.0773994, 0.04045, 0, 0 (D-gap: -1.28057e-08)
- ~13 : 0.305657x^3 + 0.681706x^2 + 0.0126376x (Max error: 0.00166379)
  A2B : "A", CLUT, "B"
  "A" : 4 inputs
   A0 : 16-bit table with 256 entries
   ~= : 1.035, 1.04085, -0.0326543, 0.780156, 0.0313726, 0.0244755, 0 (Max error: 0.0307155) (D-gap: 0)
   A1 : 16-bit table with 256 entries
   ~= : 1.11391, 1.02128, -0.0220004, 0.627015, 0.027451, 0.0138406, 0 (Max error: 0.0115468) (D-gap: 0)
- ~13 : -0.30436x^3 + 0.600324x^2 + 0.704036x (Max error: 0.0033614)
   A2 : 16-bit table with 256 entries
   ~= : 1.14818, 0.997828, 0.0230241, 0.619326, 0.0235294, -0.014941, 0 (Max error: 0.00792223) (D-gap: 0)
   A3 : 16-bit table with 256 entries
diff --git a/profiles/misc/Lexmark_X110.icc.txt b/profiles/misc/Lexmark_X110.icc.txt
index bfa3c53..8bcef43 100644
--- a/profiles/misc/Lexmark_X110.icc.txt
+++ b/profiles/misc/Lexmark_X110.icc.txt
@@ -13,7 +13,6 @@
  'A2B0' : 'mft1' :  16323 : 708
 
 Best : 2.4, 0.947867, 0.0521327, 0.0773994, 0.04045, 0, 0 (D-gap: -1.28057e-08)
- ~13 : 0.305657x^3 + 0.681706x^2 + 0.0126376x (Max error: 0.00166379)
  A2B : "A", CLUT, "B"
  "A" : 3 inputs
   A0 : 1, 1, 0, 0, 0, 0, 0 (Identity)
diff --git a/profiles/misc/MartiMaria_browsertest_A2B.icc.txt b/profiles/misc/MartiMaria_browsertest_A2B.icc.txt
index 375d57f..159c1e8 100644
--- a/profiles/misc/MartiMaria_browsertest_A2B.icc.txt
+++ b/profiles/misc/MartiMaria_browsertest_A2B.icc.txt
@@ -13,7 +13,6 @@
  'A2B2' : 'mft2' :  29554 : 480
 
 Best : 2.4, 0.947867, 0.0521327, 0.0773994, 0.04045, 0, 0 (D-gap: -1.28057e-08)
- ~13 : 0.305657x^3 + 0.681706x^2 + 0.0126376x (Max error: 0.00166379)
  A2B : "A", CLUT, "B"
  "A" : 3 inputs
   A0 : 1, 1, 0, 0, 0, 0, 0 (Identity)
diff --git a/profiles/misc/MartiMaria_browsertest_HARD.icc.txt b/profiles/misc/MartiMaria_browsertest_HARD.icc.txt
index 4f2c750..9f7e666 100644
--- a/profiles/misc/MartiMaria_browsertest_HARD.icc.txt
+++ b/profiles/misc/MartiMaria_browsertest_HARD.icc.txt
@@ -23,7 +23,6 @@
   ~= : 1, 0.00387579, 0, 0, 0, 0, 0 (Max error: 5.96046e-08)
 bTRC : 16-bit table with 255 entries
 Best : 2.4, 0.947867, 0.0521327, 0.0773994, 0.04045, 0, 0 (D-gap: -1.28057e-08)
- ~13 : 0.305657x^3 + 0.681706x^2 + 0.0126376x (Max error: 0.00166379)
  XYZ : | 0.964202881 0.000000000 0.964202881 |
        | 1.000000000 0.000000000 1.000000000 |
        | 0.824905396 0.000000000 0.824905396 |
diff --git a/profiles/misc/PrintOpen_ISO_Coated_CMYK.icc.txt b/profiles/misc/PrintOpen_ISO_Coated_CMYK.icc.txt
index 2c84568..89d727e 100644
--- a/profiles/misc/PrintOpen_ISO_Coated_CMYK.icc.txt
+++ b/profiles/misc/PrintOpen_ISO_Coated_CMYK.icc.txt
@@ -20,7 +20,6 @@
  'targ' : 'text' : 126685 : 1702392
 
 Best : 2.4, 0.947867, 0.0521327, 0.0773994, 0.04045, 0, 0 (D-gap: -1.28057e-08)
- ~13 : 0.305657x^3 + 0.681706x^2 + 0.0126376x (Max error: 0.00166379)
  A2B : "A", CLUT, "B"
  "A" : 4 inputs
   A0 : 1, 1, 0, 0, 0, 0, 0 (Identity)
diff --git a/profiles/misc/SWOP_Coated_20_GCR_CMYK.icc.txt b/profiles/misc/SWOP_Coated_20_GCR_CMYK.icc.txt
index d2be2fe..0ab0502 100644
--- a/profiles/misc/SWOP_Coated_20_GCR_CMYK.icc.txt
+++ b/profiles/misc/SWOP_Coated_20_GCR_CMYK.icc.txt
@@ -18,7 +18,6 @@
  'AS00' : 'data' :    144 : 723996
 
 Best : 2.4, 0.947867, 0.0521327, 0.0773994, 0.04045, 0, 0 (D-gap: -1.28057e-08)
- ~13 : 0.305657x^3 + 0.681706x^2 + 0.0126376x (Max error: 0.00166379)
  A2B : "A", CLUT, "B"
  "A" : 4 inputs
   A0 : 16-bit table with 256 entries
diff --git a/profiles/misc/US_Web_Coated_SWOP_CMYK.icc.txt b/profiles/misc/US_Web_Coated_SWOP_CMYK.icc.txt
index 91be76f..0d68e2b 100644
--- a/profiles/misc/US_Web_Coated_SWOP_CMYK.icc.txt
+++ b/profiles/misc/US_Web_Coated_SWOP_CMYK.icc.txt
@@ -17,7 +17,6 @@
  'gamt' : 'mft1' :  37009 : 520156
 
 Best : 2.4, 0.947867, 0.0521327, 0.0773994, 0.04045, 0, 0 (D-gap: -1.28057e-08)
- ~13 : 0.305657x^3 + 0.681706x^2 + 0.0126376x (Max error: 0.00166379)
  A2B : "A", CLUT, "B"
  "A" : 4 inputs
   A0 : 16-bit table with 256 entries
diff --git a/profiles/misc/XRite_GRACol7_340_CMYK.icc.txt b/profiles/misc/XRite_GRACol7_340_CMYK.icc.txt
index 31d753a..4c14cbc 100644
--- a/profiles/misc/XRite_GRACol7_340_CMYK.icc.txt
+++ b/profiles/misc/XRite_GRACol7_340_CMYK.icc.txt
@@ -21,7 +21,6 @@
  'desc' : 'desc' :    138 : 3472116
 
 Best : 2.4, 0.947867, 0.0521327, 0.0773994, 0.04045, 0, 0 (D-gap: -1.28057e-08)
- ~13 : 0.305657x^3 + 0.681706x^2 + 0.0126376x (Max error: 0.00166379)
  A2B : "A", CLUT, "B"
  "A" : 4 inputs
   A0 : 1, 1, 0, 0, 0, 0, 0 (Identity)
diff --git a/profiles/misc/sRGB_HP.icc.txt b/profiles/misc/sRGB_HP.icc.txt
index 010137f..c971bad 100644
--- a/profiles/misc/sRGB_HP.icc.txt
+++ b/profiles/misc/sRGB_HP.icc.txt
@@ -25,15 +25,11 @@
 
 rTRC : 16-bit table with 1024 entries
   ~= : 2.39978, 0.947934, 0.052081, 0.0777105, 0.0449658, -1.28639e-06, 0 (Max error: 0.000239041) (D-gap: 0)
- ~13 : 0.305305x^3 + 0.682172x^2 + 0.012523x (Max error: 0.00167628)
 gTRC : 16-bit table with 1024 entries
   ~= : 2.39978, 0.947934, 0.052081, 0.0777105, 0.0449658, -1.28639e-06, 0 (Max error: 0.000239041) (D-gap: 0)
- ~13 : 0.305305x^3 + 0.682172x^2 + 0.012523x (Max error: 0.00167628)
 bTRC : 16-bit table with 1024 entries
   ~= : 2.39978, 0.947934, 0.052081, 0.0777105, 0.0449658, -1.28639e-06, 0 (Max error: 0.000239041) (D-gap: 0)
- ~13 : 0.305305x^3 + 0.682172x^2 + 0.012523x (Max error: 0.00167628)
 Best : 2.39978, 0.947934, 0.052081, 0.0777105, 0.0449658, -1.28639e-06, 0 (D-gap: 0)
- ~13 : 0.305292x^3 + 0.682192x^2 + 0.0125157x (Max error: 0.00166641)
  XYZ : | 0.436065674 0.385147095 0.143066406 |
        | 0.222488403 0.716873169 0.060607910 |
        | 0.013916016 0.097076416 0.714096069 |
diff --git a/profiles/misc/sRGB_HP_2.icc.txt b/profiles/misc/sRGB_HP_2.icc.txt
index bd009e6..570fa91 100644
--- a/profiles/misc/sRGB_HP_2.icc.txt
+++ b/profiles/misc/sRGB_HP_2.icc.txt
@@ -25,15 +25,11 @@
 
 rTRC : 16-bit table with 1024 entries
   ~= : 2.39978, 0.947934, 0.052081, 0.0777105, 0.0449658, -1.28639e-06, 0 (Max error: 0.000239041) (D-gap: 0)
- ~13 : 0.305305x^3 + 0.682172x^2 + 0.012523x (Max error: 0.00167628)
 gTRC : 16-bit table with 1024 entries
   ~= : 2.39978, 0.947934, 0.052081, 0.0777105, 0.0449658, -1.28639e-06, 0 (Max error: 0.000239041) (D-gap: 0)
- ~13 : 0.305305x^3 + 0.682172x^2 + 0.012523x (Max error: 0.00167628)
 bTRC : 16-bit table with 1024 entries
   ~= : 2.39978, 0.947934, 0.052081, 0.0777105, 0.0449658, -1.28639e-06, 0 (Max error: 0.000239041) (D-gap: 0)
- ~13 : 0.305305x^3 + 0.682172x^2 + 0.012523x (Max error: 0.00167628)
 Best : 2.39978, 0.947934, 0.052081, 0.0777105, 0.0449658, -1.28639e-06, 0 (D-gap: 0)
- ~13 : 0.305292x^3 + 0.682192x^2 + 0.0125157x (Max error: 0.00166641)
  XYZ : | 0.436065674 0.385147095 0.143066406 |
        | 0.222488403 0.716873169 0.060607910 |
        | 0.013916016 0.097076416 0.714096069 |
diff --git a/profiles/misc/sRGB_ICC_v4_beta.icc.txt b/profiles/misc/sRGB_ICC_v4_beta.icc.txt
index e096738..0c9f5c1 100644
--- a/profiles/misc/sRGB_ICC_v4_beta.icc.txt
+++ b/profiles/misc/sRGB_ICC_v4_beta.icc.txt
@@ -16,7 +16,6 @@
  'rig0' : 'sig ' :     12 : 63916
 
 Best : 2.4, 0.947867, 0.0521327, 0.0773994, 0.04045, 0, 0 (D-gap: -1.28057e-08)
- ~13 : 0.305657x^3 + 0.681706x^2 + 0.0126376x (Max error: 0.00166379)
  A2B : "A", CLUT, "M", Matrix, "B"
  "A" : 3 inputs
   A0 : 1, 1, 0, 0, 0, 0, 0 (Identity)
diff --git a/profiles/misc/sRGB_black_scaled.icc.txt b/profiles/misc/sRGB_black_scaled.icc.txt
index 479ac92..5e29a75 100644
--- a/profiles/misc/sRGB_black_scaled.icc.txt
+++ b/profiles/misc/sRGB_black_scaled.icc.txt
@@ -24,15 +24,11 @@
 
 rTRC : 16-bit table with 1024 entries
   ~= : 2.39978, 0.947934, 0.052081, 0.0777105, 0.0449658, -1.28639e-06, 0 (Max error: 0.000239041) (D-gap: 0)
- ~13 : 0.305305x^3 + 0.682172x^2 + 0.012523x (Max error: 0.00167628)
 gTRC : 16-bit table with 1024 entries
   ~= : 2.39978, 0.947934, 0.052081, 0.0777105, 0.0449658, -1.28639e-06, 0 (Max error: 0.000239041) (D-gap: 0)
- ~13 : 0.305305x^3 + 0.682172x^2 + 0.012523x (Max error: 0.00167628)
 bTRC : 16-bit table with 1024 entries
   ~= : 2.39978, 0.947934, 0.052081, 0.0777105, 0.0449658, -1.28639e-06, 0 (Max error: 0.000239041) (D-gap: 0)
- ~13 : 0.305305x^3 + 0.682172x^2 + 0.012523x (Max error: 0.00167628)
 Best : 2.39978, 0.947934, 0.052081, 0.0777105, 0.0449658, -1.28639e-06, 0 (D-gap: 0)
- ~13 : 0.305292x^3 + 0.682192x^2 + 0.0125157x (Max error: 0.00166641)
  XYZ : | 0.436065674 0.385147095 0.143066406 |
        | 0.222488403 0.716873169 0.060607910 |
        | 0.013916016 0.097076416 0.714096069 |
diff --git a/profiles/misc/sRGB_lcms.icc.txt b/profiles/misc/sRGB_lcms.icc.txt
index 7897e7f..2a110ac 100644
--- a/profiles/misc/sRGB_lcms.icc.txt
+++ b/profiles/misc/sRGB_lcms.icc.txt
@@ -18,13 +18,9 @@
  'chrm' : 'chrm' :     36 : 620
 
 rTRC : 2.39999, 0.947861, 0.0521393, 0.0773926, 0.040451, 0, 0 (D-gap: 8.2748e-07) (sRGB)
- ~13 : 0.305647x^3 + 0.681703x^2 + 0.0126491x (Max error: 0.00166379)
 gTRC : 2.39999, 0.947861, 0.0521393, 0.0773926, 0.040451, 0, 0 (D-gap: 8.2748e-07) (sRGB)
- ~13 : 0.305647x^3 + 0.681703x^2 + 0.0126491x (Max error: 0.00166379)
 bTRC : 2.39999, 0.947861, 0.0521393, 0.0773926, 0.040451, 0, 0 (D-gap: 8.2748e-07) (sRGB)
- ~13 : 0.305647x^3 + 0.681703x^2 + 0.0126491x (Max error: 0.00166379)
 Best : 2.39999, 0.947861, 0.0521393, 0.0773926, 0.040451, 0, 0 (D-gap: 8.2748e-07) (sRGB)
- ~13 : 0.305647x^3 + 0.681703x^2 + 0.0126491x (Max error: 0.00166379)
  XYZ : | 0.435852051 0.385330200 0.143020630 |
        | 0.222381592 0.717041016 0.060592651 |
        | 0.013916016 0.097137451 0.713836670 |
diff --git a/profiles/mobile/Display_P3_LUT.icc.txt b/profiles/mobile/Display_P3_LUT.icc.txt
index 2fb015d..db26da9 100644
--- a/profiles/mobile/Display_P3_LUT.icc.txt
+++ b/profiles/mobile/Display_P3_LUT.icc.txt
@@ -19,15 +19,11 @@
 
 rTRC : 16-bit table with 1024 entries
   ~= : 2.39978, 0.947934, 0.052081, 0.0777105, 0.0449658, -1.28639e-06, 0 (Max error: 0.000239041) (D-gap: 0)
- ~13 : 0.305305x^3 + 0.682172x^2 + 0.012523x (Max error: 0.00167628)
 gTRC : 16-bit table with 1024 entries
   ~= : 2.39978, 0.947934, 0.052081, 0.0777105, 0.0449658, -1.28639e-06, 0 (Max error: 0.000239041) (D-gap: 0)
- ~13 : 0.305305x^3 + 0.682172x^2 + 0.012523x (Max error: 0.00167628)
 bTRC : 16-bit table with 1024 entries
   ~= : 2.39978, 0.947934, 0.052081, 0.0777105, 0.0449658, -1.28639e-06, 0 (Max error: 0.000239041) (D-gap: 0)
- ~13 : 0.305305x^3 + 0.682172x^2 + 0.012523x (Max error: 0.00167628)
 Best : 2.39978, 0.947934, 0.052081, 0.0777105, 0.0449658, -1.28639e-06, 0 (D-gap: 0)
- ~13 : 0.305292x^3 + 0.682192x^2 + 0.0125157x (Max error: 0.00166641)
  XYZ : | 0.515121460 0.291976929 0.157104492 |
        | 0.241195679 0.692245483 0.066574097 |
        | -0.001037598 0.041885376 0.784072876 |
diff --git a/profiles/mobile/Display_P3_parametric.icc.txt b/profiles/mobile/Display_P3_parametric.icc.txt
index 31416b3..25307af 100644
--- a/profiles/mobile/Display_P3_parametric.icc.txt
+++ b/profiles/mobile/Display_P3_parametric.icc.txt
@@ -18,13 +18,9 @@
  'gTRC' : 'para' :     32 : 508
 
 rTRC : 2.39999, 0.947861, 0.0521393, 0.0773926, 0.040451, 0, 0 (D-gap: 8.2748e-07) (sRGB)
- ~13 : 0.305647x^3 + 0.681703x^2 + 0.0126491x (Max error: 0.00166379)
 gTRC : 2.39999, 0.947861, 0.0521393, 0.0773926, 0.040451, 0, 0 (D-gap: 8.2748e-07) (sRGB)
- ~13 : 0.305647x^3 + 0.681703x^2 + 0.0126491x (Max error: 0.00166379)
 bTRC : 2.39999, 0.947861, 0.0521393, 0.0773926, 0.040451, 0, 0 (D-gap: 8.2748e-07) (sRGB)
- ~13 : 0.305647x^3 + 0.681703x^2 + 0.0126491x (Max error: 0.00166379)
 Best : 2.39999, 0.947861, 0.0521393, 0.0773926, 0.040451, 0, 0 (D-gap: 8.2748e-07) (sRGB)
- ~13 : 0.305647x^3 + 0.681703x^2 + 0.0126491x (Max error: 0.00166379)
  XYZ : | 0.515121460 0.291976929 0.157104492 |
        | 0.241195679 0.692245483 0.066574097 |
        | -0.001037598 0.041885376 0.784072876 |
diff --git a/profiles/mobile/iPhone7p.icc.txt b/profiles/mobile/iPhone7p.icc.txt
index 1b3350d..f4b8450 100644
--- a/profiles/mobile/iPhone7p.icc.txt
+++ b/profiles/mobile/iPhone7p.icc.txt
@@ -17,13 +17,9 @@
  'gTRC' : 'para' :     32 : 472
 
 rTRC : 2.39999, 0.947998, 0.052002, 0.0769958, 0.0390015, 0, 0 (D-gap: 4.88153e-06)
- ~13 : 0.305781x^3 + 0.681771x^2 + 0.012448x (Max error: 0.0016624)
 gTRC : 2.39999, 0.947998, 0.052002, 0.0769958, 0.0390015, 0, 0 (D-gap: 4.88153e-06)
- ~13 : 0.305781x^3 + 0.681771x^2 + 0.012448x (Max error: 0.0016624)
 bTRC : 2.39999, 0.947998, 0.052002, 0.0769958, 0.0390015, 0, 0 (D-gap: 4.88153e-06)
- ~13 : 0.305781x^3 + 0.681771x^2 + 0.012448x (Max error: 0.0016624)
 Best : 2.39999, 0.947998, 0.052002, 0.0769958, 0.0390015, 0, 0 (D-gap: 4.88153e-06)
- ~13 : 0.305781x^3 + 0.681771x^2 + 0.012448x (Max error: 0.0016624)
  XYZ : | 0.515121460 0.291976929 0.157104492 |
        | 0.241195679 0.692245483 0.066574097 |
        | -0.001052856 0.041885376 0.784072876 |
diff --git a/profiles/mobile/sRGB_LUT.icc.txt b/profiles/mobile/sRGB_LUT.icc.txt
index 19adeb4..2e696df 100644
--- a/profiles/mobile/sRGB_LUT.icc.txt
+++ b/profiles/mobile/sRGB_LUT.icc.txt
@@ -19,15 +19,11 @@
 
 rTRC : 16-bit table with 1024 entries
   ~= : 2.39978, 0.947934, 0.052081, 0.0777105, 0.0449658, -1.28639e-06, 0 (Max error: 0.000239041) (D-gap: 0)
- ~13 : 0.305305x^3 + 0.682172x^2 + 0.012523x (Max error: 0.00167628)
 gTRC : 16-bit table with 1024 entries
   ~= : 2.39978, 0.947934, 0.052081, 0.0777105, 0.0449658, -1.28639e-06, 0 (Max error: 0.000239041) (D-gap: 0)
- ~13 : 0.305305x^3 + 0.682172x^2 + 0.012523x (Max error: 0.00167628)
 bTRC : 16-bit table with 1024 entries
   ~= : 2.39978, 0.947934, 0.052081, 0.0777105, 0.0449658, -1.28639e-06, 0 (Max error: 0.000239041) (D-gap: 0)
- ~13 : 0.305305x^3 + 0.682172x^2 + 0.012523x (Max error: 0.00167628)
 Best : 2.39978, 0.947934, 0.052081, 0.0777105, 0.0449658, -1.28639e-06, 0 (D-gap: 0)
- ~13 : 0.305292x^3 + 0.682192x^2 + 0.0125157x (Max error: 0.00166641)
  XYZ : | 0.436035156 0.385116577 0.143051147 |
        | 0.222488403 0.716903687 0.060607910 |
        | 0.013916016 0.097061157 0.713912964 |
diff --git a/profiles/mobile/sRGB_parametric.icc.txt b/profiles/mobile/sRGB_parametric.icc.txt
index 7cd0643..118f7e5 100644
--- a/profiles/mobile/sRGB_parametric.icc.txt
+++ b/profiles/mobile/sRGB_parametric.icc.txt
@@ -18,13 +18,9 @@
  'gTRC' : 'para' :     32 : 520
 
 rTRC : 2.39999, 0.947861, 0.0521393, 0.0773926, 0.040451, 0, 0 (D-gap: 8.2748e-07) (sRGB)
- ~13 : 0.305647x^3 + 0.681703x^2 + 0.0126491x (Max error: 0.00166379)
 gTRC : 2.39999, 0.947861, 0.0521393, 0.0773926, 0.040451, 0, 0 (D-gap: 8.2748e-07) (sRGB)
- ~13 : 0.305647x^3 + 0.681703x^2 + 0.0126491x (Max error: 0.00166379)
 bTRC : 2.39999, 0.947861, 0.0521393, 0.0773926, 0.040451, 0, 0 (D-gap: 8.2748e-07) (sRGB)
- ~13 : 0.305647x^3 + 0.681703x^2 + 0.0126491x (Max error: 0.00166379)
 Best : 2.39999, 0.947861, 0.0521393, 0.0773926, 0.040451, 0, 0 (D-gap: 8.2748e-07) (sRGB)
- ~13 : 0.305647x^3 + 0.681703x^2 + 0.0126491x (Max error: 0.00166379)
  XYZ : | 0.436035156 0.385116577 0.143051147 |
        | 0.222488403 0.716903687 0.060607910 |
        | 0.013916016 0.097061157 0.713912964 |
diff --git a/profiles/sRGB_Facebook.icc.txt b/profiles/sRGB_Facebook.icc.txt
index 60293ac..fae22e0 100644
--- a/profiles/sRGB_Facebook.icc.txt
+++ b/profiles/sRGB_Facebook.icc.txt
@@ -18,15 +18,11 @@
 
 rTRC : 16-bit table with 26 entries
   ~= : 2.39737, 0.949209, 0.0506402, 0.0774395, 0.04, 0.000100383, 0 (Max error: 0.0013938) (D-gap: 0)
- ~13 : 0.307077x^3 + 0.681031x^2 + 0.0118921x (Max error: 0.0015126)
 gTRC : 16-bit table with 26 entries
   ~= : 2.39737, 0.949209, 0.0506402, 0.0774395, 0.04, 0.000100383, 0 (Max error: 0.0013938) (D-gap: 0)
- ~13 : 0.307077x^3 + 0.681031x^2 + 0.0118921x (Max error: 0.0015126)
 bTRC : 16-bit table with 26 entries
   ~= : 2.39737, 0.949209, 0.0506402, 0.0774395, 0.04, 0.000100383, 0 (Max error: 0.0013938) (D-gap: 0)
- ~13 : 0.307077x^3 + 0.681031x^2 + 0.0118921x (Max error: 0.0015126)
 Best : 2.39737, 0.949209, 0.0506402, 0.0774395, 0.04, 0.000100383, 0 (D-gap: 0)
- ~13 : 0.307302x^3 + 0.680676x^2 + 0.0120214x (Max error: 0.00167185)
  XYZ : | 0.436065674 0.385147095 0.143066406 |
        | 0.222488403 0.716873169 0.060607910 |
        | 0.013916016 0.097076416 0.714096069 |
diff --git a/skcms.c b/skcms.c
index b61063c..0fe2c7d 100644
--- a/skcms.c
+++ b/skcms.c
@@ -11,6 +11,5 @@
 #include "src/ICCProfile.c"
 #include "src/LinearAlgebra.c"
 #include "src/PortableMath.c"
-#include "src/TF13.c"
 #include "src/TransferFunction.c"
 #include "src/Transform.c"
diff --git a/skcms.h b/skcms.h
index 9c25b1d..54c9e8e 100644
--- a/skcms.h
+++ b/skcms.h
@@ -73,12 +73,6 @@
     skcms_Curve     output_curves[3];
 } skcms_A2B;
 
-// A specialized approximation for transfer functions with gamma between 1 and 3.
-//     f(x) = sign(x) * (A|x|^3 + B|x|^2 + (1-A-B)|x|)
-typedef struct skcms_TF13 {
-    float A,B;
-} skcms_TF13;
-
 typedef struct skcms_ICCProfile {
     const uint8_t* buffer;
 
@@ -103,10 +97,6 @@
     // and has_A2B to true.
     bool                   has_A2B;
     skcms_A2B              A2B;
-
-    // If has_trc, we may be able to approximate the curves more efficiently.
-    bool   has_tf13[3];
-    skcms_TF13 tf13[3];
 } skcms_ICCProfile;
 
 // The sRGB color profile is so commonly used that we offer a canonical skcms_ICCProfile for it.
@@ -131,8 +121,6 @@
 bool skcms_ApproximateCurve(const skcms_Curve* curve, skcms_TransferFunction* approx,
                             float* max_error);
 
-bool skcms_ApproximateCurve13(const skcms_Curve* curve, skcms_TF13* approx, float* max_error);
-
 // What is the best single transfer function to use for the given profile? Note that there is
 // no real upper bound on the error of this transfer function.
 skcms_TransferFunction skcms_BestSingleCurve(const skcms_ICCProfile*);
diff --git a/src/ICCProfile.c b/src/ICCProfile.c
index 3c3e02a..88b419d 100644
--- a/src/ICCProfile.c
+++ b/src/ICCProfile.c
@@ -782,11 +782,8 @@
 }
 
 void skcms_OptimizeForSpeed(skcms_ICCProfile* profile) {
-    // If we can approximate any of the TRC curves with a skcms_TF13, do so.
-    for (int i = 0; profile->has_trc && i < 3; i++) {
-        float err;
-        profile->has_tf13[i] = skcms_ApproximateCurve13(&profile->trc[i], &profile->tf13[i], &err);
-    }
+    (void)profile;
+    // TODO
 }
 
 const skcms_ICCProfile skcms_sRGB_profile = {
diff --git a/src/TF13.c b/src/TF13.c
deleted file mode 100644
index f6bdb3e..0000000
--- a/src/TF13.c
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright 2018 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "../skcms.h"
-#include "GaussNewton.h"
-#include "PortableMath.h"
-#include <assert.h>
-#include <limits.h>
-#include <stdlib.h>
-
-// Evaluating skcms_TF13{A,B} at x:
-//   f(x) = Ax^3 + Bx^2 + (1-A-B)x
-//
-//   ∂f/∂A = x^3 - x
-//   ∂f/∂B = x^2 - x
-
-static float eval_13(float x, const void* ctx, const float P[4]) {
-    (void)ctx;
-    return x*(x*(x*P[0] + P[1]) + (1 - P[0] - P[1]));
-}
-static void grad_13(float x, const void* ctx, const float P[4], float dfdP[4]) {
-    (void)ctx;
-    (void)P;
-    dfdP[0] = x*(x*x - 1);
-    dfdP[1] = x*(x   - 1);
-}
-
-bool skcms_ApproximateCurve13(const skcms_Curve* curve, skcms_TF13* approx, float* max_error) {
-    // Start a guess at skcms_TF13{0,1}, i.e. f(x) = x^2, i.e. gamma = 2.
-    // TODO: guess better somehow, like we do in skcms_ApproximateCurve()?
-    float P[4] = { 0,1, 0,0 };
-
-    if (curve->table_entries > (uint32_t)INT_MAX) {
-        // That's just crazy.
-        return false;
-    }
-    const int N = curve->table_entries == 0 ? 257 /*TODO: tune?*/
-                                            : (int)curve->table_entries;
-
-    for (int i = 0; i < 3/*TODO: Tune???*/; i++) {
-        if (!skcms_gauss_newton_step(skcms_eval_curve, curve,
-                                     eval_13, NULL,
-                                     grad_13, NULL,
-                                     P,
-                                     0,1,N)) {
-            return false;
-        }
-    }
-
-    *max_error = 0;
-    for (int i = 0; i < N; i++) {
-        float x = i * (1.0f / (N-1));
-
-        const float got  = eval_13(x,NULL,P),
-                    want = skcms_eval_curve(x, curve);
-
-        const float err = fabsf_(got - want);
-        if (err > *max_error) {
-            *max_error = err;
-        }
-
-        assert( isfinitef_(want) );
-        if (!isfinitef_(got)) {
-            return false;
-        }
-
-        // Compare what bytes we'd choose for these floats, rounded, and scaled by 255,
-        // but intentionally not clamped... if this goes negative, we want it to hurt.
-
-        const int gbyte = (int)(255.0f * got  + 0.5f),
-                  wbyte = (int)(255.0f * want + 0.5f);
-
-        // Allow no more than 1/256 error, and no error at all at the beginning or end.
-        const int tol = (i == 0 || i == N-1) ? 0
-                                             : 1;
-        if (abs(gbyte - wbyte) > tol) {
-            return false;
-        }
-    }
-
-    approx->A = P[0];
-    approx->B = P[1];
-    return true;
-}
diff --git a/src/Transform.c b/src/Transform.c
index 9bb1ccd..7238488 100644
--- a/src/Transform.c
+++ b/src/Transform.c
@@ -320,11 +320,6 @@
     const void* arg;
 } OpAndArg;
 
-static OpAndArg select_tf13_op(const skcms_TF13* tf, int channel) {
-    static const Op ops[] = { Op_tf13_r, Op_tf13_g, Op_tf13_b };
-    return (OpAndArg){ ops[channel], tf };
-}
-
 static OpAndArg select_curve_op(const skcms_Curve* curve, int channel) {
     static const struct { Op parametric, table_8, table_16; } ops[] = {
         { Op_tf_r, Op_table_8_r, Op_table_16_r },
@@ -524,13 +519,8 @@
 
         } else if (srcProfile->has_trc && srcProfile->has_toXYZD50) {
             for (int i = 0; i < 3; i++) {
-                // Favor Op_noop (identity curve) over anything else,
-                // and select_tf_op() over over select_curve_op() when possible.
                 OpAndArg oa = select_curve_op(&srcProfile->trc[i], i);
                 if (oa.op != Op_noop) {
-                    if (srcProfile->has_tf13[i]) {
-                        oa = select_tf13_op(&srcProfile->tf13[i], i);
-                    }
                     *ops++  = oa.op;
                     *args++ = oa.arg;
                 }
diff --git a/src/Transform.h b/src/Transform.h
index feb0dbc..1c4c15b 100644
--- a/src/Transform.h
+++ b/src/Transform.h
@@ -34,9 +34,6 @@
     M(tf_g)           \
     M(tf_b)           \
     M(tf_a)           \
-    M(tf13_r)         \
-    M(tf13_g)         \
-    M(tf13_b)         \
     M(table_8_r)      \
     M(table_8_g)      \
     M(table_8_b)      \
diff --git a/src/Transform_inl.h b/src/Transform_inl.h
index a3e6f2b..3f2ac3e 100644
--- a/src/Transform_inl.h
+++ b/src/Transform_inl.h
@@ -246,12 +246,6 @@
 }
 #define apply_transfer_function NS(apply_transfer_function_)
 
-SI ATTR F NS(apply_tf13_)(const skcms_TF13* tf, F x) {
-    F sign = (F)if_then_else(x < 0, -F1, F1);
-    return x*(x*(x*tf->A + sign*tf->B) + (1 - tf->A - tf->B) );
-}
-#define apply_tf13 NS(apply_tf13_)
-
 // Strided loads and stores of N values, starting from p.
 #if N == 1
     #define LOAD_3(T, p) (T)(p)[0]
@@ -853,10 +847,6 @@
             case Op_tf_b:{ b = apply_transfer_function(*args++, b); } break;
             case Op_tf_a:{ a = apply_transfer_function(*args++, a); } break;
 
-            case Op_tf13_r:{ r = apply_tf13(*args++, r); } break;
-            case Op_tf13_g:{ g = apply_tf13(*args++, g); } break;
-            case Op_tf13_b:{ b = apply_tf13(*args++, b); } break;
-
             case Op_table_8_r: { r = NS(table_8_ )(*args++, r); } break;
             case Op_table_8_g: { g = NS(table_8_ )(*args++, g); } break;
             case Op_table_8_b: { b = NS(table_8_ )(*args++, b); } break;
diff --git a/test_only.c b/test_only.c
index 256dcbf..43b72d9 100644
--- a/test_only.c
+++ b/test_only.c
@@ -87,11 +87,6 @@
         && tf->f == 0.0f;
 }
 
-static void dump_approx_tf13(FILE* fp, const skcms_TF13* tf, float max_error) {
-    fprintf(fp, " ~13 : %.6gx^3 + %.6gx^2 + %.6gx (Max error: %.6g)\n",
-            tf->A, tf->B, (1 - tf->A - tf->B), max_error);
-}
-
 static void dump_transfer_function(FILE* fp, const char* name,
                                    const skcms_TransferFunction* tf, float max_error) {
     fprintf(fp, "%4s : %.6g, %.6g, %.6g, %.6g, %.6g, %.6g, %.6g", name,
@@ -114,14 +109,6 @@
         fprintf(fp, " (Identity)");
     }
     fprintf(fp, "\n");
-
-    if (max_error == 0 && !is_identity(tf)) {
-        skcms_TF13 tf13;
-        skcms_Curve curve = { {0, *tf} };
-        if (skcms_ApproximateCurve13(&curve, &tf13, &max_error)) {
-            dump_approx_tf13(fp, &tf13, max_error);
-        }
-    }
 }
 
 static void dump_curve(FILE* fp, const char* name, const skcms_Curve* curve) {
@@ -135,10 +122,6 @@
         if (skcms_ApproximateCurve(curve, &tf, &max_error)) {
             dump_transfer_function(fp, "~=", &tf, max_error);
         }
-        skcms_TF13 tf13;
-        if (skcms_ApproximateCurve13(curve, &tf13, &max_error)) {
-            dump_approx_tf13(fp, &tf13, max_error);
-        }
     }
 }