Average Error: 2.2 → 0.3
Time: 4.1s
Precision: 64
\[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b\]
\[\begin{array}{l} \mathbf{if}\;a \le -3.9050378667208727 \cdot 10^{64} \lor \neg \left(a \le 1.1639564676385755 \cdot 10^{-9}\right):\\ \;\;\;\;\left(\sqrt[3]{x + y \cdot z} \cdot \sqrt[3]{x + y \cdot z}\right) \cdot \sqrt[3]{x + y \cdot z} + a \cdot \left(z \cdot b + t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot \left(y + b \cdot a\right) + x\right) + t \cdot a\\ \end{array}\]
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\begin{array}{l}
\mathbf{if}\;a \le -3.9050378667208727 \cdot 10^{64} \lor \neg \left(a \le 1.1639564676385755 \cdot 10^{-9}\right):\\
\;\;\;\;\left(\sqrt[3]{x + y \cdot z} \cdot \sqrt[3]{x + y \cdot z}\right) \cdot \sqrt[3]{x + y \cdot z} + a \cdot \left(z \cdot b + t\right)\\

\mathbf{else}:\\
\;\;\;\;\left(z \cdot \left(y + b \cdot a\right) + x\right) + t \cdot a\\

\end{array}
double f(double x, double y, double z, double t, double a, double b) {
        double r620324 = x;
        double r620325 = y;
        double r620326 = z;
        double r620327 = r620325 * r620326;
        double r620328 = r620324 + r620327;
        double r620329 = t;
        double r620330 = a;
        double r620331 = r620329 * r620330;
        double r620332 = r620328 + r620331;
        double r620333 = r620330 * r620326;
        double r620334 = b;
        double r620335 = r620333 * r620334;
        double r620336 = r620332 + r620335;
        return r620336;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r620337 = a;
        double r620338 = -3.9050378667208727e+64;
        bool r620339 = r620337 <= r620338;
        double r620340 = 1.1639564676385755e-09;
        bool r620341 = r620337 <= r620340;
        double r620342 = !r620341;
        bool r620343 = r620339 || r620342;
        double r620344 = x;
        double r620345 = y;
        double r620346 = z;
        double r620347 = r620345 * r620346;
        double r620348 = r620344 + r620347;
        double r620349 = cbrt(r620348);
        double r620350 = r620349 * r620349;
        double r620351 = r620350 * r620349;
        double r620352 = b;
        double r620353 = r620346 * r620352;
        double r620354 = t;
        double r620355 = r620353 + r620354;
        double r620356 = r620337 * r620355;
        double r620357 = r620351 + r620356;
        double r620358 = r620352 * r620337;
        double r620359 = r620345 + r620358;
        double r620360 = r620346 * r620359;
        double r620361 = r620360 + r620344;
        double r620362 = r620354 * r620337;
        double r620363 = r620361 + r620362;
        double r620364 = r620343 ? r620357 : r620363;
        return r620364;
}

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
Herbie0.3
\[\begin{array}{l} \mathbf{if}\;z \lt -11820553527347888000:\\ \;\;\;\;z \cdot \left(b \cdot a + y\right) + \left(x + t \cdot a\right)\\ \mathbf{elif}\;z \lt 4.75897431883642871 \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. Split input into 2 regimes
  2. if a < -3.9050378667208727e+64 or 1.1639564676385755e-09 < a

    1. Initial program 5.4

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b\]
    2. Using strategy rm
    3. Applied associate-+l+5.4

      \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right)}\]
    4. Simplified0.1

      \[\leadsto \left(x + y \cdot z\right) + \color{blue}{a \cdot \left(z \cdot b + t\right)}\]
    5. Using strategy rm
    6. Applied add-cube-cbrt0.6

      \[\leadsto \color{blue}{\left(\sqrt[3]{x + y \cdot z} \cdot \sqrt[3]{x + y \cdot z}\right) \cdot \sqrt[3]{x + y \cdot z}} + a \cdot \left(z \cdot b + t\right)\]

    if -3.9050378667208727e+64 < a < 1.1639564676385755e-09

    1. Initial program 0.6

      \[\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b\]
    2. Using strategy rm
    3. Applied associate-+l+0.6

      \[\leadsto \color{blue}{\left(x + y \cdot z\right) + \left(t \cdot a + \left(a \cdot z\right) \cdot b\right)}\]
    4. Simplified3.8

      \[\leadsto \left(x + y \cdot z\right) + \color{blue}{a \cdot \left(z \cdot b + t\right)}\]
    5. Using strategy rm
    6. Applied distribute-rgt-in3.8

      \[\leadsto \left(x + y \cdot z\right) + \color{blue}{\left(\left(z \cdot b\right) \cdot a + t \cdot a\right)}\]
    7. Applied associate-+r+3.8

      \[\leadsto \color{blue}{\left(\left(x + y \cdot z\right) + \left(z \cdot b\right) \cdot a\right) + t \cdot a}\]
    8. Simplified0.2

      \[\leadsto \color{blue}{\left(z \cdot \left(y + b \cdot a\right) + x\right)} + t \cdot a\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.3

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \le -3.9050378667208727 \cdot 10^{64} \lor \neg \left(a \le 1.1639564676385755 \cdot 10^{-9}\right):\\ \;\;\;\;\left(\sqrt[3]{x + y \cdot z} \cdot \sqrt[3]{x + y \cdot z}\right) \cdot \sqrt[3]{x + y \cdot z} + a \cdot \left(z \cdot b + t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot \left(y + b \cdot a\right) + x\right) + t \cdot a\\ \end{array}\]

Reproduce

herbie shell --seed 2020081 
(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)))