Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A

Percentage Accurate: 98.0% → 98.0%
Time: 8.1s
Alternatives: 12
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ x + y \cdot \frac{z - t}{z - a} \end{array} \]
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
	return x + (y * ((z - t) / (z - a)));
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = x + (y * ((z - t) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
	return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a):
	return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a)
	return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a))))
end
function tmp = code(x, y, z, t, a)
	tmp = x + (y * ((z - t) / (z - a)));
end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + y \cdot \frac{z - t}{z - a}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 12 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 98.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + y \cdot \frac{z - t}{z - a} \end{array} \]
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
	return x + (y * ((z - t) / (z - a)));
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = x + (y * ((z - t) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
	return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a):
	return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a)
	return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a))))
end
function tmp = code(x, y, z, t, a)
	tmp = x + (y * ((z - t) / (z - a)));
end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + y \cdot \frac{z - t}{z - a}
\end{array}

Alternative 1: 98.0% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right) \end{array} \]
(FPCore (x y z t a) :precision binary64 (fma y (/ (- z t) (- z a)) x))
double code(double x, double y, double z, double t, double a) {
	return fma(y, ((z - t) / (z - a)), x);
}
function code(x, y, z, t, a)
	return fma(y, Float64(Float64(z - t) / Float64(z - a)), x)
end
code[x_, y_, z_, t_, a_] := N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)
\end{array}
Derivation
  1. Initial program 98.4%

    \[x + y \cdot \frac{z - t}{z - a} \]
  2. Step-by-step derivation
    1. +-commutative98.4%

      \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a} + x} \]
    2. fma-define98.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
  3. Simplified98.4%

    \[\leadsto \color{blue}{\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)} \]
  4. Add Preprocessing
  5. Add Preprocessing

