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

Percentage Accurate: 84.5% → 99.5%
Time: 11.9s
Alternatives: 13
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ x + \frac{y \cdot \left(z - t\right)}{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(Float64(y * 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[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \frac{y \cdot \left(z - t\right)}{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 13 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: 84.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + \frac{y \cdot \left(z - t\right)}{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(Float64(y * 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[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\end{array}

Alternative 1: 99.5% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{y \cdot \left(z - t\right)}{z - a}\\ \mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 2 \cdot 10^{+287}\right):\\ \;\;\;\;x + \frac{z - t}{\frac{z - a}{y}}\\ \mathbf{else}:\\ \;\;\;\;x + t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (* y (- z t)) (- z a))))
   (if (or (<= t_1 (- INFINITY)) (not (<= t_1 2e+287)))
     (+ x (/ (- z t) (/ (- z a) y)))
     (+ x t_1))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (y * (z - t)) / (z - a);
	double tmp;
	if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 2e+287)) {
		tmp = x + ((z - t) / ((z - a) / y));
	} else {
		tmp = x + t_1;
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = (y * (z - t)) / (z - a);
	double tmp;
	if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 2e+287)) {
		tmp = x + ((z - t) / ((z - a) / y));
	} else {
		tmp = x + t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = (y * (z - t)) / (z - a)
	tmp = 0
	if (t_1 <= -math.inf) or not (t_1 <= 2e+287):
		tmp = x + ((z - t) / ((z - a) / y))
	else:
		tmp = x + t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(Float64(y * Float64(z - t)) / Float64(z - a))
	tmp = 0.0
	if ((t_1 <= Float64(-Inf)) || !(t_1 <= 2e+287))
		tmp = Float64(x + Float64(Float64(z - t) / Float64(Float64(z - a) / y)));
	else
		tmp = Float64(x + t_1);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = (y * (z - t)) / (z - a);
	tmp = 0.0;
	if ((t_1 <= -Inf) || ~((t_1 <= 2e+287)))
		tmp = x + ((z - t) / ((z - a) / y));
	else
		tmp = x + t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 2e+287]], $MachinePrecision]], N[(x + N[(N[(z - t), $MachinePrecision] / N[(N[(z - a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t$95$1), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 2 \cdot 10^{+287}\right):\\
\;\;\;\;x + \frac{z - t}{\frac{z - a}{y}}\\

\mathbf{else}:\\
\;\;\;\;x + t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -inf.0 or 2.0000000000000002e287 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a))

    1. Initial program 45.6%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Step-by-step derivation
      1. *-commutative45.6%

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

        \[\leadsto x + \color{blue}{\frac{z - t}{\frac{z - a}{y}}} \]
    3. Simplified99.8%

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

    if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 2.0000000000000002e287

    1. Initial program 99.8%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification99.8%

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

Alternative 2: 76.8% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.35 \cdot 10^{+25}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;z \leq -4.7 \cdot 10^{-73}:\\ \;\;\;\;x - t \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq 3.15 \cdot 10^{+38}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -2.35e+25)
   (+ y x)
   (if (<= z -4.7e-73)
     (- x (* t (/ y z)))
     (if (<= z 3.15e+38) (+ x (/ y (/ a t))) (+ y x)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -2.35e+25) {
		tmp = y + x;
	} else if (z <= -4.7e-73) {
		tmp = x - (t * (y / z));
	} else if (z <= 3.15e+38) {
		tmp = x + (y / (a / t));
	} 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 (z <= (-2.35d+25)) then
        tmp = y + x
    else if (z <= (-4.7d-73)) then
        tmp = x - (t * (y / z))
    else if (z <= 3.15d+38) then
        tmp = x + (y / (a / t))
    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 (z <= -2.35e+25) {
		tmp = y + x;
	} else if (z <= -4.7e-73) {
		tmp = x - (t * (y / z));
	} else if (z <= 3.15e+38) {
		tmp = x + (y / (a / t));
	} else {
		tmp = y + x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -2.35e+25:
		tmp = y + x
	elif z <= -4.7e-73:
		tmp = x - (t * (y / z))
	elif z <= 3.15e+38:
		tmp = x + (y / (a / t))
	else:
		tmp = y + x
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -2.35e+25)
		tmp = Float64(y + x);
	elseif (z <= -4.7e-73)
		tmp = Float64(x - Float64(t * Float64(y / z)));
	elseif (z <= 3.15e+38)
		tmp = Float64(x + Float64(y / Float64(a / t)));
	else
		tmp = Float64(y + x);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -2.35e+25)
		tmp = y + x;
	elseif (z <= -4.7e-73)
		tmp = x - (t * (y / z));
	elseif (z <= 3.15e+38)
		tmp = x + (y / (a / t));
	else
		tmp = y + x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.35e+25], N[(y + x), $MachinePrecision], If[LessEqual[z, -4.7e-73], N[(x - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.15e+38], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -4.7 \cdot 10^{-73}:\\
\;\;\;\;x - t \cdot \frac{y}{z}\\

\mathbf{elif}\;z \leq 3.15 \cdot 10^{+38}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.3499999999999999e25 or 3.15000000000000001e38 < z

    1. Initial program 76.4%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Step-by-step derivation
      1. +-commutative76.4%

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

        \[\leadsto \color{blue}{\frac{y}{z - a} \cdot \left(z - t\right)} + x \]
      3. fma-def91.1%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{z - a}, z - t, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 78.1%

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

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

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

    if -2.3499999999999999e25 < z < -4.69999999999999994e-73

    1. Initial program 99.8%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Step-by-step derivation
      1. +-commutative99.8%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{z - a}, z - t, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around 0 86.1%

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{z}{z - t}}} + x \]
      3. associate-/r/86.1%

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

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

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

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

        \[\leadsto \left(-\color{blue}{t \cdot \frac{y}{z}}\right) + x \]
      3. distribute-lft-neg-in81.5%

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

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

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

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

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

        \[\leadsto \color{blue}{x - t \cdot \frac{y}{z}} \]
    13. Simplified81.5%

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

    if -4.69999999999999994e-73 < z < 3.15000000000000001e38

    1. Initial program 97.8%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Step-by-step derivation
      1. +-commutative97.8%

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

        \[\leadsto \color{blue}{\frac{y}{z - a} \cdot \left(z - t\right)} + x \]
      3. fma-def93.6%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{z - a}, z - t, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 85.1%

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

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

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

      \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}} + x} \]
    8. Step-by-step derivation
      1. clear-num82.9%

        \[\leadsto \color{blue}{\frac{1}{\frac{\frac{a}{y}}{t}}} + x \]
      2. associate-/r/82.8%

        \[\leadsto \color{blue}{\frac{1}{\frac{a}{y}} \cdot t} + x \]
      3. clear-num83.1%

        \[\leadsto \color{blue}{\frac{y}{a}} \cdot t + x \]
    9. Applied egg-rr83.1%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.35 \cdot 10^{+25}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;z \leq -4.7 \cdot 10^{-73}:\\ \;\;\;\;x - t \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq 3.15 \cdot 10^{+38}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \mathbf{else}:\\ \;\;\;\;y + x\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 91.9% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -8.2 \cdot 10^{+33} \lor \neg \left(z \leq 2.2 \cdot 10^{+116}\right):\\ \;\;\;\;x + y \cdot \frac{z}{z - a}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y \cdot \left(z - t\right)}{z - a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (or (<= z -8.2e+33) (not (<= z 2.2e+116)))
   (+ x (* y (/ z (- z a))))
   (+ x (/ (* y (- z t)) (- z a)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((z <= -8.2e+33) || !(z <= 2.2e+116)) {
		tmp = x + (y * (z / (z - a)));
	} else {
		tmp = x + ((y * (z - t)) / (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 ((z <= (-8.2d+33)) .or. (.not. (z <= 2.2d+116))) then
        tmp = x + (y * (z / (z - a)))
    else
        tmp = x + ((y * (z - t)) / (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 ((z <= -8.2e+33) || !(z <= 2.2e+116)) {
		tmp = x + (y * (z / (z - a)));
	} else {
		tmp = x + ((y * (z - t)) / (z - a));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (z <= -8.2e+33) or not (z <= 2.2e+116):
		tmp = x + (y * (z / (z - a)))
	else:
		tmp = x + ((y * (z - t)) / (z - a))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((z <= -8.2e+33) || !(z <= 2.2e+116))
		tmp = Float64(x + Float64(y * Float64(z / Float64(z - a))));
	else
		tmp = Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if ((z <= -8.2e+33) || ~((z <= 2.2e+116)))
		tmp = x + (y * (z / (z - a)));
	else
		tmp = x + ((y * (z - t)) / (z - a));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -8.2e+33], N[Not[LessEqual[z, 2.2e+116]], $MachinePrecision]], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.2 \cdot 10^{+33} \lor \neg \left(z \leq 2.2 \cdot 10^{+116}\right):\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -8.1999999999999999e33 or 2.2e116 < z

    1. Initial program 73.3%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Step-by-step derivation
      1. +-commutative73.3%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{z - a}, z - t, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-udef90.0%

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

        \[\leadsto \color{blue}{\frac{y}{\frac{z - a}{z - t}}} + x \]
      3. div-inv99.9%

        \[\leadsto \color{blue}{y \cdot \frac{1}{\frac{z - a}{z - t}}} + x \]
      4. clear-num99.9%

        \[\leadsto y \cdot \color{blue}{\frac{z - t}{z - a}} + x \]
    6. Applied egg-rr99.9%

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

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

    if -8.1999999999999999e33 < z < 2.2e116

    1. Initial program 98.2%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification95.2%

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

Alternative 4: 83.5% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -7.5 \cdot 10^{+33} \lor \neg \left(z \leq 3.2 \cdot 10^{+117}\right):\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{a - z}{t}}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (or (<= z -7.5e+33) (not (<= z 3.2e+117)))
   (+ y x)
   (+ x (/ y (/ (- a z) t)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((z <= -7.5e+33) || !(z <= 3.2e+117)) {
		tmp = y + x;
	} else {
		tmp = x + (y / ((a - 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 <= (-7.5d+33)) .or. (.not. (z <= 3.2d+117))) then
        tmp = y + x
    else
        tmp = x + (y / ((a - 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 <= -7.5e+33) || !(z <= 3.2e+117)) {
		tmp = y + x;
	} else {
		tmp = x + (y / ((a - z) / t));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (z <= -7.5e+33) or not (z <= 3.2e+117):
		tmp = y + x
	else:
		tmp = x + (y / ((a - z) / t))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((z <= -7.5e+33) || !(z <= 3.2e+117))
		tmp = Float64(y + x);
	else
		tmp = Float64(x + Float64(y / Float64(Float64(a - z) / t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if ((z <= -7.5e+33) || ~((z <= 3.2e+117)))
		tmp = y + x;
	else
		tmp = x + (y / ((a - z) / t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7.5e+33], N[Not[LessEqual[z, 3.2e+117]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{+33} \lor \neg \left(z \leq 3.2 \cdot 10^{+117}\right):\\
\;\;\;\;y + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.50000000000000046e33 or 3.20000000000000005e117 < z

    1. Initial program 73.3%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Step-by-step derivation
      1. +-commutative73.3%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{z - a}, z - t, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 78.5%

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

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

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

    if -7.50000000000000046e33 < z < 3.20000000000000005e117

    1. Initial program 98.2%

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

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

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

        \[\leadsto x + \color{blue}{\left(-t \cdot \frac{y}{z - a}\right)} \]
      3. *-commutative90.1%

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

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

      \[\leadsto x + \color{blue}{\frac{y}{z - a} \cdot \left(-t\right)} \]
    6. Step-by-step derivation
      1. associate-*l/91.7%

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

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

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

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

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

        \[\leadsto x + \frac{-y \cdot \color{blue}{\left(\sqrt{t} \cdot \sqrt{t}\right)}}{-\left(z - a\right)} \]
      7. add-sqr-sqrt50.5%

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

        \[\leadsto x + \frac{\color{blue}{y \cdot \left(-t\right)}}{-\left(z - a\right)} \]
      9. add-sqr-sqrt20.3%

        \[\leadsto x + \frac{y \cdot \color{blue}{\left(\sqrt{-t} \cdot \sqrt{-t}\right)}}{-\left(z - a\right)} \]
      10. sqrt-unprod61.1%

        \[\leadsto x + \frac{y \cdot \color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}}}{-\left(z - a\right)} \]
      11. sqr-neg61.1%

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

        \[\leadsto x + \frac{y \cdot \color{blue}{\left(\sqrt{t} \cdot \sqrt{t}\right)}}{-\left(z - a\right)} \]
      13. add-sqr-sqrt91.7%

        \[\leadsto x + \frac{y \cdot \color{blue}{t}}{-\left(z - a\right)} \]
    7. Applied egg-rr91.7%

      \[\leadsto x + \color{blue}{\frac{y \cdot t}{-\left(z - a\right)}} \]
    8. Step-by-step derivation
      1. associate-/l*90.2%

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

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

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

        \[\leadsto x + \frac{y}{\color{blue}{\frac{a}{t} + -1 \cdot \frac{z}{t}}} \]
      2. mul-1-neg88.9%

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

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

        \[\leadsto x + \frac{y}{\color{blue}{\frac{a - z}{t}}} \]
    12. Simplified90.2%

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

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

Alternative 5: 86.6% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3 \cdot 10^{+30} \lor \neg \left(z \leq 1.5 \cdot 10^{+112}\right):\\ \;\;\;\;x + y \cdot \frac{z}{z - a}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{a - z}{t}}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (or (<= z -3e+30) (not (<= z 1.5e+112)))
   (+ x (* y (/ z (- z a))))
   (+ x (/ y (/ (- a z) t)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((z <= -3e+30) || !(z <= 1.5e+112)) {
		tmp = x + (y * (z / (z - a)));
	} else {
		tmp = x + (y / ((a - 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 <= (-3d+30)) .or. (.not. (z <= 1.5d+112))) then
        tmp = x + (y * (z / (z - a)))
    else
        tmp = x + (y / ((a - 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 <= -3e+30) || !(z <= 1.5e+112)) {
		tmp = x + (y * (z / (z - a)));
	} else {
		tmp = x + (y / ((a - z) / t));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (z <= -3e+30) or not (z <= 1.5e+112):
		tmp = x + (y * (z / (z - a)))
	else:
		tmp = x + (y / ((a - z) / t))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((z <= -3e+30) || !(z <= 1.5e+112))
		tmp = Float64(x + Float64(y * Float64(z / Float64(z - a))));
	else
		tmp = Float64(x + Float64(y / Float64(Float64(a - z) / t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if ((z <= -3e+30) || ~((z <= 1.5e+112)))
		tmp = x + (y * (z / (z - a)));
	else
		tmp = x + (y / ((a - z) / t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3e+30], N[Not[LessEqual[z, 1.5e+112]], $MachinePrecision]], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(a - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{+30} \lor \neg \left(z \leq 1.5 \cdot 10^{+112}\right):\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.99999999999999978e30 or 1.4999999999999999e112 < z

    1. Initial program 73.3%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Step-by-step derivation
      1. +-commutative73.3%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{z - a}, z - t, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-udef90.0%

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

        \[\leadsto \color{blue}{\frac{y}{\frac{z - a}{z - t}}} + x \]
      3. div-inv99.9%

        \[\leadsto \color{blue}{y \cdot \frac{1}{\frac{z - a}{z - t}}} + x \]
      4. clear-num99.9%

        \[\leadsto y \cdot \color{blue}{\frac{z - t}{z - a}} + x \]
    6. Applied egg-rr99.9%

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

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

    if -2.99999999999999978e30 < z < 1.4999999999999999e112

    1. Initial program 98.2%

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

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

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

        \[\leadsto x + \color{blue}{\left(-t \cdot \frac{y}{z - a}\right)} \]
      3. *-commutative90.1%

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

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

      \[\leadsto x + \color{blue}{\frac{y}{z - a} \cdot \left(-t\right)} \]
    6. Step-by-step derivation
      1. associate-*l/91.7%

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

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

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

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

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

        \[\leadsto x + \frac{-y \cdot \color{blue}{\left(\sqrt{t} \cdot \sqrt{t}\right)}}{-\left(z - a\right)} \]
      7. add-sqr-sqrt50.5%

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

        \[\leadsto x + \frac{\color{blue}{y \cdot \left(-t\right)}}{-\left(z - a\right)} \]
      9. add-sqr-sqrt20.3%

        \[\leadsto x + \frac{y \cdot \color{blue}{\left(\sqrt{-t} \cdot \sqrt{-t}\right)}}{-\left(z - a\right)} \]
      10. sqrt-unprod61.1%

        \[\leadsto x + \frac{y \cdot \color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}}}{-\left(z - a\right)} \]
      11. sqr-neg61.1%

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

        \[\leadsto x + \frac{y \cdot \color{blue}{\left(\sqrt{t} \cdot \sqrt{t}\right)}}{-\left(z - a\right)} \]
      13. add-sqr-sqrt91.7%

        \[\leadsto x + \frac{y \cdot \color{blue}{t}}{-\left(z - a\right)} \]
    7. Applied egg-rr91.7%

      \[\leadsto x + \color{blue}{\frac{y \cdot t}{-\left(z - a\right)}} \]
    8. Step-by-step derivation
      1. associate-/l*90.2%

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

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

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

        \[\leadsto x + \frac{y}{\color{blue}{\frac{a}{t} + -1 \cdot \frac{z}{t}}} \]
      2. mul-1-neg88.9%

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

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

        \[\leadsto x + \frac{y}{\color{blue}{\frac{a - z}{t}}} \]
    12. Simplified90.2%

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

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

Alternative 6: 87.2% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.95 \cdot 10^{+31}:\\ \;\;\;\;x + y \cdot \frac{z}{z - a}\\ \mathbf{elif}\;z \leq 3 \cdot 10^{+38}:\\ \;\;\;\;x + \frac{y}{\frac{a - z}{t}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -2.95e+31)
   (+ x (* y (/ z (- z a))))
   (if (<= z 3e+38) (+ x (/ y (/ (- a z) t))) (+ x (/ y (/ z (- z t)))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -2.95e+31) {
		tmp = x + (y * (z / (z - a)));
	} else if (z <= 3e+38) {
		tmp = x + (y / ((a - z) / t));
	} 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 <= (-2.95d+31)) then
        tmp = x + (y * (z / (z - a)))
    else if (z <= 3d+38) then
        tmp = x + (y / ((a - z) / t))
    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 <= -2.95e+31) {
		tmp = x + (y * (z / (z - a)));
	} else if (z <= 3e+38) {
		tmp = x + (y / ((a - z) / t));
	} else {
		tmp = x + (y / (z / (z - t)));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -2.95e+31:
		tmp = x + (y * (z / (z - a)))
	elif z <= 3e+38:
		tmp = x + (y / ((a - z) / t))
	else:
		tmp = x + (y / (z / (z - t)))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -2.95e+31)
		tmp = Float64(x + Float64(y * Float64(z / Float64(z - a))));
	elseif (z <= 3e+38)
		tmp = Float64(x + Float64(y / Float64(Float64(a - z) / t)));
	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 <= -2.95e+31)
		tmp = x + (y * (z / (z - a)));
	elseif (z <= 3e+38)
		tmp = x + (y / ((a - z) / t));
	else
		tmp = x + (y / (z / (z - t)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.95e+31], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3e+38], N[(x + N[(y / N[(N[(a - z), $MachinePrecision] / t), $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 -2.95 \cdot 10^{+31}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.9500000000000002e31

    1. Initial program 80.0%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Step-by-step derivation
      1. +-commutative80.0%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{z - a}, z - t, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-udef92.0%

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

        \[\leadsto \color{blue}{\frac{y}{\frac{z - a}{z - t}}} + x \]
      3. div-inv99.9%

        \[\leadsto \color{blue}{y \cdot \frac{1}{\frac{z - a}{z - t}}} + x \]
      4. clear-num99.9%

        \[\leadsto y \cdot \color{blue}{\frac{z - t}{z - a}} + x \]
    6. Applied egg-rr99.9%

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

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

    if -2.9500000000000002e31 < z < 3.0000000000000001e38

    1. Initial program 98.0%

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{\frac{y}{z - a} \cdot \left(-t\right)} \]
    6. Step-by-step derivation
      1. associate-*l/91.7%

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

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

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

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

        \[\leadsto x + \frac{-y \cdot \sqrt{\color{blue}{t \cdot t}}}{-\left(z - a\right)} \]
      6. sqrt-unprod29.9%

        \[\leadsto x + \frac{-y \cdot \color{blue}{\left(\sqrt{t} \cdot \sqrt{t}\right)}}{-\left(z - a\right)} \]
      7. add-sqr-sqrt49.2%

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

        \[\leadsto x + \frac{\color{blue}{y \cdot \left(-t\right)}}{-\left(z - a\right)} \]
      9. add-sqr-sqrt19.3%

        \[\leadsto x + \frac{y \cdot \color{blue}{\left(\sqrt{-t} \cdot \sqrt{-t}\right)}}{-\left(z - a\right)} \]
      10. sqrt-unprod59.9%

        \[\leadsto x + \frac{y \cdot \color{blue}{\sqrt{\left(-t\right) \cdot \left(-t\right)}}}{-\left(z - a\right)} \]
      11. sqr-neg59.9%

        \[\leadsto x + \frac{y \cdot \sqrt{\color{blue}{t \cdot t}}}{-\left(z - a\right)} \]
      12. sqrt-unprod48.7%

        \[\leadsto x + \frac{y \cdot \color{blue}{\left(\sqrt{t} \cdot \sqrt{t}\right)}}{-\left(z - a\right)} \]
      13. add-sqr-sqrt91.7%

        \[\leadsto x + \frac{y \cdot \color{blue}{t}}{-\left(z - a\right)} \]
    7. Applied egg-rr91.7%

      \[\leadsto x + \color{blue}{\frac{y \cdot t}{-\left(z - a\right)}} \]
    8. Step-by-step derivation
      1. associate-/l*90.1%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{-\left(z - a\right)}{t}}} \]
    9. Simplified90.1%

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

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

        \[\leadsto x + \frac{y}{\color{blue}{\frac{a}{t} + -1 \cdot \frac{z}{t}}} \]
      2. mul-1-neg88.7%

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

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

        \[\leadsto x + \frac{y}{\color{blue}{\frac{a - z}{t}}} \]
    12. Simplified90.1%

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

    if 3.0000000000000001e38 < z

    1. Initial program 73.4%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Step-by-step derivation
      1. +-commutative73.4%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{z - a}, z - t, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around 0 71.8%

      \[\leadsto \color{blue}{x + \frac{y \cdot \left(z - t\right)}{z}} \]
    6. Step-by-step derivation
      1. +-commutative71.8%

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

        \[\leadsto \color{blue}{\frac{y}{\frac{z}{z - t}}} + x \]
    7. Simplified91.2%

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

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

Alternative 7: 86.3% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.7 \cdot 10^{+28}:\\ \;\;\;\;x + y \cdot \frac{z}{z - a}\\ \mathbf{elif}\;z \leq 6.6 \cdot 10^{+36}:\\ \;\;\;\;x - \frac{y \cdot t}{z - a}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -2.7e+28)
   (+ x (* y (/ z (- z a))))
   (if (<= z 6.6e+36) (- x (/ (* y t) (- z a))) (+ x (/ y (/ z (- z t)))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -2.7e+28) {
		tmp = x + (y * (z / (z - a)));
	} else if (z <= 6.6e+36) {
		tmp = x - ((y * t) / (z - a));
	} 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 <= (-2.7d+28)) then
        tmp = x + (y * (z / (z - a)))
    else if (z <= 6.6d+36) then
        tmp = x - ((y * t) / (z - a))
    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 <= -2.7e+28) {
		tmp = x + (y * (z / (z - a)));
	} else if (z <= 6.6e+36) {
		tmp = x - ((y * t) / (z - a));
	} else {
		tmp = x + (y / (z / (z - t)));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -2.7e+28:
		tmp = x + (y * (z / (z - a)))
	elif z <= 6.6e+36:
		tmp = x - ((y * t) / (z - a))
	else:
		tmp = x + (y / (z / (z - t)))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -2.7e+28)
		tmp = Float64(x + Float64(y * Float64(z / Float64(z - a))));
	elseif (z <= 6.6e+36)
		tmp = Float64(x - Float64(Float64(y * t) / Float64(z - a)));
	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 <= -2.7e+28)
		tmp = x + (y * (z / (z - a)));
	elseif (z <= 6.6e+36)
		tmp = x - ((y * t) / (z - a));
	else
		tmp = x + (y / (z / (z - t)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.7e+28], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.6e+36], N[(x - N[(N[(y * t), $MachinePrecision] / N[(z - a), $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 -2.7 \cdot 10^{+28}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.7000000000000002e28

    1. Initial program 80.0%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Step-by-step derivation
      1. +-commutative80.0%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{z - a}, z - t, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-udef92.0%

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

        \[\leadsto \color{blue}{\frac{y}{\frac{z - a}{z - t}}} + x \]
      3. div-inv99.9%

        \[\leadsto \color{blue}{y \cdot \frac{1}{\frac{z - a}{z - t}}} + x \]
      4. clear-num99.9%

        \[\leadsto y \cdot \color{blue}{\frac{z - t}{z - a}} + x \]
    6. Applied egg-rr99.9%

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

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

    if -2.7000000000000002e28 < z < 6.5999999999999997e36

    1. Initial program 98.0%

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

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

        \[\leadsto x + \frac{\color{blue}{-t \cdot y}}{z - a} \]
      2. distribute-lft-neg-out91.7%

        \[\leadsto x + \frac{\color{blue}{\left(-t\right) \cdot y}}{z - a} \]
      3. *-commutative91.7%

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

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

    if 6.5999999999999997e36 < z

    1. Initial program 73.4%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Step-by-step derivation
      1. +-commutative73.4%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{z - a}, z - t, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around 0 71.8%

      \[\leadsto \color{blue}{x + \frac{y \cdot \left(z - t\right)}{z}} \]
    6. Step-by-step derivation
      1. +-commutative71.8%

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

        \[\leadsto \color{blue}{\frac{y}{\frac{z}{z - t}}} + x \]
    7. Simplified91.2%

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

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

Alternative 8: 75.5% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -7 \cdot 10^{+21} \lor \neg \left(z \leq 4.4 \cdot 10^{+37}\right):\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y \cdot t}{a}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (or (<= z -7e+21) (not (<= z 4.4e+37))) (+ y x) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((z <= -7e+21) || !(z <= 4.4e+37)) {
		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 <= (-7d+21)) .or. (.not. (z <= 4.4d+37))) 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 <= -7e+21) || !(z <= 4.4e+37)) {
		tmp = y + x;
	} else {
		tmp = x + ((y * t) / a);
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (z <= -7e+21) or not (z <= 4.4e+37):
		tmp = y + x
	else:
		tmp = x + ((y * t) / a)
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((z <= -7e+21) || !(z <= 4.4e+37))
		tmp = Float64(y + x);
	else
		tmp = Float64(x + Float64(Float64(y * t) / a));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if ((z <= -7e+21) || ~((z <= 4.4e+37)))
		tmp = y + x;
	else
		tmp = x + ((y * t) / a);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7e+21], N[Not[LessEqual[z, 4.4e+37]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{+21} \lor \neg \left(z \leq 4.4 \cdot 10^{+37}\right):\\
\;\;\;\;y + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7e21 or 4.4000000000000001e37 < z

    1. Initial program 76.8%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Step-by-step derivation
      1. +-commutative76.8%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{z - a}, z - t, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 77.6%

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

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified77.6%

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

    if -7e21 < z < 4.4000000000000001e37

    1. Initial program 98.0%

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

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

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

Alternative 9: 76.9% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.45 \cdot 10^{+17} \lor \neg \left(z \leq 2 \cdot 10^{+39}\right):\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t}}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (or (<= z -1.45e+17) (not (<= z 2e+39))) (+ y x) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if ((z <= -1.45e+17) || !(z <= 2e+39)) {
		tmp = y + x;
	} else {
		tmp = x + (y / (a / 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 <= (-1.45d+17)) .or. (.not. (z <= 2d+39))) then
        tmp = y + x
    else
        tmp = x + (y / (a / 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 <= -1.45e+17) || !(z <= 2e+39)) {
		tmp = y + x;
	} else {
		tmp = x + (y / (a / t));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if (z <= -1.45e+17) or not (z <= 2e+39):
		tmp = y + x
	else:
		tmp = x + (y / (a / t))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if ((z <= -1.45e+17) || !(z <= 2e+39))
		tmp = Float64(y + x);
	else
		tmp = Float64(x + Float64(y / Float64(a / t)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if ((z <= -1.45e+17) || ~((z <= 2e+39)))
		tmp = y + x;
	else
		tmp = x + (y / (a / t));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.45e+17], N[Not[LessEqual[z, 2e+39]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{+17} \lor \neg \left(z \leq 2 \cdot 10^{+39}\right):\\
\;\;\;\;y + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.45e17 or 1.99999999999999988e39 < z

    1. Initial program 76.8%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Step-by-step derivation
      1. +-commutative76.8%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{z - a}, z - t, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 77.6%

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

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified77.6%

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

    if -1.45e17 < z < 1.99999999999999988e39

    1. Initial program 98.0%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Step-by-step derivation
      1. +-commutative98.0%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{z - a}, z - t, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 81.1%

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

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

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

      \[\leadsto \color{blue}{\frac{t}{\frac{a}{y}} + x} \]
    8. Step-by-step derivation
      1. clear-num79.2%

        \[\leadsto \color{blue}{\frac{1}{\frac{\frac{a}{y}}{t}}} + x \]
      2. associate-/r/79.2%

        \[\leadsto \color{blue}{\frac{1}{\frac{a}{y}} \cdot t} + x \]
      3. clear-num79.4%

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

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

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

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

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

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

Alternative 10: 61.8% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -9.5 \cdot 10^{+28}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 4.4 \cdot 10^{+201}:\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= a -9.5e+28) x (if (<= a 4.4e+201) (+ y x) x)))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (a <= -9.5e+28) {
		tmp = x;
	} else if (a <= 4.4e+201) {
		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 <= (-9.5d+28)) then
        tmp = x
    else if (a <= 4.4d+201) 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 <= -9.5e+28) {
		tmp = x;
	} else if (a <= 4.4e+201) {
		tmp = y + x;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if a <= -9.5e+28:
		tmp = x
	elif a <= 4.4e+201:
		tmp = y + x
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (a <= -9.5e+28)
		tmp = x;
	elseif (a <= 4.4e+201)
		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 <= -9.5e+28)
		tmp = x;
	elseif (a <= 4.4e+201)
		tmp = y + x;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -9.5e+28], x, If[LessEqual[a, 4.4e+201], N[(y + x), $MachinePrecision], x]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -9.5 \cdot 10^{+28}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 4.4 \cdot 10^{+201}:\\
\;\;\;\;y + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -9.49999999999999927e28 or 4.4e201 < a

    1. Initial program 89.0%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Step-by-step derivation
      1. +-commutative89.0%

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

        \[\leadsto \color{blue}{\frac{y}{z - a} \cdot \left(z - t\right)} + x \]
      3. fma-def96.9%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{z - a}, z - t, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 74.0%

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

    if -9.49999999999999927e28 < a < 4.4e201

    1. Initial program 89.4%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Step-by-step derivation
      1. +-commutative89.4%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{z - a}, z - t, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 58.0%

      \[\leadsto \color{blue}{x + y} \]
    6. Step-by-step derivation
      1. +-commutative58.0%

        \[\leadsto \color{blue}{y + x} \]
    7. Simplified58.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -9.5 \cdot 10^{+28}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 4.4 \cdot 10^{+201}:\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 51.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -3.1 \cdot 10^{+176}:\\ \;\;\;\;y\\ \mathbf{elif}\;y \leq 3.4 \cdot 10^{+63}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= y -3.1e+176) y (if (<= y 3.4e+63) x y)))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (y <= -3.1e+176) {
		tmp = y;
	} else if (y <= 3.4e+63) {
		tmp = x;
	} else {
		tmp = y;
	}
	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 (y <= (-3.1d+176)) then
        tmp = y
    else if (y <= 3.4d+63) then
        tmp = x
    else
        tmp = y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (y <= -3.1e+176) {
		tmp = y;
	} else if (y <= 3.4e+63) {
		tmp = x;
	} else {
		tmp = y;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if y <= -3.1e+176:
		tmp = y
	elif y <= 3.4e+63:
		tmp = x
	else:
		tmp = y
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (y <= -3.1e+176)
		tmp = y;
	elseif (y <= 3.4e+63)
		tmp = x;
	else
		tmp = y;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (y <= -3.1e+176)
		tmp = y;
	elseif (y <= 3.4e+63)
		tmp = x;
	else
		tmp = y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -3.1e+176], y, If[LessEqual[y, 3.4e+63], x, y]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.1 \cdot 10^{+176}:\\
\;\;\;\;y\\

\mathbf{elif}\;y \leq 3.4 \cdot 10^{+63}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.0999999999999999e176 or 3.3999999999999999e63 < y

    1. Initial program 65.8%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Step-by-step derivation
      1. +-commutative65.8%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{z - a}, z - t, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around 0 30.1%

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

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

        \[\leadsto \color{blue}{\frac{y}{\frac{z}{z - t}}} + x \]
      3. associate-/r/48.5%

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

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

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

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

    if -3.0999999999999999e176 < y < 3.3999999999999999e63

    1. Initial program 98.8%

      \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
    2. Step-by-step derivation
      1. +-commutative98.8%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{z - a}, z - t, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 63.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.1 \cdot 10^{+176}:\\ \;\;\;\;y\\ \mathbf{elif}\;y \leq 3.4 \cdot 10^{+63}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 98.1% accurate, 1.0× speedup?

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

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

    \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
  2. Step-by-step derivation
    1. +-commutative89.3%

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

      \[\leadsto \color{blue}{\frac{y}{z - a} \cdot \left(z - t\right)} + x \]
    3. fma-def93.1%

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{z - a}, z - t, x\right)} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. fma-udef93.1%

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

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

      \[\leadsto \color{blue}{y \cdot \frac{1}{\frac{z - a}{z - t}}} + x \]
    4. clear-num97.6%

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

    \[\leadsto \color{blue}{y \cdot \frac{z - t}{z - a} + x} \]
  7. Final simplification97.6%

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

Alternative 13: 49.8% 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 89.3%

    \[x + \frac{y \cdot \left(z - t\right)}{z - a} \]
  2. Step-by-step derivation
    1. +-commutative89.3%

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

      \[\leadsto \color{blue}{\frac{y}{z - a} \cdot \left(z - t\right)} + x \]
    3. fma-def93.1%

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{z - a}, z - t, x\right)} \]
  4. Add Preprocessing
  5. Taylor expanded in y around 0 49.1%

    \[\leadsto \color{blue}{x} \]
  6. Final simplification49.1%

    \[\leadsto x \]
  7. 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 2024031 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
  :precision binary64

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

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