Average Error: 11.2 → 0.3
Time: 1.3m
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{y - z}{\frac{a - z}{t}} + x\\ \mathbf{elif}\;\frac{\left(y - z\right) \cdot t}{a - z} \le 1.208817151174808144933275494079202525346 \cdot 10^{285}:\\ \;\;\;\;\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{y - z}{\frac{a - z}{t}} + x\\

\mathbf{elif}\;\frac{\left(y - z\right) \cdot t}{a - z} \le 1.208817151174808144933275494079202525346 \cdot 10^{285}:\\
\;\;\;\;\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 r28740700 = x;
        double r28740701 = y;
        double r28740702 = z;
        double r28740703 = r28740701 - r28740702;
        double r28740704 = t;
        double r28740705 = r28740703 * r28740704;
        double r28740706 = a;
        double r28740707 = r28740706 - r28740702;
        double r28740708 = r28740705 / r28740707;
        double r28740709 = r28740700 + r28740708;
        return r28740709;
}

double f(double x, double y, double z, double t, double a) {
        double r28740710 = y;
        double r28740711 = z;
        double r28740712 = r28740710 - r28740711;
        double r28740713 = t;
        double r28740714 = r28740712 * r28740713;
        double r28740715 = a;
        double r28740716 = r28740715 - r28740711;
        double r28740717 = r28740714 / r28740716;
        double r28740718 = -inf.0;
        bool r28740719 = r28740717 <= r28740718;
        double r28740720 = r28740716 / r28740713;
        double r28740721 = r28740712 / r28740720;
        double r28740722 = x;
        double r28740723 = r28740721 + r28740722;
        double r28740724 = 1.2088171511748081e+285;
        bool r28740725 = r28740717 <= r28740724;
        double r28740726 = r28740717 + r28740722;
        double r28740727 = r28740725 ? r28740726 : r28740723;
        double r28740728 = r28740719 ? r28740723 : r28740727;
        return r28740728;
}

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

Original11.2
Target0.6
Herbie0.3
\[\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 2 regimes
  2. if (/ (* (- y z) t) (- a z)) < -inf.0 or 1.2088171511748081e+285 < (/ (* (- y z) t) (- a z))

    1. Initial program 62.0

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

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

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

    1. Initial program 0.3

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\left(y - z\right) \cdot t}{a - z} = -\infty:\\ \;\;\;\;\frac{y - z}{\frac{a - z}{t}} + x\\ \mathbf{elif}\;\frac{\left(y - z\right) \cdot t}{a - z} \le 1.208817151174808144933275494079202525346 \cdot 10^{285}:\\ \;\;\;\;\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 2019168 
(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))))