Average Error: 16.6 → 6.8
Time: 4.6s
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 r654407 = x;
        double r654408 = y;
        double r654409 = r654407 + r654408;
        double r654410 = z;
        double r654411 = t;
        double r654412 = r654410 - r654411;
        double r654413 = r654412 * r654408;
        double r654414 = a;
        double r654415 = r654414 - r654411;
        double r654416 = r654413 / r654415;
        double r654417 = r654409 - r654416;
        return r654417;
}

double f(double x, double y, double z, double t, double a) {
        double r654418 = a;
        double r654419 = -8.734601441620599e-172;
        bool r654420 = r654418 <= r654419;
        double r654421 = x;
        double r654422 = y;
        double r654423 = 1.0;
        double r654424 = z;
        double r654425 = t;
        double r654426 = r654424 - r654425;
        double r654427 = r654418 - r654425;
        double r654428 = r654426 / r654427;
        double r654429 = r654423 - r654428;
        double r654430 = cbrt(r654429);
        double r654431 = r654430 * r654430;
        double r654432 = r654431 * r654430;
        double r654433 = r654422 * r654432;
        double r654434 = r654421 + r654433;
        double r654435 = 2.8818750144483414e-168;
        bool r654436 = r654418 <= r654435;
        double r654437 = r654424 / r654425;
        double r654438 = r654422 * r654437;
        double r654439 = r654421 + r654438;
        double r654440 = r654423 / r654422;
        double r654441 = r654428 / r654440;
        double r654442 = r654422 - r654441;
        double r654443 = r654421 + r654442;
        double r654444 = r654436 ? r654439 : r654443;
        double r654445 = r654420 ? r654434 : r654444;
        return r654445;
}

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))))