Average Error: 1.4 → 0.4
Time: 4.0s
Precision: binary64
\[x + y \cdot \frac{z - t}{z - a}\]
\[\begin{array}{l} \mathbf{if}\;\frac{z - t}{z - a} \le -3.82626083989873847 \cdot 10^{175} \lor \neg \left(\frac{z - t}{z - a} \le 4.51595420158466248 \cdot 10^{274}\right):\\ \;\;\;\;x + \frac{y \cdot \left(z - t\right)}{z - a}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z - t}{z - a}\\ \end{array}\]
x + y \cdot \frac{z - t}{z - a}
\begin{array}{l}
\mathbf{if}\;\frac{z - t}{z - a} \le -3.82626083989873847 \cdot 10^{175} \lor \neg \left(\frac{z - t}{z - a} \le 4.51595420158466248 \cdot 10^{274}\right):\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{z - a}\\

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

\end{array}
double code(double x, double y, double z, double t, double a) {
	return ((double) (x + ((double) (y * ((double) (((double) (z - t)) / ((double) (z - a))))))));
}
double code(double x, double y, double z, double t, double a) {
	double VAR;
	if (((((double) (((double) (z - t)) / ((double) (z - a)))) <= -3.8262608398987385e+175) || !(((double) (((double) (z - t)) / ((double) (z - a)))) <= 4.5159542015846625e+274))) {
		VAR = ((double) (x + ((double) (((double) (y * ((double) (z - t)))) / ((double) (z - a))))));
	} else {
		VAR = ((double) (x + ((double) (y * ((double) (((double) (z - t)) / ((double) (z - a))))))));
	}
	return VAR;
}

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

Derivation

  1. Split input into 2 regimes
  2. if (/ (- z t) (- z a)) < -3.82626083989873847e175 or 4.51595420158466248e274 < (/ (- z t) (- z a))

    1. Initial program 24.2

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

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

    if -3.82626083989873847e175 < (/ (- z t) (- z a)) < 4.51595420158466248e274

    1. Initial program 0.3

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

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

Reproduce

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