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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r479780 = x;
        double r479781 = y;
        double r479782 = z;
        double r479783 = t;
        double r479784 = r479782 - r479783;
        double r479785 = a;
        double r479786 = r479782 - r479785;
        double r479787 = r479784 / r479786;
        double r479788 = r479781 * r479787;
        double r479789 = r479780 + r479788;
        return r479789;
}

double f(double x, double y, double z, double t, double a) {
        double r479790 = y;
        double r479791 = -3.2594727633548683e+87;
        bool r479792 = r479790 <= r479791;
        double r479793 = 1.4513944166191972e-07;
        bool r479794 = r479790 <= r479793;
        double r479795 = !r479794;
        bool r479796 = r479792 || r479795;
        double r479797 = x;
        double r479798 = z;
        double r479799 = t;
        double r479800 = r479798 - r479799;
        double r479801 = a;
        double r479802 = r479798 - r479801;
        double r479803 = r479800 / r479802;
        double r479804 = r479790 * r479803;
        double r479805 = r479797 + r479804;
        double r479806 = r479800 * r479790;
        double r479807 = r479806 / r479802;
        double r479808 = r479797 + r479807;
        double r479809 = r479796 ? r479805 : r479808;
        return r479809;
}

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

Derivation

  1. Split input into 2 regimes
  2. if y < -3.2594727633548683e+87 or 1.4513944166191972e-07 < y

    1. Initial program 0.6

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

    if -3.2594727633548683e+87 < y < 1.4513944166191972e-07

    1. Initial program 2.0

      \[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}}\]
    4. Simplified1.1

      \[\leadsto x + \frac{\color{blue}{\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 -3.25947276335486826 \cdot 10^{87} \lor \neg \left(y \le 1.45139441661919718 \cdot 10^{-7}\right):\\ \;\;\;\;x + y \cdot \frac{z - t}{z - a}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{\left(z - t\right) \cdot y}{z - a}\\ \end{array}\]

Reproduce

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

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

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