Average Error: 10.1 → 0.4
Time: 19.5s
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.8696604680231408 \cdot 10^{+251}:\\ \;\;\;\;\frac{\left(y - z\right) \cdot t}{a - z} + x\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{a - z} \cdot \left(y - z\right) + 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.8696604680231408 \cdot 10^{+251}:\\
\;\;\;\;\frac{\left(y - z\right) \cdot t}{a - z} + x\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r26940377 = x;
        double r26940378 = y;
        double r26940379 = z;
        double r26940380 = r26940378 - r26940379;
        double r26940381 = t;
        double r26940382 = r26940380 * r26940381;
        double r26940383 = a;
        double r26940384 = r26940383 - r26940379;
        double r26940385 = r26940382 / r26940384;
        double r26940386 = r26940377 + r26940385;
        return r26940386;
}

double f(double x, double y, double z, double t, double a) {
        double r26940387 = y;
        double r26940388 = z;
        double r26940389 = r26940387 - r26940388;
        double r26940390 = t;
        double r26940391 = r26940389 * r26940390;
        double r26940392 = a;
        double r26940393 = r26940392 - r26940388;
        double r26940394 = r26940391 / r26940393;
        double r26940395 = -inf.0;
        bool r26940396 = r26940394 <= r26940395;
        double r26940397 = r26940390 / r26940393;
        double r26940398 = r26940397 * r26940389;
        double r26940399 = x;
        double r26940400 = r26940398 + r26940399;
        double r26940401 = 1.8696604680231408e+251;
        bool r26940402 = r26940394 <= r26940401;
        double r26940403 = r26940394 + r26940399;
        double r26940404 = r26940402 ? r26940403 : r26940400;
        double r26940405 = r26940396 ? r26940400 : r26940404;
        return r26940405;
}

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.1
Target0.6
Herbie0.4
\[\begin{array}{l} \mathbf{if}\;t \lt -1.0682974490174067 \cdot 10^{-39}:\\ \;\;\;\;x + \frac{y - z}{a - z} \cdot t\\ \mathbf{elif}\;t \lt 3.9110949887586375 \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 2 regimes
  2. if (/ (* (- y z) t) (- a z)) < -inf.0 or 1.8696604680231408e+251 < (/ (* (- y z) t) (- a z))

    1. Initial program 55.7

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

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

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

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

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

    1. Initial program 0.2

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

    \[\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.8696604680231408 \cdot 10^{+251}:\\ \;\;\;\;\frac{\left(y - z\right) \cdot t}{a - z} + x\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{a - z} \cdot \left(y - z\right) + x\\ \end{array}\]

Reproduce

herbie shell --seed 2019163 
(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))))