Average Error: 10.2 → 1.4
Time: 19.1s
Precision: 64
\[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;t \le -4.347512852047913:\\ \;\;\;\;x + \frac{y}{\frac{a}{z - t} - \frac{t}{z - t}}\\ \mathbf{elif}\;t \le 2.7589848075703794 \cdot 10^{-216}:\\ \;\;\;\;x + \frac{\left(z - t\right) \cdot y}{a - t}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{z - t}{a - t} + x\\ \end{array}\]
x + \frac{y \cdot \left(z - t\right)}{a - t}
\begin{array}{l}
\mathbf{if}\;t \le -4.347512852047913:\\
\;\;\;\;x + \frac{y}{\frac{a}{z - t} - \frac{t}{z - t}}\\

\mathbf{elif}\;t \le 2.7589848075703794 \cdot 10^{-216}:\\
\;\;\;\;x + \frac{\left(z - t\right) \cdot y}{a - t}\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r24426877 = x;
        double r24426878 = y;
        double r24426879 = z;
        double r24426880 = t;
        double r24426881 = r24426879 - r24426880;
        double r24426882 = r24426878 * r24426881;
        double r24426883 = a;
        double r24426884 = r24426883 - r24426880;
        double r24426885 = r24426882 / r24426884;
        double r24426886 = r24426877 + r24426885;
        return r24426886;
}

double f(double x, double y, double z, double t, double a) {
        double r24426887 = t;
        double r24426888 = -4.347512852047913;
        bool r24426889 = r24426887 <= r24426888;
        double r24426890 = x;
        double r24426891 = y;
        double r24426892 = a;
        double r24426893 = z;
        double r24426894 = r24426893 - r24426887;
        double r24426895 = r24426892 / r24426894;
        double r24426896 = r24426887 / r24426894;
        double r24426897 = r24426895 - r24426896;
        double r24426898 = r24426891 / r24426897;
        double r24426899 = r24426890 + r24426898;
        double r24426900 = 2.7589848075703794e-216;
        bool r24426901 = r24426887 <= r24426900;
        double r24426902 = r24426894 * r24426891;
        double r24426903 = r24426892 - r24426887;
        double r24426904 = r24426902 / r24426903;
        double r24426905 = r24426890 + r24426904;
        double r24426906 = r24426894 / r24426903;
        double r24426907 = r24426891 * r24426906;
        double r24426908 = r24426907 + r24426890;
        double r24426909 = r24426901 ? r24426905 : r24426908;
        double r24426910 = r24426889 ? r24426899 : r24426909;
        return r24426910;
}

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

Derivation

  1. Split input into 3 regimes
  2. if t < -4.347512852047913

    1. Initial program 16.2

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

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

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

    if -4.347512852047913 < t < 2.7589848075703794e-216

    1. Initial program 3.4

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

    if 2.7589848075703794e-216 < t

    1. Initial program 11.5

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -4.347512852047913:\\ \;\;\;\;x + \frac{y}{\frac{a}{z - t} - \frac{t}{z - t}}\\ \mathbf{elif}\;t \le 2.7589848075703794 \cdot 10^{-216}:\\ \;\;\;\;x + \frac{\left(z - t\right) \cdot y}{a - t}\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{z - t}{a - t} + x\\ \end{array}\]

Reproduce

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

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

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