Average Error: 1.4 → 0.9
Time: 14.6s
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}:\\ \;\;\;\;\frac{\left(z - t\right) \cdot y}{z - a} + x\\ \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}:\\
\;\;\;\;\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 r456292 = x;
        double r456293 = y;
        double r456294 = z;
        double r456295 = t;
        double r456296 = r456294 - r456295;
        double r456297 = a;
        double r456298 = r456294 - r456297;
        double r456299 = r456296 / r456298;
        double r456300 = r456293 * r456299;
        double r456301 = r456292 + r456300;
        return r456301;
}

double f(double x, double y, double z, double t, double a) {
        double r456302 = y;
        double r456303 = -4.072361122530727e+71;
        bool r456304 = r456302 <= r456303;
        double r456305 = 1.0076840122372241e-126;
        bool r456306 = r456302 <= r456305;
        double r456307 = !r456306;
        bool r456308 = r456304 || r456307;
        double r456309 = x;
        double r456310 = z;
        double r456311 = t;
        double r456312 = r456310 - r456311;
        double r456313 = a;
        double r456314 = r456310 - r456313;
        double r456315 = r456312 / r456314;
        double r456316 = r456302 * r456315;
        double r456317 = r456309 + r456316;
        double r456318 = r456312 * r456302;
        double r456319 = r456318 / r456314;
        double r456320 = r456319 + r456309;
        double r456321 = r456308 ? r456317 : r456320;
        return r456321;
}

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 clear-num2.3

      \[\leadsto x + y \cdot \color{blue}{\frac{1}{\frac{z - a}{z - t}}}\]
    4. Using strategy rm
    5. Applied *-un-lft-identity2.3

      \[\leadsto x + \color{blue}{\left(1 \cdot y\right)} \cdot \frac{1}{\frac{z - a}{z - t}}\]
    6. Applied associate-*l*2.3

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

      \[\leadsto x + 1 \cdot \color{blue}{\frac{\left(z - t\right) \cdot y}{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}:\\ \;\;\;\;\frac{\left(z - t\right) \cdot y}{z - a} + x\\ \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)))))