Average Error: 2.2 → 2.2
Time: 4.3s
Precision: 64
\[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b\]
\[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b\]
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
double f(double x, double y, double z, double t, double a, double b) {
        double r652109 = x;
        double r652110 = y;
        double r652111 = z;
        double r652112 = r652110 * r652111;
        double r652113 = r652109 + r652112;
        double r652114 = t;
        double r652115 = a;
        double r652116 = r652114 * r652115;
        double r652117 = r652113 + r652116;
        double r652118 = r652115 * r652111;
        double r652119 = b;
        double r652120 = r652118 * r652119;
        double r652121 = r652117 + r652120;
        return r652121;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r652122 = x;
        double r652123 = y;
        double r652124 = z;
        double r652125 = r652123 * r652124;
        double r652126 = r652122 + r652125;
        double r652127 = t;
        double r652128 = a;
        double r652129 = r652127 * r652128;
        double r652130 = r652126 + r652129;
        double r652131 = r652128 * r652124;
        double r652132 = b;
        double r652133 = r652131 * r652132;
        double r652134 = r652130 + r652133;
        return r652134;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Bits error versus b

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original2.2
Target0.4
Herbie2.2
\[\begin{array}{l} \mathbf{if}\;z \lt -11820553527347888128:\\ \;\;\;\;z \cdot \left(b \cdot a + y\right) + \left(x + t \cdot a\right)\\ \mathbf{elif}\;z \lt 4.758974318836428710669076838657752600596 \cdot 10^{-122}:\\ \;\;\;\;\left(b \cdot z + t\right) \cdot a + \left(z \cdot y + x\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(b \cdot a + y\right) + \left(x + t \cdot a\right)\\ \end{array}\]

Derivation

  1. Initial program 2.2

    \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b\]
  2. Final simplification2.2

    \[\leadsto \left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b\]

Reproduce

herbie shell --seed 2019356 
(FPCore (x y z t a b)
  :name "Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1"
  :precision binary64

  :herbie-target
  (if (< z -11820553527347888000) (+ (* z (+ (* b a) y)) (+ x (* t a))) (if (< z 4.7589743188364287e-122) (+ (* (+ (* b z) t) a) (+ (* z y) x)) (+ (* z (+ (* b a) y)) (+ x (* t a)))))

  (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))