Average Error: 10.6 → 0.5
Time: 17.1s
Precision: 64
\[x + \frac{\left(y - z\right) \cdot t}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;\frac{\left(y - z\right) \cdot t}{a - z} = -\infty:\\ \;\;\;\;\frac{t}{a - z} \cdot \left(y - z\right) + x\\ \mathbf{elif}\;\frac{\left(y - z\right) \cdot t}{a - z} \le 1.385280461896290822518094696640655293447 \cdot 10^{187}:\\ \;\;\;\;\frac{\left(y - z\right) \cdot t}{a - z} + x\\ \mathbf{else}:\\ \;\;\;\;\frac{y - z}{\frac{a - z}{t}} + x\\ \end{array}\]
x + \frac{\left(y - z\right) \cdot t}{a - z}
\begin{array}{l}
\mathbf{if}\;\frac{\left(y - z\right) \cdot t}{a - z} = -\infty:\\
\;\;\;\;\frac{t}{a - z} \cdot \left(y - z\right) + x\\

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

\mathbf{else}:\\
\;\;\;\;\frac{y - z}{\frac{a - z}{t}} + x\\

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r30118271 = x;
        double r30118272 = y;
        double r30118273 = z;
        double r30118274 = r30118272 - r30118273;
        double r30118275 = t;
        double r30118276 = r30118274 * r30118275;
        double r30118277 = a;
        double r30118278 = r30118277 - r30118273;
        double r30118279 = r30118276 / r30118278;
        double r30118280 = r30118271 + r30118279;
        return r30118280;
}

double f(double x, double y, double z, double t, double a) {
        double r30118281 = y;
        double r30118282 = z;
        double r30118283 = r30118281 - r30118282;
        double r30118284 = t;
        double r30118285 = r30118283 * r30118284;
        double r30118286 = a;
        double r30118287 = r30118286 - r30118282;
        double r30118288 = r30118285 / r30118287;
        double r30118289 = -inf.0;
        bool r30118290 = r30118288 <= r30118289;
        double r30118291 = r30118284 / r30118287;
        double r30118292 = r30118291 * r30118283;
        double r30118293 = x;
        double r30118294 = r30118292 + r30118293;
        double r30118295 = 1.3852804618962908e+187;
        bool r30118296 = r30118288 <= r30118295;
        double r30118297 = r30118288 + r30118293;
        double r30118298 = r30118287 / r30118284;
        double r30118299 = r30118283 / r30118298;
        double r30118300 = r30118299 + r30118293;
        double r30118301 = r30118296 ? r30118297 : r30118300;
        double r30118302 = r30118290 ? r30118294 : r30118301;
        return r30118302;
}

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

Original10.6
Target0.6
Herbie0.5
\[\begin{array}{l} \mathbf{if}\;t \lt -1.068297449017406694366747246993994850729 \cdot 10^{-39}:\\ \;\;\;\;x + \frac{y - z}{a - z} \cdot t\\ \mathbf{elif}\;t \lt 3.911094988758637497591020599238553861375 \cdot 10^{-141}:\\ \;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - z}{a - z} \cdot t\\ \end{array}\]

Derivation

  1. Split input into 3 regimes
  2. if (/ (* (- y z) t) (- a z)) < -inf.0

    1. Initial program 64.0

      \[x + \frac{\left(y - z\right) \cdot t}{a - z}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity64.0

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

      \[\leadsto x + \color{blue}{\frac{y - z}{1} \cdot \frac{t}{a - z}}\]
    5. Simplified0.1

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

    if -inf.0 < (/ (* (- y z) t) (- a z)) < 1.3852804618962908e+187

    1. Initial program 0.3

      \[x + \frac{\left(y - z\right) \cdot t}{a - z}\]

    if 1.3852804618962908e+187 < (/ (* (- y z) t) (- a z))

    1. Initial program 45.0

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

      \[\leadsto x + \color{blue}{\frac{y - z}{\frac{a - z}{t}}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification0.5

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

Reproduce

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

  :herbie-target
  (if (< t -1.0682974490174067e-39) (+ x (* (/ (- y z) (- a z)) t)) (if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) (+ x (* (/ (- y z) (- a z)) t))))

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