Average Error: 1.4 → 0.9
Time: 15.4s
Precision: 64
\[x + y \cdot \frac{z - t}{z - a}\]
\[\begin{array}{l} \mathbf{if}\;y \le -4.072361122530726800725634858682369937409 \cdot 10^{71} \lor \neg \left(y \le 1.007684012237224146847316966965214691878 \cdot 10^{-126}\right):\\ \;\;\;\;x + y \cdot \frac{z - t}{z - a}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y \cdot \left(z - t\right)}{z - a}\\ \end{array}\]
x + y \cdot \frac{z - t}{z - a}
\begin{array}{l}
\mathbf{if}\;y \le -4.072361122530726800725634858682369937409 \cdot 10^{71} \lor \neg \left(y \le 1.007684012237224146847316966965214691878 \cdot 10^{-126}\right):\\
\;\;\;\;x + y \cdot \frac{z - t}{z - a}\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r405980 = x;
        double r405981 = y;
        double r405982 = z;
        double r405983 = t;
        double r405984 = r405982 - r405983;
        double r405985 = a;
        double r405986 = r405982 - r405985;
        double r405987 = r405984 / r405986;
        double r405988 = r405981 * r405987;
        double r405989 = r405980 + r405988;
        return r405989;
}

double f(double x, double y, double z, double t, double a) {
        double r405990 = y;
        double r405991 = -4.072361122530727e+71;
        bool r405992 = r405990 <= r405991;
        double r405993 = 1.0076840122372241e-126;
        bool r405994 = r405990 <= r405993;
        double r405995 = !r405994;
        bool r405996 = r405992 || r405995;
        double r405997 = x;
        double r405998 = z;
        double r405999 = t;
        double r406000 = r405998 - r405999;
        double r406001 = a;
        double r406002 = r405998 - r406001;
        double r406003 = r406000 / r406002;
        double r406004 = r405990 * r406003;
        double r406005 = r405997 + r406004;
        double r406006 = r405990 * r406000;
        double r406007 = r406006 / r406002;
        double r406008 = r405997 + r406007;
        double r406009 = r405996 ? r406005 : r406008;
        return r406009;
}

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

Original1.4
Target1.3
Herbie0.9
\[x + \frac{y}{\frac{z - a}{z - t}}\]

Derivation

  1. Split input into 2 regimes
  2. if y < -4.072361122530727e+71 or 1.0076840122372241e-126 < y

    1. Initial program 0.6

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

    if -4.072361122530727e+71 < y < 1.0076840122372241e-126

    1. Initial program 2.3

      \[x + y \cdot \frac{z - t}{z - a}\]
    2. Using strategy rm
    3. Applied associate-*r/1.1

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

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

Reproduce

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

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

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