Average Error: 2.2 → 0.6
Time: 4.9s
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 -1.273932173214477057730693817092682574417 \cdot 10^{100} \lor \neg \left(a \le 1.243496909209019393497569014876585765327 \cdot 10^{-118} \lor \neg \left(a \le 3.574603319696684885102771900736830859238 \cdot 10^{304}\right)\right):\\ \;\;\;\;y \cdot z + \left(x + a \cdot \left(t + z \cdot b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b\\ \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 -1.273932173214477057730693817092682574417 \cdot 10^{100} \lor \neg \left(a \le 1.243496909209019393497569014876585765327 \cdot 10^{-118} \lor \neg \left(a \le 3.574603319696684885102771900736830859238 \cdot 10^{304}\right)\right):\\
\;\;\;\;y \cdot z + \left(x + a \cdot \left(t + z \cdot b\right)\right)\\

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

\end{array}
double f(double x, double y, double z, double t, double a, double b) {
        double r734473 = x;
        double r734474 = y;
        double r734475 = z;
        double r734476 = r734474 * r734475;
        double r734477 = r734473 + r734476;
        double r734478 = t;
        double r734479 = a;
        double r734480 = r734478 * r734479;
        double r734481 = r734477 + r734480;
        double r734482 = r734479 * r734475;
        double r734483 = b;
        double r734484 = r734482 * r734483;
        double r734485 = r734481 + r734484;
        return r734485;
}

double f(double x, double y, double z, double t, double a, double b) {
        double r734486 = a;
        double r734487 = -1.273932173214477e+100;
        bool r734488 = r734486 <= r734487;
        double r734489 = 1.2434969092090194e-118;
        bool r734490 = r734486 <= r734489;
        double r734491 = 3.574603319696685e+304;
        bool r734492 = r734486 <= r734491;
        double r734493 = !r734492;
        bool r734494 = r734490 || r734493;
        double r734495 = !r734494;
        bool r734496 = r734488 || r734495;
        double r734497 = y;
        double r734498 = z;
        double r734499 = r734497 * r734498;
        double r734500 = x;
        double r734501 = t;
        double r734502 = b;
        double r734503 = r734498 * r734502;
        double r734504 = r734501 + r734503;
        double r734505 = r734486 * r734504;
        double r734506 = r734500 + r734505;
        double r734507 = r734499 + r734506;
        double r734508 = r734500 + r734499;
        double r734509 = r734501 * r734486;
        double r734510 = r734508 + r734509;
        double r734511 = r734486 * r734498;
        double r734512 = r734511 * r734502;
        double r734513 = r734510 + r734512;
        double r734514 = r734496 ? r734507 : r734513;
        return r734514;
}

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.3
Herbie0.6
\[\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. Split input into 2 regimes
  2. if a < -1.273932173214477e+100 or 1.2434969092090194e-118 < a < 3.574603319696685e+304

    1. Initial program 4.5

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

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

    if -1.273932173214477e+100 < a < 1.2434969092090194e-118 or 3.574603319696685e+304 < a

    1. Initial program 0.7

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \le -1.273932173214477057730693817092682574417 \cdot 10^{100} \lor \neg \left(a \le 1.243496909209019393497569014876585765327 \cdot 10^{-118} \lor \neg \left(a \le 3.574603319696684885102771900736830859238 \cdot 10^{304}\right)\right):\\ \;\;\;\;y \cdot z + \left(x + a \cdot \left(t + z \cdot b\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b\\ \end{array}\]

Reproduce

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