Average Error: 10.1 → 0.4
Time: 20.9s
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 r30555981 = x;
        double r30555982 = y;
        double r30555983 = z;
        double r30555984 = r30555982 - r30555983;
        double r30555985 = t;
        double r30555986 = r30555984 * r30555985;
        double r30555987 = a;
        double r30555988 = r30555987 - r30555983;
        double r30555989 = r30555986 / r30555988;
        double r30555990 = r30555981 + r30555989;
        return r30555990;
}

double f(double x, double y, double z, double t, double a) {
        double r30555991 = y;
        double r30555992 = z;
        double r30555993 = r30555991 - r30555992;
        double r30555994 = t;
        double r30555995 = r30555993 * r30555994;
        double r30555996 = a;
        double r30555997 = r30555996 - r30555992;
        double r30555998 = r30555995 / r30555997;
        double r30555999 = -inf.0;
        bool r30556000 = r30555998 <= r30555999;
        double r30556001 = r30555994 / r30555997;
        double r30556002 = r30556001 * r30555993;
        double r30556003 = x;
        double r30556004 = r30556002 + r30556003;
        double r30556005 = 1.8696604680231408e+251;
        bool r30556006 = r30555998 <= r30556005;
        double r30556007 = r30555998 + r30556003;
        double r30556008 = r30556006 ? r30556007 : r30556004;
        double r30556009 = r30556000 ? r30556004 : r30556008;
        return r30556009;
}

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