Average Error: 10.8 → 1.1
Time: 15.8s
Precision: 64
\[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;y \le -53707729796446982318388674560:\\ \;\;\;\;\left(z - t\right) \cdot \frac{y}{a - t} + x\\ \mathbf{elif}\;y \le 3.399514970595117862373233092554226553616 \cdot 10^{-80}:\\ \;\;\;\;x + \left(\left(z - t\right) \cdot y\right) \cdot \frac{1}{a - t}\\ \mathbf{else}:\\ \;\;\;\;\frac{y}{\frac{a - t}{z - t}} + x\\ \end{array}\]
x + \frac{y \cdot \left(z - t\right)}{a - t}
\begin{array}{l}
\mathbf{if}\;y \le -53707729796446982318388674560:\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{a - t} + x\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r26077806 = x;
        double r26077807 = y;
        double r26077808 = z;
        double r26077809 = t;
        double r26077810 = r26077808 - r26077809;
        double r26077811 = r26077807 * r26077810;
        double r26077812 = a;
        double r26077813 = r26077812 - r26077809;
        double r26077814 = r26077811 / r26077813;
        double r26077815 = r26077806 + r26077814;
        return r26077815;
}

double f(double x, double y, double z, double t, double a) {
        double r26077816 = y;
        double r26077817 = -5.370772979644698e+28;
        bool r26077818 = r26077816 <= r26077817;
        double r26077819 = z;
        double r26077820 = t;
        double r26077821 = r26077819 - r26077820;
        double r26077822 = a;
        double r26077823 = r26077822 - r26077820;
        double r26077824 = r26077816 / r26077823;
        double r26077825 = r26077821 * r26077824;
        double r26077826 = x;
        double r26077827 = r26077825 + r26077826;
        double r26077828 = 3.399514970595118e-80;
        bool r26077829 = r26077816 <= r26077828;
        double r26077830 = r26077821 * r26077816;
        double r26077831 = 1.0;
        double r26077832 = r26077831 / r26077823;
        double r26077833 = r26077830 * r26077832;
        double r26077834 = r26077826 + r26077833;
        double r26077835 = r26077823 / r26077821;
        double r26077836 = r26077816 / r26077835;
        double r26077837 = r26077836 + r26077826;
        double r26077838 = r26077829 ? r26077834 : r26077837;
        double r26077839 = r26077818 ? r26077827 : r26077838;
        return r26077839;
}

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

Derivation

  1. Split input into 3 regimes
  2. if y < -5.370772979644698e+28

    1. Initial program 25.6

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

      \[\leadsto x + \color{blue}{\frac{y}{\frac{a - t}{z - t}}}\]
    4. Using strategy rm
    5. Applied associate-/r/3.0

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

    if -5.370772979644698e+28 < y < 3.399514970595118e-80

    1. Initial program 0.6

      \[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
    2. Using strategy rm
    3. Applied div-inv0.6

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

    if 3.399514970595118e-80 < y

    1. Initial program 17.8

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

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

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

Reproduce

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