Average Error: 16.7 → 9.2
Time: 1.1m
Precision: 64
\[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;\left(y + x\right) - \frac{\left(z - t\right) \cdot y}{a - t} = -\infty:\\ \;\;\;\;\frac{z \cdot y}{t} + x\\ \mathbf{elif}\;\left(y + x\right) - \frac{\left(z - t\right) \cdot y}{a - t} \le -2.959062809914101 \cdot 10^{-212}:\\ \;\;\;\;\left(y + x\right) - \frac{z - t}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}} \cdot \frac{y}{\sqrt[3]{a - t}}\\ \mathbf{elif}\;\left(y + x\right) - \frac{\left(z - t\right) \cdot y}{a - t} \le 0.0:\\ \;\;\;\;\frac{z \cdot y}{t} + x\\ \mathbf{else}:\\ \;\;\;\;\left(y + x\right) - \frac{\sqrt[3]{z - t} \cdot \sqrt[3]{z - t}}{\sqrt[3]{a - t}} \cdot \left(\frac{\sqrt[3]{z - t}}{\sqrt[3]{a - t}} \cdot \frac{y}{\sqrt[3]{a - t}}\right)\\ \end{array}\]
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\begin{array}{l}
\mathbf{if}\;\left(y + x\right) - \frac{\left(z - t\right) \cdot y}{a - t} = -\infty:\\
\;\;\;\;\frac{z \cdot y}{t} + x\\

\mathbf{elif}\;\left(y + x\right) - \frac{\left(z - t\right) \cdot y}{a - t} \le -2.959062809914101 \cdot 10^{-212}:\\
\;\;\;\;\left(y + x\right) - \frac{z - t}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}} \cdot \frac{y}{\sqrt[3]{a - t}}\\

\mathbf{elif}\;\left(y + x\right) - \frac{\left(z - t\right) \cdot y}{a - t} \le 0.0:\\
\;\;\;\;\frac{z \cdot y}{t} + x\\

\mathbf{else}:\\
\;\;\;\;\left(y + x\right) - \frac{\sqrt[3]{z - t} \cdot \sqrt[3]{z - t}}{\sqrt[3]{a - t}} \cdot \left(\frac{\sqrt[3]{z - t}}{\sqrt[3]{a - t}} \cdot \frac{y}{\sqrt[3]{a - t}}\right)\\

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r25754311 = x;
        double r25754312 = y;
        double r25754313 = r25754311 + r25754312;
        double r25754314 = z;
        double r25754315 = t;
        double r25754316 = r25754314 - r25754315;
        double r25754317 = r25754316 * r25754312;
        double r25754318 = a;
        double r25754319 = r25754318 - r25754315;
        double r25754320 = r25754317 / r25754319;
        double r25754321 = r25754313 - r25754320;
        return r25754321;
}

double f(double x, double y, double z, double t, double a) {
        double r25754322 = y;
        double r25754323 = x;
        double r25754324 = r25754322 + r25754323;
        double r25754325 = z;
        double r25754326 = t;
        double r25754327 = r25754325 - r25754326;
        double r25754328 = r25754327 * r25754322;
        double r25754329 = a;
        double r25754330 = r25754329 - r25754326;
        double r25754331 = r25754328 / r25754330;
        double r25754332 = r25754324 - r25754331;
        double r25754333 = -inf.0;
        bool r25754334 = r25754332 <= r25754333;
        double r25754335 = r25754325 * r25754322;
        double r25754336 = r25754335 / r25754326;
        double r25754337 = r25754336 + r25754323;
        double r25754338 = -2.959062809914101e-212;
        bool r25754339 = r25754332 <= r25754338;
        double r25754340 = cbrt(r25754330);
        double r25754341 = r25754340 * r25754340;
        double r25754342 = r25754327 / r25754341;
        double r25754343 = r25754322 / r25754340;
        double r25754344 = r25754342 * r25754343;
        double r25754345 = r25754324 - r25754344;
        double r25754346 = 0.0;
        bool r25754347 = r25754332 <= r25754346;
        double r25754348 = cbrt(r25754327);
        double r25754349 = r25754348 * r25754348;
        double r25754350 = r25754349 / r25754340;
        double r25754351 = r25754348 / r25754340;
        double r25754352 = r25754351 * r25754343;
        double r25754353 = r25754350 * r25754352;
        double r25754354 = r25754324 - r25754353;
        double r25754355 = r25754347 ? r25754337 : r25754354;
        double r25754356 = r25754339 ? r25754345 : r25754355;
        double r25754357 = r25754334 ? r25754337 : r25754356;
        return r25754357;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original16.7
Target8.6
Herbie9.2
\[\begin{array}{l} \mathbf{if}\;\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t} \lt -1.3664970889390727 \cdot 10^{-07}:\\ \;\;\;\;\left(y + x\right) - \left(\left(z - t\right) \cdot \frac{1.0}{a - t}\right) \cdot y\\ \mathbf{elif}\;\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t} \lt 1.4754293444577233 \cdot 10^{-239}:\\ \;\;\;\;\frac{y \cdot \left(a - z\right) - x \cdot t}{a - t}\\ \mathbf{else}:\\ \;\;\;\;\left(y + x\right) - \left(\left(z - t\right) \cdot \frac{1.0}{a - t}\right) \cdot y\\ \end{array}\]

