Average Error: 11.0 → 0.3
Time: 13.7s
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} = -\infty \lor \neg \left(\frac{\left(y - z\right) \cdot t}{a - z} \le 5.552371922583118058479301672117614849246 \cdot 10^{278}\right):\\ \;\;\;\;t \cdot \frac{y - z}{a - z} + x\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(y - z\right) \cdot t}{a - z} + x\\ \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} = -\infty \lor \neg \left(\frac{\left(y - z\right) \cdot t}{a - z} \le 5.552371922583118058479301672117614849246 \cdot 10^{278}\right):\\
\;\;\;\;t \cdot \frac{y - z}{a - z} + x\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r270798 = x;
        double r270799 = y;
        double r270800 = z;
        double r270801 = r270799 - r270800;
        double r270802 = t;
        double r270803 = r270801 * r270802;
        double r270804 = a;
        double r270805 = r270804 - r270800;
        double r270806 = r270803 / r270805;
        double r270807 = r270798 + r270806;
        return r270807;
}

double f(double x, double y, double z, double t, double a) {
        double r270808 = y;
        double r270809 = z;
        double r270810 = r270808 - r270809;
        double r270811 = t;
        double r270812 = r270810 * r270811;
        double r270813 = a;
        double r270814 = r270813 - r270809;
        double r270815 = r270812 / r270814;
        double r270816 = -inf.0;
        bool r270817 = r270815 <= r270816;
        double r270818 = 5.552371922583118e+278;
        bool r270819 = r270815 <= r270818;
        double r270820 = !r270819;
        bool r270821 = r270817 || r270820;
        double r270822 = r270810 / r270814;
        double r270823 = r270811 * r270822;
        double r270824 = x;
        double r270825 = r270823 + r270824;
        double r270826 = r270815 + r270824;
        double r270827 = r270821 ? r270825 : r270826;
        return r270827;
}

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.0
Target0.6
Herbie0.3
\[\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 (/ (* (- y z) t) (- a z)) < -inf.0 or 5.552371922583118e+278 < (/ (* (- y z) t) (- a z))

    1. Initial program 61.9

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

      \[\leadsto \color{blue}{\left(y - z\right) \cdot \frac{t}{a - z} + x}\]
    3. Using strategy rm
    4. Applied *-un-lft-identity0.6

      \[\leadsto \color{blue}{\left(1 \cdot \left(y - z\right)\right)} \cdot \frac{t}{a - z} + x\]
    5. Applied associate-*l*0.6

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

      \[\leadsto 1 \cdot \color{blue}{\frac{y - z}{\frac{a - z}{t}}} + x\]
    7. Using strategy rm
    8. Applied associate-/r/0.7

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

    if -inf.0 < (/ (* (- y z) t) (- a z)) < 5.552371922583118e+278

    1. Initial program 0.2

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

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

      \[\leadsto \color{blue}{\left(1 \cdot \left(y - z\right)\right)} \cdot \frac{t}{a - z} + x\]
    5. Applied associate-*l*3.7

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

      \[\leadsto 1 \cdot \color{blue}{\frac{y - z}{\frac{a - z}{t}}} + x\]
    7. Using strategy rm
    8. Applied associate-/r/1.5

      \[\leadsto 1 \cdot \color{blue}{\left(\frac{y - z}{a - z} \cdot t\right)} + x\]
    9. Using strategy rm
    10. Applied associate-*l/0.2

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

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

Reproduce

herbie shell --seed 2019174 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTick from plot-0.2.3.4, A"

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