Average Error: 1.5 → 1.0
Time: 4.3s
Precision: 64
\[x + y \cdot \frac{z - t}{z - a}\]
\[\begin{array}{l} \mathbf{if}\;y \le -3.29812986849983016 \cdot 10^{79} \lor \neg \left(y \le 0.407937420282773189\right):\\ \;\;\;\;x + \frac{y}{\frac{z - a}{z - t}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y \cdot \left(-\left(z - t\right)\right)}{-\left(z - a\right)}\\ \end{array}\]
x + y \cdot \frac{z - t}{z - a}
\begin{array}{l}
\mathbf{if}\;y \le -3.29812986849983016 \cdot 10^{79} \lor \neg \left(y \le 0.407937420282773189\right):\\
\;\;\;\;x + \frac{y}{\frac{z - a}{z - t}}\\

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

\end{array}
double code(double x, double y, double z, double t, double a) {
	return (x + (y * ((z - t) / (z - a))));
}
double code(double x, double y, double z, double t, double a) {
	double temp;
	if (((y <= -3.29812986849983e+79) || !(y <= 0.4079374202827732))) {
		temp = (x + (y / ((z - a) / (z - t))));
	} else {
		temp = (x + ((y * -(z - t)) / -(z - a)));
	}
	return temp;
}

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

Derivation

  1. Split input into 2 regimes
  2. if y < -3.29812986849983e+79 or 0.4079374202827732 < y

    1. Initial program 0.5

      \[x + y \cdot \frac{z - t}{z - a}\]
    2. Using strategy rm
    3. Applied clear-num0.7

      \[\leadsto x + y \cdot \color{blue}{\frac{1}{\frac{z - a}{z - t}}}\]
    4. Applied un-div-inv0.7

      \[\leadsto x + \color{blue}{\frac{y}{\frac{z - a}{z - t}}}\]

    if -3.29812986849983e+79 < y < 0.4079374202827732

    1. Initial program 2.1

      \[x + y \cdot \frac{z - t}{z - a}\]
    2. Using strategy rm
    3. Applied frac-2neg2.1

      \[\leadsto x + y \cdot \color{blue}{\frac{-\left(z - t\right)}{-\left(z - a\right)}}\]
    4. Applied associate-*r/1.2

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

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

Reproduce

herbie shell --seed 2020066 +o rules:numerics
(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)))))