Average Error: 10.4 → 0.4
Time: 3.8s
Precision: 64
\[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;y \le -2.07895100736813444 \cdot 10^{-33} \lor \neg \left(y \le 6.9134310256516189 \cdot 10^{-85}\right):\\ \;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y \cdot z + y \cdot \left(-t\right)}{a - t}\\ \end{array}\]
x + \frac{y \cdot \left(z - t\right)}{a - t}
\begin{array}{l}
\mathbf{if}\;y \le -2.07895100736813444 \cdot 10^{-33} \lor \neg \left(y \le 6.9134310256516189 \cdot 10^{-85}\right):\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r635028 = x;
        double r635029 = y;
        double r635030 = z;
        double r635031 = t;
        double r635032 = r635030 - r635031;
        double r635033 = r635029 * r635032;
        double r635034 = a;
        double r635035 = r635034 - r635031;
        double r635036 = r635033 / r635035;
        double r635037 = r635028 + r635036;
        return r635037;
}

double f(double x, double y, double z, double t, double a) {
        double r635038 = y;
        double r635039 = -2.0789510073681344e-33;
        bool r635040 = r635038 <= r635039;
        double r635041 = 6.913431025651619e-85;
        bool r635042 = r635038 <= r635041;
        double r635043 = !r635042;
        bool r635044 = r635040 || r635043;
        double r635045 = x;
        double r635046 = a;
        double r635047 = t;
        double r635048 = r635046 - r635047;
        double r635049 = z;
        double r635050 = r635049 - r635047;
        double r635051 = r635048 / r635050;
        double r635052 = r635038 / r635051;
        double r635053 = r635045 + r635052;
        double r635054 = r635038 * r635049;
        double r635055 = -r635047;
        double r635056 = r635038 * r635055;
        double r635057 = r635054 + r635056;
        double r635058 = r635057 / r635048;
        double r635059 = r635045 + r635058;
        double r635060 = r635044 ? r635053 : r635059;
        return r635060;
}

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

Derivation

  1. Split input into 2 regimes
  2. if y < -2.0789510073681344e-33 or 6.913431025651619e-85 < y

    1. Initial program 18.3

      \[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}}}\]

    if -2.0789510073681344e-33 < y < 6.913431025651619e-85

    1. Initial program 0.4

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

      \[\leadsto x + \frac{y \cdot \color{blue}{\left(z + \left(-t\right)\right)}}{a - t}\]
    4. Applied distribute-lft-in0.4

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

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

Reproduce

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