Average Error: 10.8 → 0.4
Time: 2.9s
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 -1.3990348901059605 \cdot 10^{295}:\\ \;\;\;\;x + \frac{1}{\frac{a - z}{y - z}} \cdot t\\ \mathbf{elif}\;\frac{\left(y - z\right) \cdot t}{a - z} \le 1.11870472799551397 \cdot 10^{252}:\\ \;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - z}{a - z} \cdot 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 -1.3990348901059605 \cdot 10^{295}:\\
\;\;\;\;x + \frac{1}{\frac{a - z}{y - z}} \cdot t\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r535779 = x;
        double r535780 = y;
        double r535781 = z;
        double r535782 = r535780 - r535781;
        double r535783 = t;
        double r535784 = r535782 * r535783;
        double r535785 = a;
        double r535786 = r535785 - r535781;
        double r535787 = r535784 / r535786;
        double r535788 = r535779 + r535787;
        return r535788;
}

double f(double x, double y, double z, double t, double a) {
        double r535789 = y;
        double r535790 = z;
        double r535791 = r535789 - r535790;
        double r535792 = t;
        double r535793 = r535791 * r535792;
        double r535794 = a;
        double r535795 = r535794 - r535790;
        double r535796 = r535793 / r535795;
        double r535797 = -1.3990348901059605e+295;
        bool r535798 = r535796 <= r535797;
        double r535799 = x;
        double r535800 = 1.0;
        double r535801 = r535795 / r535791;
        double r535802 = r535800 / r535801;
        double r535803 = r535802 * r535792;
        double r535804 = r535799 + r535803;
        double r535805 = 1.118704727995514e+252;
        bool r535806 = r535796 <= r535805;
        double r535807 = r535799 + r535796;
        double r535808 = r535791 / r535795;
        double r535809 = r535808 * r535792;
        double r535810 = r535799 + r535809;
        double r535811 = r535806 ? r535807 : r535810;
        double r535812 = r535798 ? r535804 : r535811;
        return r535812;
}

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.8
Target0.7
Herbie0.4
\[\begin{array}{l} \mathbf{if}\;t \lt -1.0682974490174067 \cdot 10^{-39}:\\ \;\;\;\;x + \frac{y - z}{a - z} \cdot t\\ \mathbf{elif}\;t \lt 3.9110949887586375 \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 3 regimes
  2. if (/ (* (- y z) t) (- a z)) < -1.3990348901059605e+295

    1. Initial program 61.5

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

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

      \[\leadsto x + \color{blue}{\frac{y - z}{a - z} \cdot t}\]
    6. Using strategy rm
    7. Applied clear-num0.4

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

    if -1.3990348901059605e+295 < (/ (* (- y z) t) (- a z)) < 1.118704727995514e+252

    1. Initial program 0.3

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

    if 1.118704727995514e+252 < (/ (* (- y z) t) (- a z))

    1. Initial program 54.8

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

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

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

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

Reproduce

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