Average Error: 11.0 → 1.6
Time: 4.4s
Precision: 64
\[x + \frac{\left(y - z\right) \cdot t}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;t \le -1.357518671446547766048546483194793195379 \cdot 10^{58} \lor \neg \left(t \le 2.189217803459049067385315526498657640437 \cdot 10^{-102}\right):\\ \;\;\;\;x + \left(\frac{y}{\frac{a - z}{t}} - \frac{z}{\frac{a - z}{t}}\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(\left(y - z\right) \cdot t\right) \cdot \frac{1}{a - z}\\ \end{array}\]
x + \frac{\left(y - z\right) \cdot t}{a - z}
\begin{array}{l}
\mathbf{if}\;t \le -1.357518671446547766048546483194793195379 \cdot 10^{58} \lor \neg \left(t \le 2.189217803459049067385315526498657640437 \cdot 10^{-102}\right):\\
\;\;\;\;x + \left(\frac{y}{\frac{a - z}{t}} - \frac{z}{\frac{a - z}{t}}\right)\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r487278 = x;
        double r487279 = y;
        double r487280 = z;
        double r487281 = r487279 - r487280;
        double r487282 = t;
        double r487283 = r487281 * r487282;
        double r487284 = a;
        double r487285 = r487284 - r487280;
        double r487286 = r487283 / r487285;
        double r487287 = r487278 + r487286;
        return r487287;
}

double f(double x, double y, double z, double t, double a) {
        double r487288 = t;
        double r487289 = -1.3575186714465478e+58;
        bool r487290 = r487288 <= r487289;
        double r487291 = 2.189217803459049e-102;
        bool r487292 = r487288 <= r487291;
        double r487293 = !r487292;
        bool r487294 = r487290 || r487293;
        double r487295 = x;
        double r487296 = y;
        double r487297 = a;
        double r487298 = z;
        double r487299 = r487297 - r487298;
        double r487300 = r487299 / r487288;
        double r487301 = r487296 / r487300;
        double r487302 = r487298 / r487300;
        double r487303 = r487301 - r487302;
        double r487304 = r487295 + r487303;
        double r487305 = r487296 - r487298;
        double r487306 = r487305 * r487288;
        double r487307 = 1.0;
        double r487308 = r487307 / r487299;
        double r487309 = r487306 * r487308;
        double r487310 = r487295 + r487309;
        double r487311 = r487294 ? r487304 : r487310;
        return r487311;
}

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.0
Target0.6
Herbie1.6
\[\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 t < -1.3575186714465478e+58 or 2.189217803459049e-102 < t

    1. Initial program 21.1

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

      \[\leadsto x + \color{blue}{\frac{y - z}{\frac{a - z}{t}}}\]
    4. Using strategy rm
    5. Applied div-sub2.4

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

    if -1.3575186714465478e+58 < t < 2.189217803459049e-102

    1. Initial program 0.9

      \[x + \frac{\left(y - z\right) \cdot t}{a - z}\]
    2. Using strategy rm
    3. Applied div-inv0.9

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -1.357518671446547766048546483194793195379 \cdot 10^{58} \lor \neg \left(t \le 2.189217803459049067385315526498657640437 \cdot 10^{-102}\right):\\ \;\;\;\;x + \left(\frac{y}{\frac{a - z}{t}} - \frac{z}{\frac{a - z}{t}}\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(\left(y - z\right) \cdot t\right) \cdot \frac{1}{a - z}\\ \end{array}\]

Reproduce

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

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