Average Error: 10.6 → 0.8
Time: 12.7s
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 r528479 = x;
        double r528480 = y;
        double r528481 = z;
        double r528482 = r528480 - r528481;
        double r528483 = t;
        double r528484 = r528482 * r528483;
        double r528485 = a;
        double r528486 = r528485 - r528481;
        double r528487 = r528484 / r528486;
        double r528488 = r528479 + r528487;
        return r528488;
}

double f(double x, double y, double z, double t, double a) {
        double r528489 = x;
        double r528490 = y;
        double r528491 = z;
        double r528492 = r528490 - r528491;
        double r528493 = t;
        double r528494 = r528492 * r528493;
        double r528495 = a;
        double r528496 = r528495 - r528491;
        double r528497 = r528494 / r528496;
        double r528498 = r528489 + r528497;
        double r528499 = -1.9984438443984163e+93;
        bool r528500 = r528498 <= r528499;
        double r528501 = 6.20487655945291e+260;
        bool r528502 = r528498 <= r528501;
        double r528503 = !r528502;
        bool r528504 = r528500 || r528503;
        double r528505 = r528492 / r528496;
        double r528506 = r528505 * r528493;
        double r528507 = r528489 + r528506;
        double r528508 = r528504 ? r528507 : r528498;
        return r528508;
}

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