Derivation

  1. Split input into 3 regimes
  2. if (- (+ x y) (/ (* (- z t) y) (- a t))) < -inf.0 or -2.959062809914101e-212 < (- (+ x y) (/ (* (- z t) y) (- a t))) < 0.0

    1. Initial program 59.9

      \[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\]
    2. Taylor expanded around inf 31.2

      \[\leadsto \color{blue}{\frac{z \cdot y}{t} + x}\]

    if -inf.0 < (- (+ x y) (/ (* (- z t) y) (- a t))) < -2.959062809914101e-212

    1. Initial program 1.2

      \[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt1.5

      \[\leadsto \left(x + y\right) - \frac{\left(z - t\right) \cdot y}{\color{blue}{\left(\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}\right) \cdot \sqrt[3]{a - t}}}\]
    4. Applied times-frac2.5

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

    if 0.0 < (- (+ x y) (/ (* (- z t) y) (- a t)))

    1. Initial program 13.4

      \[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt13.6

      \[\leadsto \left(x + y\right) - \frac{\left(z - t\right) \cdot y}{\color{blue}{\left(\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}\right) \cdot \sqrt[3]{a - t}}}\]
    4. Applied times-frac7.2

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

      \[\leadsto \left(x + y\right) - \frac{\color{blue}{\left(\sqrt[3]{z - t} \cdot \sqrt[3]{z - t}\right) \cdot \sqrt[3]{z - t}}}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}} \cdot \frac{y}{\sqrt[3]{a - t}}\]
    7. Applied times-frac7.3

      \[\leadsto \left(x + y\right) - \color{blue}{\left(\frac{\sqrt[3]{z - t} \cdot \sqrt[3]{z - t}}{\sqrt[3]{a - t}} \cdot \frac{\sqrt[3]{z - t}}{\sqrt[3]{a - t}}\right)} \cdot \frac{y}{\sqrt[3]{a - t}}\]
    8. Applied associate-*l*6.7

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(y + x\right) - \frac{\left(z - t\right) \cdot y}{a - t} = -\infty:\\ \;\;\;\;\frac{z \cdot y}{t} + x\\ \mathbf{elif}\;\left(y + x\right) - \frac{\left(z - t\right) \cdot y}{a - t} \le -2.959062809914101 \cdot 10^{-212}:\\ \;\;\;\;\left(y + x\right) - \frac{z - t}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}} \cdot \frac{y}{\sqrt[3]{a - t}}\\ \mathbf{elif}\;\left(y + x\right) - \frac{\left(z - t\right) \cdot y}{a - t} \le 0.0:\\ \;\;\;\;\frac{z \cdot y}{t} + x\\ \mathbf{else}:\\ \;\;\;\;\left(y + x\right) - \frac{\sqrt[3]{z - t} \cdot \sqrt[3]{z - t}}{\sqrt[3]{a - t}} \cdot \left(\frac{\sqrt[3]{z - t}}{\sqrt[3]{a - t}} \cdot \frac{y}{\sqrt[3]{a - t}}\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2019165 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, B"

  :herbie-target
  (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) -1.3664970889390727e-07) (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y)) (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) 1.4754293444577233e-239) (/ (- (* y (- a z)) (* x t)) (- a t)) (- (+ y x) (* (* (- z t) (/ 1.0 (- a t))) y))))

  (- (+ x y) (/ (* (- z t) y) (- a t))))