Average Error: 11.1 → 1.5
Time: 3.5s
Precision: 64
\[x + \frac{\left(y - z\right) \cdot t}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;t \le -1.6636206562627744 \cdot 10^{22} \lor \neg \left(t \le 9.46017345656346148 \cdot 10^{-138}\right):\\ \;\;\;\;x + \frac{y - z}{\frac{a - z}{t}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{1}{a - z} \cdot \left(\left(y - z\right) \cdot t\right)\\ \end{array}\]
x + \frac{\left(y - z\right) \cdot t}{a - z}
\begin{array}{l}
\mathbf{if}\;t \le -1.6636206562627744 \cdot 10^{22} \lor \neg \left(t \le 9.46017345656346148 \cdot 10^{-138}\right):\\
\;\;\;\;x + \frac{y - z}{\frac{a - z}{t}}\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r627799 = x;
        double r627800 = y;
        double r627801 = z;
        double r627802 = r627800 - r627801;
        double r627803 = t;
        double r627804 = r627802 * r627803;
        double r627805 = a;
        double r627806 = r627805 - r627801;
        double r627807 = r627804 / r627806;
        double r627808 = r627799 + r627807;
        return r627808;
}

double f(double x, double y, double z, double t, double a) {
        double r627809 = t;
        double r627810 = -1.6636206562627744e+22;
        bool r627811 = r627809 <= r627810;
        double r627812 = 9.460173456563461e-138;
        bool r627813 = r627809 <= r627812;
        double r627814 = !r627813;
        bool r627815 = r627811 || r627814;
        double r627816 = x;
        double r627817 = y;
        double r627818 = z;
        double r627819 = r627817 - r627818;
        double r627820 = a;
        double r627821 = r627820 - r627818;
        double r627822 = r627821 / r627809;
        double r627823 = r627819 / r627822;
        double r627824 = r627816 + r627823;
        double r627825 = 1.0;
        double r627826 = r627825 / r627821;
        double r627827 = r627819 * r627809;
        double r627828 = r627826 * r627827;
        double r627829 = r627816 + r627828;
        double r627830 = r627815 ? r627824 : r627829;
        return r627830;
}

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

Original11.1
Target0.5
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 t < -1.6636206562627744e+22 or 9.460173456563461e-138 < t

    1. Initial program 19.6

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

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

    if -1.6636206562627744e+22 < t < 9.460173456563461e-138

    1. Initial program 0.3

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

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

      \[\leadsto x + \frac{y - z}{\color{blue}{\left(a - z\right) \cdot \frac{1}{t}}}\]
    6. Applied *-un-lft-identity3.7

      \[\leadsto x + \frac{\color{blue}{1 \cdot \left(y - z\right)}}{\left(a - z\right) \cdot \frac{1}{t}}\]
    7. Applied times-frac0.4

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -1.6636206562627744 \cdot 10^{22} \lor \neg \left(t \le 9.46017345656346148 \cdot 10^{-138}\right):\\ \;\;\;\;x + \frac{y - z}{\frac{a - z}{t}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{1}{a - z} \cdot \left(\left(y - z\right) \cdot t\right)\\ \end{array}\]

Reproduce

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