Average Error: 10.5 → 0.5
Time: 15.8s
Precision: 64
\[x + \frac{y \cdot \left(z - t\right)}{z - a}\]
\[\begin{array}{l} \mathbf{if}\;\frac{\left(z - t\right) \cdot y}{z - a} = -\infty \lor \neg \left(\frac{\left(z - t\right) \cdot y}{z - a} \le 1.326863030035706713340013071666740295911 \cdot 10^{198}\right):\\ \;\;\;\;\frac{z - t}{z - a} \cdot y + x\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(z - t\right) \cdot y}{z - a} + x\\ \end{array}\]
x + \frac{y \cdot \left(z - t\right)}{z - a}
\begin{array}{l}
\mathbf{if}\;\frac{\left(z - t\right) \cdot y}{z - a} = -\infty \lor \neg \left(\frac{\left(z - t\right) \cdot y}{z - a} \le 1.326863030035706713340013071666740295911 \cdot 10^{198}\right):\\
\;\;\;\;\frac{z - t}{z - a} \cdot y + x\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r447837 = x;
        double r447838 = y;
        double r447839 = z;
        double r447840 = t;
        double r447841 = r447839 - r447840;
        double r447842 = r447838 * r447841;
        double r447843 = a;
        double r447844 = r447839 - r447843;
        double r447845 = r447842 / r447844;
        double r447846 = r447837 + r447845;
        return r447846;
}

double f(double x, double y, double z, double t, double a) {
        double r447847 = z;
        double r447848 = t;
        double r447849 = r447847 - r447848;
        double r447850 = y;
        double r447851 = r447849 * r447850;
        double r447852 = a;
        double r447853 = r447847 - r447852;
        double r447854 = r447851 / r447853;
        double r447855 = -inf.0;
        bool r447856 = r447854 <= r447855;
        double r447857 = 1.3268630300357067e+198;
        bool r447858 = r447854 <= r447857;
        double r447859 = !r447858;
        bool r447860 = r447856 || r447859;
        double r447861 = r447849 / r447853;
        double r447862 = r447861 * r447850;
        double r447863 = x;
        double r447864 = r447862 + r447863;
        double r447865 = r447854 + r447863;
        double r447866 = r447860 ? r447864 : r447865;
        return r447866;
}

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.5
Target1.2
Herbie0.5
\[x + \frac{y}{\frac{z - a}{z - t}}\]

Derivation

  1. Split input into 2 regimes
  2. if (/ (* y (- z t)) (- z a)) < -inf.0 or 1.3268630300357067e+198 < (/ (* y (- z t)) (- z a))

    1. Initial program 54.3

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

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

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

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

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

    1. Initial program 0.2

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

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

Reproduce

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

  :herbie-target
  (+ x (/ y (/ (- z a) (- z t))))

  (+ x (/ (* y (- z t)) (- z a))))