Average Error: 10.6 → 1.5
Time: 3.2s
Precision: 64
\[x + \frac{\left(y - z\right) \cdot t}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;a \le 2.1386523292688472 \cdot 10^{-208} \lor \neg \left(a \le 6.58189235516426902 \cdot 10^{-62}\right):\\ \;\;\;\;x + \frac{y - z}{a - z} \cdot t\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - z}{\frac{a - z}{t}}\\ \end{array}\]
x + \frac{\left(y - z\right) \cdot t}{a - z}
\begin{array}{l}
\mathbf{if}\;a \le 2.1386523292688472 \cdot 10^{-208} \lor \neg \left(a \le 6.58189235516426902 \cdot 10^{-62}\right):\\
\;\;\;\;x + \frac{y - z}{a - z} \cdot t\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r609781 = x;
        double r609782 = y;
        double r609783 = z;
        double r609784 = r609782 - r609783;
        double r609785 = t;
        double r609786 = r609784 * r609785;
        double r609787 = a;
        double r609788 = r609787 - r609783;
        double r609789 = r609786 / r609788;
        double r609790 = r609781 + r609789;
        return r609790;
}

double f(double x, double y, double z, double t, double a) {
        double r609791 = a;
        double r609792 = 2.138652329268847e-208;
        bool r609793 = r609791 <= r609792;
        double r609794 = 6.581892355164269e-62;
        bool r609795 = r609791 <= r609794;
        double r609796 = !r609795;
        bool r609797 = r609793 || r609796;
        double r609798 = x;
        double r609799 = y;
        double r609800 = z;
        double r609801 = r609799 - r609800;
        double r609802 = r609791 - r609800;
        double r609803 = r609801 / r609802;
        double r609804 = t;
        double r609805 = r609803 * r609804;
        double r609806 = r609798 + r609805;
        double r609807 = r609802 / r609804;
        double r609808 = r609801 / r609807;
        double r609809 = r609798 + r609808;
        double r609810 = r609797 ? r609806 : r609809;
        return r609810;
}

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.6
Herbie1.5
\[\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 2 regimes
  2. if a < 2.138652329268847e-208 or 6.581892355164269e-62 < a

    1. Initial program 10.8

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

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

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

    if 2.138652329268847e-208 < a < 6.581892355164269e-62

    1. Initial program 9.1

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

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

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

Reproduce

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