Average Error: 10.3 → 1.3
Time: 4.8s
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.61575697840551178 \cdot 10^{250} \lor \neg \left(x + \frac{\left(y - z\right) \cdot t}{a - z} \le 3.4759182358395839 \cdot 10^{-101}\right):\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{t}{a - z}\\ \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.61575697840551178 \cdot 10^{250} \lor \neg \left(x + \frac{\left(y - z\right) \cdot t}{a - z} \le 3.4759182358395839 \cdot 10^{-101}\right):\\
\;\;\;\;x + \left(y - z\right) \cdot \frac{t}{a - z}\\

\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 r562868 = x;
        double r562869 = y;
        double r562870 = z;
        double r562871 = r562869 - r562870;
        double r562872 = t;
        double r562873 = r562871 * r562872;
        double r562874 = a;
        double r562875 = r562874 - r562870;
        double r562876 = r562873 / r562875;
        double r562877 = r562868 + r562876;
        return r562877;
}

double f(double x, double y, double z, double t, double a) {
        double r562878 = x;
        double r562879 = y;
        double r562880 = z;
        double r562881 = r562879 - r562880;
        double r562882 = t;
        double r562883 = r562881 * r562882;
        double r562884 = a;
        double r562885 = r562884 - r562880;
        double r562886 = r562883 / r562885;
        double r562887 = r562878 + r562886;
        double r562888 = -1.6157569784055118e+250;
        bool r562889 = r562887 <= r562888;
        double r562890 = 3.475918235839584e-101;
        bool r562891 = r562887 <= r562890;
        double r562892 = !r562891;
        bool r562893 = r562889 || r562892;
        double r562894 = r562882 / r562885;
        double r562895 = r562881 * r562894;
        double r562896 = r562878 + r562895;
        double r562897 = r562893 ? r562896 : r562887;
        return r562897;
}

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.3
Target0.5
Herbie1.3
\[\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 (+ x (/ (* (- y z) t) (- a z))) < -1.6157569784055118e+250 or 3.475918235839584e-101 < (+ x (/ (* (- y z) t) (- a z)))

    1. Initial program 18.0

      \[x + \frac{\left(y - z\right) \cdot t}{a - z}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity18.0

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

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

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

    if -1.6157569784055118e+250 < (+ x (/ (* (- y z) t) (- a z))) < 3.475918235839584e-101

    1. Initial program 0.4

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

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

Reproduce

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