Average Error: 16.6 → 6.8
Time: 4.4s
Precision: 64
\[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;a \le -8.7346014416205993 \cdot 10^{-172}:\\ \;\;\;\;x + y \cdot \left(\left(\sqrt[3]{1 - \frac{z - t}{a - t}} \cdot \sqrt[3]{1 - \frac{z - t}{a - t}}\right) \cdot \sqrt[3]{1 - \frac{z - t}{a - t}}\right)\\ \mathbf{elif}\;a \le 2.88187501444834143 \cdot 10^{-168}:\\ \;\;\;\;x + y \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;x + \left(y - \frac{\frac{z - t}{a - t}}{\frac{1}{y}}\right)\\ \end{array}\]
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\begin{array}{l}
\mathbf{if}\;a \le -8.7346014416205993 \cdot 10^{-172}:\\
\;\;\;\;x + y \cdot \left(\left(\sqrt[3]{1 - \frac{z - t}{a - t}} \cdot \sqrt[3]{1 - \frac{z - t}{a - t}}\right) \cdot \sqrt[3]{1 - \frac{z - t}{a - t}}\right)\\

\mathbf{elif}\;a \le 2.88187501444834143 \cdot 10^{-168}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\

\mathbf{else}:\\
\;\;\;\;x + \left(y - \frac{\frac{z - t}{a - t}}{\frac{1}{y}}\right)\\

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r637439 = x;
        double r637440 = y;
        double r637441 = r637439 + r637440;
        double r637442 = z;
        double r637443 = t;
        double r637444 = r637442 - r637443;
        double r637445 = r637444 * r637440;
        double r637446 = a;
        double r637447 = r637446 - r637443;
        double r637448 = r637445 / r637447;
        double r637449 = r637441 - r637448;
        return r637449;
}

double f(double x, double y, double z, double t, double a) {
        double r637450 = a;
        double r637451 = -8.734601441620599e-172;
        bool r637452 = r637450 <= r637451;
        double r637453 = x;
        double r637454 = y;
        double r637455 = 1.0;
        double r637456 = z;
        double r637457 = t;
        double r637458 = r637456 - r637457;
        double r637459 = r637450 - r637457;
        double r637460 = r637458 / r637459;
        double r637461 = r637455 - r637460;
        double r637462 = cbrt(r637461);
        double r637463 = r637462 * r637462;
        double r637464 = r637463 * r637462;
        double r637465 = r637454 * r637464;
        double r637466 = r637453 + r637465;
        double r637467 = 2.8818750144483414e-168;
        bool r637468 = r637450 <= r637467;
        double r637469 = r637456 / r637457;
        double r637470 = r637454 * r637469;
        double r637471 = r637453 + r637470;
        double r637472 = r637455 / r637454;
        double r637473 = r637460 / r637472;
        double r637474 = r637454 - r637473;
        double r637475 = r637453 + r637474;
        double r637476 = r637468 ? r637471 : r637475;
        double r637477 = r637452 ? r637466 : r637476;
        return r637477;
}

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.6
Target8.2
Herbie6.8
\[\begin{array}{l} \mathbf{if}\;\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t} \lt -1.3664970889390727 \cdot 10^{-7}:\\ \;\;\;\;\left(y + x\right) - \left(\left(z - t\right) \cdot \frac{1}{a - t}\right) \cdot y\\ \mathbf{elif}\;\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t} \lt 1.47542934445772333 \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}{a - t}\right) \cdot y\\ \end{array}\]

Derivation

  1. Split input into 3 regimes
  2. if a < -8.734601441620599e-172

    1. Initial program 15.6

      \[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\]
    2. Using strategy rm
    3. Applied associate-/l*10.1

      \[\leadsto \left(x + y\right) - \color{blue}{\frac{z - t}{\frac{a - t}{y}}}\]
    4. Using strategy rm
    5. Applied associate--l+8.1

      \[\leadsto \color{blue}{x + \left(y - \frac{z - t}{\frac{a - t}{y}}\right)}\]
    6. Using strategy rm
    7. Applied associate-/r/6.5

      \[\leadsto x + \left(y - \color{blue}{\frac{z - t}{a - t} \cdot y}\right)\]
    8. Applied *-un-lft-identity6.5

      \[\leadsto x + \left(\color{blue}{1 \cdot y} - \frac{z - t}{a - t} \cdot y\right)\]
    9. Applied distribute-rgt-out--6.5

      \[\leadsto x + \color{blue}{y \cdot \left(1 - \frac{z - t}{a - t}\right)}\]
    10. Using strategy rm
    11. Applied add-cube-cbrt6.6

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

    if -8.734601441620599e-172 < a < 2.8818750144483414e-168

    1. Initial program 21.9

      \[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\]
    2. Using strategy rm
    3. Applied associate-/l*20.3

      \[\leadsto \left(x + y\right) - \color{blue}{\frac{z - t}{\frac{a - t}{y}}}\]
    4. Using strategy rm
    5. Applied associate--l+14.2

      \[\leadsto \color{blue}{x + \left(y - \frac{z - t}{\frac{a - t}{y}}\right)}\]
    6. Using strategy rm
    7. Applied associate-/r/12.6

      \[\leadsto x + \left(y - \color{blue}{\frac{z - t}{a - t} \cdot y}\right)\]
    8. Applied *-un-lft-identity12.6

      \[\leadsto x + \left(\color{blue}{1 \cdot y} - \frac{z - t}{a - t} \cdot y\right)\]
    9. Applied distribute-rgt-out--12.6

      \[\leadsto x + \color{blue}{y \cdot \left(1 - \frac{z - t}{a - t}\right)}\]
    10. Taylor expanded around inf 7.7

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

    if 2.8818750144483414e-168 < a

    1. Initial program 14.8

      \[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\]
    2. Using strategy rm
    3. Applied associate-/l*9.4

      \[\leadsto \left(x + y\right) - \color{blue}{\frac{z - t}{\frac{a - t}{y}}}\]
    4. Using strategy rm
    5. Applied associate--l+7.4

      \[\leadsto \color{blue}{x + \left(y - \frac{z - t}{\frac{a - t}{y}}\right)}\]
    6. Using strategy rm
    7. Applied div-inv7.8

      \[\leadsto x + \left(y - \frac{z - t}{\color{blue}{\left(a - t\right) \cdot \frac{1}{y}}}\right)\]
    8. Applied associate-/r*6.4

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \le -8.7346014416205993 \cdot 10^{-172}:\\ \;\;\;\;x + y \cdot \left(\left(\sqrt[3]{1 - \frac{z - t}{a - t}} \cdot \sqrt[3]{1 - \frac{z - t}{a - t}}\right) \cdot \sqrt[3]{1 - \frac{z - t}{a - t}}\right)\\ \mathbf{elif}\;a \le 2.88187501444834143 \cdot 10^{-168}:\\ \;\;\;\;x + y \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;x + \left(y - \frac{\frac{z - t}{a - t}}{\frac{1}{y}}\right)\\ \end{array}\]

Reproduce

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

  :herbie-target
  (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) -1.3664970889390727e-07) (- (+ y x) (* (* (- z t) (/ 1 (- 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 (- a t))) y))))

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