Alternative 2: 76.2% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -9.5 \cdot 10^{-40}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;z \leq 3.2:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{+130} \lor \neg \left(z \leq 9.5 \cdot 10^{+180}\right):\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;x - t \cdot \frac{y}{z}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -9.5e-40)
   (+ y x)
   (if (<= z 3.2)
     (+ x (* y (/ t a)))
     (if (or (<= z 3.4e+130) (not (<= z 9.5e+180)))
       (+ y x)
       (- x (* t (/ y z)))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -9.5e-40) {
		tmp = y + x;
	} else if (z <= 3.2) {
		tmp = x + (y * (t / a));
	} else if ((z <= 3.4e+130) || !(z <= 9.5e+180)) {
		tmp = y + x;
	} else {
		tmp = x - (t * (y / z));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (z <= (-9.5d-40)) then
        tmp = y + x
    else if (z <= 3.2d0) then
        tmp = x + (y * (t / a))
    else if ((z <= 3.4d+130) .or. (.not. (z <= 9.5d+180))) then
        tmp = y + x
    else
        tmp = x - (t * (y / z))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -9.5e-40) {
		tmp = y + x;
	} else if (z <= 3.2) {
		tmp = x + (y * (t / a));
	} else if ((z <= 3.4e+130) || !(z <= 9.5e+180)) {
		tmp = y + x;
	} else {
		tmp = x - (t * (y / z));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -9.5e-40:
		tmp = y + x
	elif z <= 3.2:
		tmp = x + (y * (t / a))
	elif (z <= 3.4e+130) or not (z <= 9.5e+180):
		tmp = y + x
	else:
		tmp = x - (t * (y / z))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -9.5e-40)
		tmp = Float64(y + x);
	elseif (z <= 3.2)
		tmp = Float64(x + Float64(y * Float64(t / a)));
	elseif ((z <= 3.4e+130) || !(z <= 9.5e+180))
		tmp = Float64(y + x);
	else
		tmp = Float64(x - Float64(t * Float64(y / z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -9.5e-40)
		tmp = y + x;
	elseif (z <= 3.2)
		tmp = x + (y * (t / a));
	elseif ((z <= 3.4e+130) || ~((z <= 9.5e+180)))
		tmp = y + x;
	else
		tmp = x - (t * (y / z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -9.5e-40], N[(y + x), $MachinePrecision], If[LessEqual[z, 3.2], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 3.4e+130], N[Not[LessEqual[z, 9.5e+180]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{-40}:\\
\;\;\;\;y + x\\

\mathbf{elif}\;z \leq 3.2:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\

\mathbf{elif}\;z \leq 3.4 \cdot 10^{+130} \lor \neg \left(z \leq 9.5 \cdot 10^{+180}\right):\\
\;\;\;\;y + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -9.5000000000000006e-40 or 3.2000000000000002 < z < 3.4000000000000001e130 or 9.5000000000000003e180 < z

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 78.1%

      \[\leadsto \color{blue}{x + y} \]
    4. Step-by-step derivation
      1. +-commutative78.1%

        \[\leadsto \color{blue}{y + x} \]
    5. Simplified78.1%

      \[\leadsto \color{blue}{y + x} \]

    if -9.5000000000000006e-40 < z < 3.2000000000000002

    1. Initial program 96.5%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 71.8%

      \[\leadsto x + \color{blue}{\frac{t \cdot y}{a}} \]
    4. Step-by-step derivation
      1. *-commutative71.8%

        \[\leadsto x + \frac{\color{blue}{y \cdot t}}{a} \]
      2. associate-/l*73.7%

        \[\leadsto x + \color{blue}{y \cdot \frac{t}{a}} \]
    5. Simplified73.7%

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

    if 3.4000000000000001e130 < z < 9.5000000000000003e180

    1. Initial program 99.7%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 70.2%

      \[\leadsto x + \color{blue}{-1 \cdot \frac{t \cdot y}{z - a}} \]
    4. Step-by-step derivation
      1. mul-1-neg70.2%

        \[\leadsto x + \color{blue}{\left(-\frac{t \cdot y}{z - a}\right)} \]
      2. associate-/l*86.4%

        \[\leadsto x + \left(-\color{blue}{t \cdot \frac{y}{z - a}}\right) \]
      3. distribute-rgt-neg-in86.4%

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

        \[\leadsto x + t \cdot \color{blue}{\frac{y}{-\left(z - a\right)}} \]
      5. sub-neg86.4%

        \[\leadsto x + t \cdot \frac{y}{-\color{blue}{\left(z + \left(-a\right)\right)}} \]
      6. distribute-neg-in86.4%

        \[\leadsto x + t \cdot \frac{y}{\color{blue}{\left(-z\right) + \left(-\left(-a\right)\right)}} \]
      7. remove-double-neg86.4%

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

      \[\leadsto x + \color{blue}{t \cdot \frac{y}{\left(-z\right) + a}} \]
    6. Taylor expanded in z around inf 70.3%

      \[\leadsto \color{blue}{x + -1 \cdot \frac{t \cdot y}{z}} \]
    7. Step-by-step derivation
      1. mul-1-neg70.3%

        \[\leadsto x + \color{blue}{\left(-\frac{t \cdot y}{z}\right)} \]
      2. unsub-neg70.3%

        \[\leadsto \color{blue}{x - \frac{t \cdot y}{z}} \]
      3. associate-/l*86.6%

        \[\leadsto x - \color{blue}{t \cdot \frac{y}{z}} \]
    8. Simplified86.6%

      \[\leadsto \color{blue}{x - t \cdot \frac{y}{z}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification76.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9.5 \cdot 10^{-40}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;z \leq 3.2:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{+130} \lor \neg \left(z \leq 9.5 \cdot 10^{+180}\right):\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;x - t \cdot \frac{y}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 86.9% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -0.0074 \lor \neg \left(t \leq 3.2 \cdot 10^{+123}\right):\\ \;\;\;\;x + t \cdot \frac{y}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z}{z - a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (or (<= t -0.0074) (not (<= t 3.2e+123)))
   (+ x (* t (/ y (- a z))))
   (+ x (* y (/ z (- z a))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((t <= -0.0074) || !(t <= 3.2e+123)) {
		tmp = x + (t * (y / (a - z)));
	} else {
		tmp = x + (y * (z / (z - a)));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if ((t <= (-0.0074d0)) .or. (.not. (t <= 3.2d+123))) then
        tmp = x + (t * (y / (a - z)))
    else
        tmp = x + (y * (z / (z - a)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((t <= -0.0074) || !(t <= 3.2e+123)) {
		tmp = x + (t * (y / (a - z)));
	} else {
		tmp = x + (y * (z / (z - a)));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (t <= -0.0074) or not (t <= 3.2e+123):
		tmp = x + (t * (y / (a - z)))
	else:
		tmp = x + (y * (z / (z - a)))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((t <= -0.0074) || !(t <= 3.2e+123))
		tmp = Float64(x + Float64(t * Float64(y / Float64(a - z))));
	else
		tmp = Float64(x + Float64(y * Float64(z / Float64(z - a))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if ((t <= -0.0074) || ~((t <= 3.2e+123)))
		tmp = x + (t * (y / (a - z)));
	else
		tmp = x + (y * (z / (z - a)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -0.0074], N[Not[LessEqual[t, 3.2e+123]], $MachinePrecision]], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.0074 \lor \neg \left(t \leq 3.2 \cdot 10^{+123}\right):\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -0.0074000000000000003 or 3.20000000000000005e123 < t

    1. Initial program 96.2%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 78.6%

      \[\leadsto x + \color{blue}{-1 \cdot \frac{t \cdot y}{z - a}} \]
    4. Step-by-step derivation
      1. mul-1-neg78.6%

        \[\leadsto x + \color{blue}{\left(-\frac{t \cdot y}{z - a}\right)} \]
      2. associate-/l*91.0%

        \[\leadsto x + \left(-\color{blue}{t \cdot \frac{y}{z - a}}\right) \]
      3. distribute-rgt-neg-in91.0%

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

        \[\leadsto x + t \cdot \color{blue}{\frac{y}{-\left(z - a\right)}} \]
      5. sub-neg91.0%

        \[\leadsto x + t \cdot \frac{y}{-\color{blue}{\left(z + \left(-a\right)\right)}} \]
      6. distribute-neg-in91.0%

        \[\leadsto x + t \cdot \frac{y}{\color{blue}{\left(-z\right) + \left(-\left(-a\right)\right)}} \]
      7. remove-double-neg91.0%

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

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

    if -0.0074000000000000003 < t < 3.20000000000000005e123

    1. Initial program 99.8%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0 74.7%

      \[\leadsto x + \color{blue}{\frac{y \cdot z}{z - a}} \]
    4. Step-by-step derivation
      1. associate-/l*89.1%

        \[\leadsto x + \color{blue}{y \cdot \frac{z}{z - a}} \]
    5. Simplified89.1%

      \[\leadsto x + \color{blue}{y \cdot \frac{z}{z - a}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification89.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -0.0074 \lor \neg \left(t \leq 3.2 \cdot 10^{+123}\right):\\ \;\;\;\;x + t \cdot \frac{y}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z}{z - a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 81.2% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.26 \cdot 10^{-51} \lor \neg \left(z \leq 3.2 \cdot 10^{-105}\right):\\ \;\;\;\;x + y \cdot \frac{z}{z - a}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (or (<= z -1.26e-51) (not (<= z 3.2e-105)))
   (+ x (* y (/ z (- z a))))
   (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((z <= -1.26e-51) || !(z <= 3.2e-105)) {
		tmp = x + (y * (z / (z - a)));
	} else {
		tmp = x + (y * (t / a));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if ((z <= (-1.26d-51)) .or. (.not. (z <= 3.2d-105))) then
        tmp = x + (y * (z / (z - a)))
    else
        tmp = x + (y * (t / a))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((z <= -1.26e-51) || !(z <= 3.2e-105)) {
		tmp = x + (y * (z / (z - a)));
	} else {
		tmp = x + (y * (t / a));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (z <= -1.26e-51) or not (z <= 3.2e-105):
		tmp = x + (y * (z / (z - a)))
	else:
		tmp = x + (y * (t / a))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((z <= -1.26e-51) || !(z <= 3.2e-105))
		tmp = Float64(x + Float64(y * Float64(z / Float64(z - a))));
	else
		tmp = Float64(x + Float64(y * Float64(t / a)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if ((z <= -1.26e-51) || ~((z <= 3.2e-105)))
		tmp = x + (y * (z / (z - a)));
	else
		tmp = x + (y * (t / a));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.26e-51], N[Not[LessEqual[z, 3.2e-105]], $MachinePrecision]], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.26 \cdot 10^{-51} \lor \neg \left(z \leq 3.2 \cdot 10^{-105}\right):\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.2600000000000001e-51 or 3.19999999999999981e-105 < z

    1. Initial program 98.8%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0 63.8%

      \[\leadsto x + \color{blue}{\frac{y \cdot z}{z - a}} \]
    4. Step-by-step derivation
      1. associate-/l*80.2%

        \[\leadsto x + \color{blue}{y \cdot \frac{z}{z - a}} \]
    5. Simplified80.2%

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

    if -1.2600000000000001e-51 < z < 3.19999999999999981e-105

    1. Initial program 97.6%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 74.0%

      \[\leadsto x + \color{blue}{\frac{t \cdot y}{a}} \]
    4. Step-by-step derivation
      1. *-commutative74.0%

        \[\leadsto x + \frac{\color{blue}{y \cdot t}}{a} \]
      2. associate-/l*78.1%

        \[\leadsto x + \color{blue}{y \cdot \frac{t}{a}} \]
    5. Simplified78.1%

      \[\leadsto x + \color{blue}{y \cdot \frac{t}{a}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification79.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.26 \cdot 10^{-51} \lor \neg \left(z \leq 3.2 \cdot 10^{-105}\right):\\ \;\;\;\;x + y \cdot \frac{z}{z - a}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 86.3% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.5 \cdot 10^{-17}:\\ \;\;\;\;x + y \cdot \frac{z - t}{z}\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{-64}:\\ \;\;\;\;x + \frac{y \cdot t}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -3.5e-17)
   (+ x (* y (/ (- z t) z)))
   (if (<= z 2.6e-64) (+ x (/ (* y t) (- a z))) (+ x (/ y (/ z (- z t)))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -3.5e-17) {
		tmp = x + (y * ((z - t) / z));
	} else if (z <= 2.6e-64) {
		tmp = x + ((y * t) / (a - z));
	} else {
		tmp = x + (y / (z / (z - t)));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (z <= (-3.5d-17)) then
        tmp = x + (y * ((z - t) / z))
    else if (z <= 2.6d-64) then
        tmp = x + ((y * t) / (a - z))
    else
        tmp = x + (y / (z / (z - t)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -3.5e-17) {
		tmp = x + (y * ((z - t) / z));
	} else if (z <= 2.6e-64) {
		tmp = x + ((y * t) / (a - z));
	} else {
		tmp = x + (y / (z / (z - t)));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -3.5e-17:
		tmp = x + (y * ((z - t) / z))
	elif z <= 2.6e-64:
		tmp = x + ((y * t) / (a - z))
	else:
		tmp = x + (y / (z / (z - t)))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -3.5e-17)
		tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z)));
	elseif (z <= 2.6e-64)
		tmp = Float64(x + Float64(Float64(y * t) / Float64(a - z)));
	else
		tmp = Float64(x + Float64(y / Float64(z / Float64(z - t))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -3.5e-17)
		tmp = x + (y * ((z - t) / z));
	elseif (z <= 2.6e-64)
		tmp = x + ((y * t) / (a - z));
	else
		tmp = x + (y / (z / (z - t)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.5e-17], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.6e-64], N[(x + N[(N[(y * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{-17}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\

\mathbf{elif}\;z \leq 2.6 \cdot 10^{-64}:\\
\;\;\;\;x + \frac{y \cdot t}{a - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.5000000000000002e-17

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0 91.6%

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

    if -3.5000000000000002e-17 < z < 2.6e-64

    1. Initial program 96.2%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 88.0%

      \[\leadsto x + \color{blue}{-1 \cdot \frac{t \cdot y}{z - a}} \]
    4. Step-by-step derivation
      1. mul-1-neg88.0%

        \[\leadsto x + \color{blue}{\left(-\frac{t \cdot y}{z - a}\right)} \]
      2. associate-/l*88.8%

        \[\leadsto x + \left(-\color{blue}{t \cdot \frac{y}{z - a}}\right) \]
      3. distribute-rgt-neg-in88.8%

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

        \[\leadsto x + t \cdot \color{blue}{\frac{y}{-\left(z - a\right)}} \]
      5. sub-neg88.8%

        \[\leadsto x + t \cdot \frac{y}{-\color{blue}{\left(z + \left(-a\right)\right)}} \]
      6. distribute-neg-in88.8%

        \[\leadsto x + t \cdot \frac{y}{\color{blue}{\left(-z\right) + \left(-\left(-a\right)\right)}} \]
      7. remove-double-neg88.8%

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

      \[\leadsto x + \color{blue}{t \cdot \frac{y}{\left(-z\right) + a}} \]
    6. Taylor expanded in t around 0 88.0%

      \[\leadsto x + \color{blue}{\frac{t \cdot y}{a - z}} \]
    7. Step-by-step derivation
      1. *-commutative88.0%

        \[\leadsto x + \frac{\color{blue}{y \cdot t}}{a - z} \]
    8. Simplified88.0%

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

    if 2.6e-64 < z

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num99.9%

        \[\leadsto x + y \cdot \color{blue}{\frac{1}{\frac{z - a}{z - t}}} \]
      2. un-div-inv100.0%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{z - a}{z - t}}} \]
    4. Applied egg-rr100.0%

      \[\leadsto x + \color{blue}{\frac{y}{\frac{z - a}{z - t}}} \]
    5. Taylor expanded in a around 0 85.6%

      \[\leadsto x + \frac{y}{\color{blue}{\frac{z}{z - t}}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 6: 79.1% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -3.2 \cdot 10^{+81}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{elif}\;a \leq 6.5 \cdot 10^{-72}:\\ \;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z}{z - a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= a -3.2e+81)
   (+ x (* t (/ y a)))
   (if (<= a 6.5e-72) (+ x (/ y (/ z (- z t)))) (+ x (* y (/ z (- z a)))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (a <= -3.2e+81) {
		tmp = x + (t * (y / a));
	} else if (a <= 6.5e-72) {
		tmp = x + (y / (z / (z - t)));
	} else {
		tmp = x + (y * (z / (z - a)));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (a <= (-3.2d+81)) then
        tmp = x + (t * (y / a))
    else if (a <= 6.5d-72) then
        tmp = x + (y / (z / (z - t)))
    else
        tmp = x + (y * (z / (z - a)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (a <= -3.2e+81) {
		tmp = x + (t * (y / a));
	} else if (a <= 6.5e-72) {
		tmp = x + (y / (z / (z - t)));
	} else {
		tmp = x + (y * (z / (z - a)));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if a <= -3.2e+81:
		tmp = x + (t * (y / a))
	elif a <= 6.5e-72:
		tmp = x + (y / (z / (z - t)))
	else:
		tmp = x + (y * (z / (z - a)))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (a <= -3.2e+81)
		tmp = Float64(x + Float64(t * Float64(y / a)));
	elseif (a <= 6.5e-72)
		tmp = Float64(x + Float64(y / Float64(z / Float64(z - t))));
	else
		tmp = Float64(x + Float64(y * Float64(z / Float64(z - a))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (a <= -3.2e+81)
		tmp = x + (t * (y / a));
	elseif (a <= 6.5e-72)
		tmp = x + (y / (z / (z - t)));
	else
		tmp = x + (y * (z / (z - a)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3.2e+81], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 6.5e-72], N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.2 \cdot 10^{+81}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\

\mathbf{elif}\;a \leq 6.5 \cdot 10^{-72}:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -3.2e81

    1. Initial program 99.4%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num97.5%

        \[\leadsto x + y \cdot \color{blue}{\frac{1}{\frac{z - a}{z - t}}} \]
      2. un-div-inv97.4%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{z - a}{z - t}}} \]
    4. Applied egg-rr97.4%

      \[\leadsto x + \color{blue}{\frac{y}{\frac{z - a}{z - t}}} \]
    5. Taylor expanded in z around 0 75.5%

      \[\leadsto \color{blue}{x + \frac{t \cdot y}{a}} \]
    6. Step-by-step derivation
      1. +-commutative75.5%

        \[\leadsto \color{blue}{\frac{t \cdot y}{a} + x} \]
      2. associate-/l*79.9%

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} + x \]
    7. Simplified79.9%

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

    if -3.2e81 < a < 6.4999999999999997e-72

    1. Initial program 97.3%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num97.3%

        \[\leadsto x + y \cdot \color{blue}{\frac{1}{\frac{z - a}{z - t}}} \]
      2. un-div-inv97.3%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{z - a}{z - t}}} \]
    4. Applied egg-rr97.3%

      \[\leadsto x + \color{blue}{\frac{y}{\frac{z - a}{z - t}}} \]
    5. Taylor expanded in a around 0 88.1%

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

    if 6.4999999999999997e-72 < a

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0 63.1%

      \[\leadsto x + \color{blue}{\frac{y \cdot z}{z - a}} \]
    4. Step-by-step derivation
      1. associate-/l*82.0%

        \[\leadsto x + \color{blue}{y \cdot \frac{z}{z - a}} \]
    5. Simplified82.0%

      \[\leadsto x + \color{blue}{y \cdot \frac{z}{z - a}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification85.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -3.2 \cdot 10^{+81}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{elif}\;a \leq 6.5 \cdot 10^{-72}:\\ \;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z}{z - a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 78.6% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -1.35 \cdot 10^{+82}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{elif}\;a \leq 7.6 \cdot 10^{-107}:\\ \;\;\;\;x + y \cdot \frac{z - t}{z}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z}{z - a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= a -1.35e+82)
   (+ x (* t (/ y a)))
   (if (<= a 7.6e-107) (+ x (* y (/ (- z t) z))) (+ x (* y (/ z (- z a)))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (a <= -1.35e+82) {
		tmp = x + (t * (y / a));
	} else if (a <= 7.6e-107) {
		tmp = x + (y * ((z - t) / z));
	} else {
		tmp = x + (y * (z / (z - a)));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (a <= (-1.35d+82)) then
        tmp = x + (t * (y / a))
    else if (a <= 7.6d-107) then
        tmp = x + (y * ((z - t) / z))
    else
        tmp = x + (y * (z / (z - a)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (a <= -1.35e+82) {
		tmp = x + (t * (y / a));
	} else if (a <= 7.6e-107) {
		tmp = x + (y * ((z - t) / z));
	} else {
		tmp = x + (y * (z / (z - a)));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if a <= -1.35e+82:
		tmp = x + (t * (y / a))
	elif a <= 7.6e-107:
		tmp = x + (y * ((z - t) / z))
	else:
		tmp = x + (y * (z / (z - a)))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (a <= -1.35e+82)
		tmp = Float64(x + Float64(t * Float64(y / a)));
	elseif (a <= 7.6e-107)
		tmp = Float64(x + Float64(y * Float64(Float64(z - t) / z)));
	else
		tmp = Float64(x + Float64(y * Float64(z / Float64(z - a))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (a <= -1.35e+82)
		tmp = x + (t * (y / a));
	elseif (a <= 7.6e-107)
		tmp = x + (y * ((z - t) / z));
	else
		tmp = x + (y * (z / (z - a)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.35e+82], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 7.6e-107], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.35 \cdot 10^{+82}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\

\mathbf{elif}\;a \leq 7.6 \cdot 10^{-107}:\\
\;\;\;\;x + y \cdot \frac{z - t}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.35e82

    1. Initial program 99.4%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num97.5%

        \[\leadsto x + y \cdot \color{blue}{\frac{1}{\frac{z - a}{z - t}}} \]
      2. un-div-inv97.4%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{z - a}{z - t}}} \]
    4. Applied egg-rr97.4%

      \[\leadsto x + \color{blue}{\frac{y}{\frac{z - a}{z - t}}} \]
    5. Taylor expanded in z around 0 75.5%

      \[\leadsto \color{blue}{x + \frac{t \cdot y}{a}} \]
    6. Step-by-step derivation
      1. +-commutative75.5%

        \[\leadsto \color{blue}{\frac{t \cdot y}{a} + x} \]
      2. associate-/l*79.9%

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} + x \]
    7. Simplified79.9%

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

    if -1.35e82 < a < 7.6000000000000004e-107

    1. Initial program 97.0%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0 89.2%

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

    if 7.6000000000000004e-107 < a

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0 62.0%

      \[\leadsto x + \color{blue}{\frac{y \cdot z}{z - a}} \]
    4. Step-by-step derivation
      1. associate-/l*80.3%

        \[\leadsto x + \color{blue}{y \cdot \frac{z}{z - a}} \]
    5. Simplified80.3%

      \[\leadsto x + \color{blue}{y \cdot \frac{z}{z - a}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification84.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.35 \cdot 10^{+82}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{elif}\;a \leq 7.6 \cdot 10^{-107}:\\ \;\;\;\;x + y \cdot \frac{z - t}{z}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z}{z - a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 76.7% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.7 \cdot 10^{-40} \lor \neg \left(z \leq 140\right):\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (or (<= z -2.7e-40) (not (<= z 140.0))) (+ y x) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((z <= -2.7e-40) || !(z <= 140.0)) {
		tmp = y + x;
	} else {
		tmp = x + (y * (t / a));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if ((z <= (-2.7d-40)) .or. (.not. (z <= 140.0d0))) then
        tmp = y + x
    else
        tmp = x + (y * (t / a))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((z <= -2.7e-40) || !(z <= 140.0)) {
		tmp = y + x;
	} else {
		tmp = x + (y * (t / a));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (z <= -2.7e-40) or not (z <= 140.0):
		tmp = y + x
	else:
		tmp = x + (y * (t / a))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((z <= -2.7e-40) || !(z <= 140.0))
		tmp = Float64(y + x);
	else
		tmp = Float64(x + Float64(y * Float64(t / a)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if ((z <= -2.7e-40) || ~((z <= 140.0)))
		tmp = y + x;
	else
		tmp = x + (y * (t / a));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.7e-40], N[Not[LessEqual[z, 140.0]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{-40} \lor \neg \left(z \leq 140\right):\\
\;\;\;\;y + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.7e-40 or 140 < z

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 75.9%

      \[\leadsto \color{blue}{x + y} \]
    4. Step-by-step derivation
      1. +-commutative75.9%

        \[\leadsto \color{blue}{y + x} \]
    5. Simplified75.9%

      \[\leadsto \color{blue}{y + x} \]

    if -2.7e-40 < z < 140

    1. Initial program 96.5%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 71.8%

      \[\leadsto x + \color{blue}{\frac{t \cdot y}{a}} \]
    4. Step-by-step derivation
      1. *-commutative71.8%

        \[\leadsto x + \frac{\color{blue}{y \cdot t}}{a} \]
      2. associate-/l*73.7%

        \[\leadsto x + \color{blue}{y \cdot \frac{t}{a}} \]
    5. Simplified73.7%

      \[\leadsto x + \color{blue}{y \cdot \frac{t}{a}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification75.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.7 \cdot 10^{-40} \lor \neg \left(z \leq 140\right):\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{t}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 65.0% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.62 \cdot 10^{+184} \lor \neg \left(t \leq 7.2 \cdot 10^{+115}\right):\\ \;\;\;\;y \cdot \frac{t}{a - z}\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (or (<= t -1.62e+184) (not (<= t 7.2e+115))) (* y (/ t (- a z))) (+ y x)))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((t <= -1.62e+184) || !(t <= 7.2e+115)) {
		tmp = y * (t / (a - z));
	} else {
		tmp = y + x;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if ((t <= (-1.62d+184)) .or. (.not. (t <= 7.2d+115))) then
        tmp = y * (t / (a - z))
    else
        tmp = y + x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((t <= -1.62e+184) || !(t <= 7.2e+115)) {
		tmp = y * (t / (a - z));
	} else {
		tmp = y + x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (t <= -1.62e+184) or not (t <= 7.2e+115):
		tmp = y * (t / (a - z))
	else:
		tmp = y + x
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((t <= -1.62e+184) || !(t <= 7.2e+115))
		tmp = Float64(y * Float64(t / Float64(a - z)));
	else
		tmp = Float64(y + x);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if ((t <= -1.62e+184) || ~((t <= 7.2e+115)))
		tmp = y * (t / (a - z));
	else
		tmp = y + x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.62e+184], N[Not[LessEqual[t, 7.2e+115]], $MachinePrecision]], N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.62 \cdot 10^{+184} \lor \neg \left(t \leq 7.2 \cdot 10^{+115}\right):\\
\;\;\;\;y \cdot \frac{t}{a - z}\\

\mathbf{else}:\\
\;\;\;\;y + x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.61999999999999999e184 or 7.2000000000000001e115 < t

    1. Initial program 94.8%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in t around inf 74.3%

      \[\leadsto x + \color{blue}{-1 \cdot \frac{t \cdot y}{z - a}} \]
    4. Step-by-step derivation
      1. mul-1-neg74.3%

        \[\leadsto x + \color{blue}{\left(-\frac{t \cdot y}{z - a}\right)} \]
      2. associate-/l*91.2%

        \[\leadsto x + \left(-\color{blue}{t \cdot \frac{y}{z - a}}\right) \]
      3. distribute-rgt-neg-in91.2%

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

        \[\leadsto x + t \cdot \color{blue}{\frac{y}{-\left(z - a\right)}} \]
      5. sub-neg91.2%

        \[\leadsto x + t \cdot \frac{y}{-\color{blue}{\left(z + \left(-a\right)\right)}} \]
      6. distribute-neg-in91.2%

        \[\leadsto x + t \cdot \frac{y}{\color{blue}{\left(-z\right) + \left(-\left(-a\right)\right)}} \]
      7. remove-double-neg91.2%

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

      \[\leadsto x + \color{blue}{t \cdot \frac{y}{\left(-z\right) + a}} \]
    6. Taylor expanded in y around inf 79.4%

      \[\leadsto \color{blue}{y \cdot \left(\frac{t}{a - z} + \frac{x}{y}\right)} \]
    7. Step-by-step derivation
      1. +-commutative79.4%

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

      \[\leadsto \color{blue}{y \cdot \left(\frac{x}{y} + \frac{t}{a - z}\right)} \]
    9. Taylor expanded in x around 0 64.9%

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

    if -1.61999999999999999e184 < t < 7.2000000000000001e115

    1. Initial program 99.8%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 73.3%

      \[\leadsto \color{blue}{x + y} \]
    4. Step-by-step derivation
      1. +-commutative73.3%

        \[\leadsto \color{blue}{y + x} \]
    5. Simplified73.3%

      \[\leadsto \color{blue}{y + x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification71.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.62 \cdot 10^{+184} \lor \neg \left(t \leq 7.2 \cdot 10^{+115}\right):\\ \;\;\;\;y \cdot \frac{t}{a - z}\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 98.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + y \cdot \frac{z - t}{z - a} \end{array} \]
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
	return x + (y * ((z - t) / (z - a)));
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = x + (y * ((z - t) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
	return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a):
	return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a)
	return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a))))
end
function tmp = code(x, y, z, t, a)
	tmp = x + (y * ((z - t) / (z - a)));
end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Derivation
  1. Initial program 98.4%

    \[x + y \cdot \frac{z - t}{z - a} \]
  2. Add Preprocessing
  3. Add Preprocessing

Alternative 11: 61.5% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq 2.6 \cdot 10^{+153}:\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a) :precision binary64 (if (<= a 2.6e+153) (+ y x) x))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (a <= 2.6e+153) {
		tmp = y + x;
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (a <= 2.6d+153) then
        tmp = y + x
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (a <= 2.6e+153) {
		tmp = y + x;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if a <= 2.6e+153:
		tmp = y + x
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (a <= 2.6e+153)
		tmp = Float64(y + x);
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (a <= 2.6e+153)
		tmp = y + x;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, 2.6e+153], N[(y + x), $MachinePrecision], x]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.6 \cdot 10^{+153}:\\
\;\;\;\;y + x\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 2.5999999999999999e153

    1. Initial program 98.2%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 61.5%

      \[\leadsto \color{blue}{x + y} \]
    4. Step-by-step derivation
      1. +-commutative61.5%

        \[\leadsto \color{blue}{y + x} \]
    5. Simplified61.5%

      \[\leadsto \color{blue}{y + x} \]

    if 2.5999999999999999e153 < a

    1. Initial program 99.9%

      \[x + y \cdot \frac{z - t}{z - a} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 76.3%

      \[\leadsto \color{blue}{x} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 12: 49.9% accurate, 11.0× speedup?

\[\begin{array}{l} \\ x \end{array} \]
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
	return x;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = x
end function
public static double code(double x, double y, double z, double t, double a) {
	return x;
}
def code(x, y, z, t, a):
	return x
function code(x, y, z, t, a)
	return x
end
function tmp = code(x, y, z, t, a)
	tmp = x;
end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}

\\
x
\end{array}
Derivation
  1. Initial program 98.4%

    \[x + y \cdot \frac{z - t}{z - a} \]
  2. Add Preprocessing
  3. Taylor expanded in x around inf 47.1%

    \[\leadsto \color{blue}{x} \]
  4. Add Preprocessing

Developer target: 98.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + \frac{y}{\frac{z - a}{z - t}} \end{array} \]
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- z a) (- z t)))))
double code(double x, double y, double z, double t, double a) {
	return x + (y / ((z - a) / (z - t)));
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    code = x + (y / ((z - a) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
	return x + (y / ((z - a) / (z - t)));
}
def code(x, y, z, t, a):
	return x + (y / ((z - a) / (z - t)))
function code(x, y, z, t, a)
	return Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t))))
end
function tmp = code(x, y, z, t, a)
	tmp = x + (y / ((z - a) / (z - t)));
end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}

Reproduce

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

  :alt
  (+ x (/ y (/ (- z a) (- z t))))

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