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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r562926 = x;
        double r562927 = y;
        double r562928 = z;
        double r562929 = t;
        double r562930 = r562928 - r562929;
        double r562931 = r562927 * r562930;
        double r562932 = a;
        double r562933 = r562932 - r562929;
        double r562934 = r562931 / r562933;
        double r562935 = r562926 + r562934;
        return r562935;
}

double f(double x, double y, double z, double t, double a) {
        double r562936 = y;
        double r562937 = z;
        double r562938 = t;
        double r562939 = r562937 - r562938;
        double r562940 = r562936 * r562939;
        double r562941 = a;
        double r562942 = r562941 - r562938;
        double r562943 = r562940 / r562942;
        double r562944 = -inf.0;
        bool r562945 = r562943 <= r562944;
        double r562946 = 5.090381290829383e+243;
        bool r562947 = r562943 <= r562946;
        double r562948 = !r562947;
        bool r562949 = r562945 || r562948;
        double r562950 = x;
        double r562951 = r562942 / r562939;
        double r562952 = r562936 / r562951;
        double r562953 = r562950 + r562952;
        double r562954 = r562950 + r562943;
        double r562955 = r562949 ? r562953 : r562954;
        return r562955;
}

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

Derivation

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

    1. Initial program 58.7

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

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

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

    1. Initial program 0.3

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

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

Reproduce

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

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

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