Average Error: 10.6 → 0.8
Time: 11.6s
Precision: 64
\[x + \frac{\left(y - z\right) \cdot t}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;x + \frac{\left(y - z\right) \cdot t}{a - z} \le -1.998443844398416297441074055114822767484 \cdot 10^{93} \lor \neg \left(x + \frac{\left(y - z\right) \cdot t}{a - z} \le 6.204876559452910513674319072888367555996 \cdot 10^{260}\right):\\ \;\;\;\;x + \frac{y - z}{a - z} \cdot t\\ \mathbf{else}:\\ \;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a - z}\\ \end{array}\]
x + \frac{\left(y - z\right) \cdot t}{a - z}
\begin{array}{l}
\mathbf{if}\;x + \frac{\left(y - z\right) \cdot t}{a - z} \le -1.998443844398416297441074055114822767484 \cdot 10^{93} \lor \neg \left(x + \frac{\left(y - z\right) \cdot t}{a - z} \le 6.204876559452910513674319072888367555996 \cdot 10^{260}\right):\\
\;\;\;\;x + \frac{y - z}{a - z} \cdot t\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r481716 = x;
        double r481717 = y;
        double r481718 = z;
        double r481719 = r481717 - r481718;
        double r481720 = t;
        double r481721 = r481719 * r481720;
        double r481722 = a;
        double r481723 = r481722 - r481718;
        double r481724 = r481721 / r481723;
        double r481725 = r481716 + r481724;
        return r481725;
}

double f(double x, double y, double z, double t, double a) {
        double r481726 = x;
        double r481727 = y;
        double r481728 = z;
        double r481729 = r481727 - r481728;
        double r481730 = t;
        double r481731 = r481729 * r481730;
        double r481732 = a;
        double r481733 = r481732 - r481728;
        double r481734 = r481731 / r481733;
        double r481735 = r481726 + r481734;
        double r481736 = -1.9984438443984163e+93;
        bool r481737 = r481735 <= r481736;
        double r481738 = 6.20487655945291e+260;
        bool r481739 = r481735 <= r481738;
        double r481740 = !r481739;
        bool r481741 = r481737 || r481740;
        double r481742 = r481729 / r481733;
        double r481743 = r481742 * r481730;
        double r481744 = r481726 + r481743;
        double r481745 = r481741 ? r481744 : r481735;
        return r481745;
}

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.6
Target0.5
Herbie0.8
\[\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 (+ x (/ (* (- y z) t) (- a z))) < -1.9984438443984163e+93 or 6.20487655945291e+260 < (+ x (/ (* (- y z) t) (- a z)))

    1. Initial program 25.5

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

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

      \[\leadsto x + \frac{y - z}{\color{blue}{\left(a - z\right) \cdot \frac{1}{t}}}\]
    6. Applied associate-/r*1.7

      \[\leadsto x + \color{blue}{\frac{\frac{y - z}{a - z}}{\frac{1}{t}}}\]
    7. Using strategy rm
    8. Applied *-un-lft-identity1.7

      \[\leadsto x + \color{blue}{1 \cdot \frac{\frac{y - z}{a - z}}{\frac{1}{t}}}\]
    9. Applied *-un-lft-identity1.7

      \[\leadsto \color{blue}{1 \cdot x} + 1 \cdot \frac{\frac{y - z}{a - z}}{\frac{1}{t}}\]
    10. Applied distribute-lft-out1.7

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

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

    if -1.9984438443984163e+93 < (+ x (/ (* (- y z) t) (- a z))) < 6.20487655945291e+260

    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.8

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \frac{\left(y - z\right) \cdot t}{a - z} \le -1.998443844398416297441074055114822767484 \cdot 10^{93} \lor \neg \left(x + \frac{\left(y - z\right) \cdot t}{a - z} \le 6.204876559452910513674319072888367555996 \cdot 10^{260}\right):\\ \;\;\;\;x + \frac{y - z}{a - z} \cdot t\\ \mathbf{else}:\\ \;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a - z}\\ \end{array}\]

Reproduce

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