Average Error: 10.0 → 0.8
Time: 17.6s
Precision: 64
\[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;y \le -2.1804944477325435 \cdot 10^{-119}:\\ \;\;\;\;\frac{y}{\frac{a - t}{z - t}} + x\\ \mathbf{elif}\;y \le 1.874636070202926 \cdot 10^{+60}:\\ \;\;\;\;x + \frac{1}{\frac{a - t}{y \cdot \left(z - t\right)}}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{z - t}{a - t} + x\\ \end{array}\]
x + \frac{y \cdot \left(z - t\right)}{a - t}
\begin{array}{l}
\mathbf{if}\;y \le -2.1804944477325435 \cdot 10^{-119}:\\
\;\;\;\;\frac{y}{\frac{a - t}{z - t}} + x\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r27367394 = x;
        double r27367395 = y;
        double r27367396 = z;
        double r27367397 = t;
        double r27367398 = r27367396 - r27367397;
        double r27367399 = r27367395 * r27367398;
        double r27367400 = a;
        double r27367401 = r27367400 - r27367397;
        double r27367402 = r27367399 / r27367401;
        double r27367403 = r27367394 + r27367402;
        return r27367403;
}

double f(double x, double y, double z, double t, double a) {
        double r27367404 = y;
        double r27367405 = -2.1804944477325435e-119;
        bool r27367406 = r27367404 <= r27367405;
        double r27367407 = a;
        double r27367408 = t;
        double r27367409 = r27367407 - r27367408;
        double r27367410 = z;
        double r27367411 = r27367410 - r27367408;
        double r27367412 = r27367409 / r27367411;
        double r27367413 = r27367404 / r27367412;
        double r27367414 = x;
        double r27367415 = r27367413 + r27367414;
        double r27367416 = 1.874636070202926e+60;
        bool r27367417 = r27367404 <= r27367416;
        double r27367418 = 1.0;
        double r27367419 = r27367404 * r27367411;
        double r27367420 = r27367409 / r27367419;
        double r27367421 = r27367418 / r27367420;
        double r27367422 = r27367414 + r27367421;
        double r27367423 = r27367411 / r27367409;
        double r27367424 = r27367404 * r27367423;
        double r27367425 = r27367424 + r27367414;
        double r27367426 = r27367417 ? r27367422 : r27367425;
        double r27367427 = r27367406 ? r27367415 : r27367426;
        return r27367427;
}

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.0
Target1.2
Herbie0.8
\[x + \frac{y}{\frac{a - t}{z - t}}\]

Derivation

  1. Split input into 3 regimes
  2. if y < -2.1804944477325435e-119

    1. Initial program 14.9

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

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

    if -2.1804944477325435e-119 < y < 1.874636070202926e+60

    1. Initial program 0.9

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

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

    if 1.874636070202926e+60 < y

    1. Initial program 25.3

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le -2.1804944477325435 \cdot 10^{-119}:\\ \;\;\;\;\frac{y}{\frac{a - t}{z - t}} + x\\ \mathbf{elif}\;y \le 1.874636070202926 \cdot 10^{+60}:\\ \;\;\;\;x + \frac{1}{\frac{a - t}{y \cdot \left(z - t\right)}}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{z - t}{a - t} + x\\ \end{array}\]

Reproduce

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

  :herbie-target
  (+ x (/ y (/ (- a t) (- z t))))

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