Average Error: 16.9 → 8.8
Time: 8.1s
Precision: 64
\[\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;a \le -1.47322666539955977712838229113003878126 \cdot 10^{-157}:\\ \;\;\;\;\left(x + y\right) - \frac{\frac{z - t}{a - t}}{\frac{1}{y}}\\ \mathbf{elif}\;a \le 1.019767468767238742050870882472042955611 \cdot 10^{-151}:\\ \;\;\;\;\frac{z \cdot y}{t} + x\\ \mathbf{else}:\\ \;\;\;\;\left(x + y\right) - \frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}} \cdot \frac{z - t}{\frac{\sqrt[3]{a - t}}{\sqrt[3]{y}}}\\ \end{array}\]
\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t}
\begin{array}{l}
\mathbf{if}\;a \le -1.47322666539955977712838229113003878126 \cdot 10^{-157}:\\
\;\;\;\;\left(x + y\right) - \frac{\frac{z - t}{a - t}}{\frac{1}{y}}\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r593108 = x;
        double r593109 = y;
        double r593110 = r593108 + r593109;
        double r593111 = z;
        double r593112 = t;
        double r593113 = r593111 - r593112;
        double r593114 = r593113 * r593109;
        double r593115 = a;
        double r593116 = r593115 - r593112;
        double r593117 = r593114 / r593116;
        double r593118 = r593110 - r593117;
        return r593118;
}

double f(double x, double y, double z, double t, double a) {
        double r593119 = a;
        double r593120 = -1.4732266653995598e-157;
        bool r593121 = r593119 <= r593120;
        double r593122 = x;
        double r593123 = y;
        double r593124 = r593122 + r593123;
        double r593125 = z;
        double r593126 = t;
        double r593127 = r593125 - r593126;
        double r593128 = r593119 - r593126;
        double r593129 = r593127 / r593128;
        double r593130 = 1.0;
        double r593131 = r593130 / r593123;
        double r593132 = r593129 / r593131;
        double r593133 = r593124 - r593132;
        double r593134 = 1.0197674687672387e-151;
        bool r593135 = r593119 <= r593134;
        double r593136 = r593125 * r593123;
        double r593137 = r593136 / r593126;
        double r593138 = r593137 + r593122;
        double r593139 = cbrt(r593123);
        double r593140 = r593139 * r593139;
        double r593141 = cbrt(r593128);
        double r593142 = r593141 * r593141;
        double r593143 = r593140 / r593142;
        double r593144 = r593141 / r593139;
        double r593145 = r593127 / r593144;
        double r593146 = r593143 * r593145;
        double r593147 = r593124 - r593146;
        double r593148 = r593135 ? r593138 : r593147;
        double r593149 = r593121 ? r593133 : r593148;
        return r593149;
}

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.9
Target8.5
Herbie8.8
\[\begin{array}{l} \mathbf{if}\;\left(x + y\right) - \frac{\left(z - t\right) \cdot y}{a - t} \lt -1.366497088939072697550672266103566343531 \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.475429344457723334351036314450840066235 \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 < -1.4732266653995598e-157

    1. Initial program 15.5

      \[\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 div-inv9.4

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

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

    if -1.4732266653995598e-157 < a < 1.0197674687672387e-151

    1. Initial program 21.6

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

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

    if 1.0197674687672387e-151 < a

    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*9.7

      \[\leadsto \left(x + y\right) - \color{blue}{\frac{z - t}{\frac{a - t}{y}}}\]
    4. Using strategy rm
    5. Applied add-cube-cbrt9.8

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

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

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

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

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

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

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

Reproduce

herbie shell --seed 2019322 
(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-7) (- (+ y x) (* (* (- z t) (/ 1 (- a t))) y)) (if (< (- (+ x y) (/ (* (- z t) y) (- a t))) 1.47542934445772333e-239) (/ (- (* y (- a z)) (* x t)) (- a t)) (- (+ y x) (* (* (- z t) (/ 1 (- a t))) y))))

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