Average Error: 10.4 → 1.3
Time: 12.7s
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} \le 113823952470359359488:\\ \;\;\;\;x + \frac{y - z}{a - z} \cdot t\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - z}{\frac{a}{t} - \frac{z}{t}}\\ \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} \le 113823952470359359488:\\
\;\;\;\;x + \frac{y - z}{a - z} \cdot t\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r383575 = x;
        double r383576 = y;
        double r383577 = z;
        double r383578 = r383576 - r383577;
        double r383579 = t;
        double r383580 = r383578 * r383579;
        double r383581 = a;
        double r383582 = r383581 - r383577;
        double r383583 = r383580 / r383582;
        double r383584 = r383575 + r383583;
        return r383584;
}

double f(double x, double y, double z, double t, double a) {
        double r383585 = y;
        double r383586 = z;
        double r383587 = r383585 - r383586;
        double r383588 = t;
        double r383589 = r383587 * r383588;
        double r383590 = a;
        double r383591 = r383590 - r383586;
        double r383592 = r383589 / r383591;
        double r383593 = 1.1382395247035936e+20;
        bool r383594 = r383592 <= r383593;
        double r383595 = x;
        double r383596 = r383587 / r383591;
        double r383597 = r383596 * r383588;
        double r383598 = r383595 + r383597;
        double r383599 = r383590 / r383588;
        double r383600 = r383586 / r383588;
        double r383601 = r383599 - r383600;
        double r383602 = r383587 / r383601;
        double r383603 = r383595 + r383602;
        double r383604 = r383594 ? r383598 : r383603;
        return r383604;
}

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.4
Target0.6
Herbie1.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)) < 1.1382395247035936e+20

    1. Initial program 7.0

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

      \[\leadsto x + \color{blue}{\frac{y - z}{\frac{a - z}{t}}}\]
    4. Using strategy rm
    5. Applied associate-/r/0.9

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

    if 1.1382395247035936e+20 < (/ (* (- y z) t) (- a z))

    1. Initial program 24.2

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\left(y - z\right) \cdot t}{a - z} \le 113823952470359359488:\\ \;\;\;\;x + \frac{y - z}{a - z} \cdot t\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - z}{\frac{a}{t} - \frac{z}{t}}\\ \end{array}\]

Reproduce

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