Graphics.Rendering.Chart.Backend.Diagrams:calcFontMetrics from Chart-diagrams-1.5.1, A

Percentage Accurate: 87.5% → 99.1%
Time: 7.3s
Alternatives: 12
Speedup: 0.3×

Specification

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

\\
\frac{x + y}{1 - \frac{y}{z}}
\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: 87.5% accurate, 1.0× speedup?

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

\\
\frac{x + y}{1 - \frac{y}{z}}
\end{array}

Alternative 1: 99.1% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{x + y}{1 - \frac{y}{z}}\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{-236} \lor \neg \left(t\_0 \leq 0\right):\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (+.f64 x y) (-.f64 #s(literal 1 binary64) (/.f64 y z))) < -1e-236 or -0.0 < (/.f64 (+.f64 x y) (-.f64 #s(literal 1 binary64) (/.f64 y z)))

    1. Initial program 99.9%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing

    if -1e-236 < (/.f64 (+.f64 x y) (-.f64 #s(literal 1 binary64) (/.f64 y z))) < -0.0

    1. Initial program 11.6%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 95.0%

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

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

        \[\leadsto -\color{blue}{z \cdot \frac{x + y}{y}} \]
      3. distribute-rgt-neg-in99.9%

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

        \[\leadsto z \cdot \color{blue}{\frac{x + y}{-y}} \]
      5. +-commutative99.9%

        \[\leadsto z \cdot \frac{\color{blue}{y + x}}{-y} \]
    5. Simplified99.9%

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

        \[\leadsto \color{blue}{\frac{z \cdot \left(y + x\right)}{-y}} \]
      2. distribute-frac-neg295.0%

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

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

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

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

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

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

        \[\leadsto -\color{blue}{z \cdot \frac{y + x}{-y}} \]
      9. clear-num4.7%

        \[\leadsto -z \cdot \color{blue}{\frac{1}{\frac{-y}{y + x}}} \]
      10. un-div-inv4.7%

        \[\leadsto -\color{blue}{\frac{z}{\frac{-y}{y + x}}} \]
      11. add-sqr-sqrt2.6%

        \[\leadsto -\frac{z}{\frac{\color{blue}{\sqrt{-y} \cdot \sqrt{-y}}}{y + x}} \]
      12. sqrt-unprod16.7%

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

        \[\leadsto -\frac{z}{\frac{\sqrt{\color{blue}{y \cdot y}}}{y + x}} \]
      14. sqrt-unprod45.4%

        \[\leadsto -\frac{z}{\frac{\color{blue}{\sqrt{y} \cdot \sqrt{y}}}{y + x}} \]
      15. add-sqr-sqrt99.9%

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

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

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

Alternative 2: 69.0% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{1 - \frac{y}{z}}\\ \mathbf{if}\;y \leq -4.1 \cdot 10^{+152}:\\ \;\;\;\;-z\\ \mathbf{elif}\;y \leq -1.02 \cdot 10^{+101}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;y \leq -3.65 \cdot 10^{+77}:\\ \;\;\;\;-z\\ \mathbf{elif}\;y \leq -1.32 \cdot 10^{-90}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq 2.3 \cdot 10^{-72}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;y \leq 5 \cdot 10^{+44}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (/ x (- 1.0 (/ y z)))))
   (if (<= y -4.1e+152)
     (- z)
     (if (<= y -1.02e+101)
       (+ x y)
       (if (<= y -3.65e+77)
         (- z)
         (if (<= y -1.32e-90)
           t_0
           (if (<= y 2.3e-72) (+ x y) (if (<= y 5e+44) t_0 (- z)))))))))
double code(double x, double y, double z) {
	double t_0 = x / (1.0 - (y / z));
	double tmp;
	if (y <= -4.1e+152) {
		tmp = -z;
	} else if (y <= -1.02e+101) {
		tmp = x + y;
	} else if (y <= -3.65e+77) {
		tmp = -z;
	} else if (y <= -1.32e-90) {
		tmp = t_0;
	} else if (y <= 2.3e-72) {
		tmp = x + y;
	} else if (y <= 5e+44) {
		tmp = t_0;
	} else {
		tmp = -z;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = x / (1.0d0 - (y / z))
    if (y <= (-4.1d+152)) then
        tmp = -z
    else if (y <= (-1.02d+101)) then
        tmp = x + y
    else if (y <= (-3.65d+77)) then
        tmp = -z
    else if (y <= (-1.32d-90)) then
        tmp = t_0
    else if (y <= 2.3d-72) then
        tmp = x + y
    else if (y <= 5d+44) then
        tmp = t_0
    else
        tmp = -z
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = x / (1.0 - (y / z));
	double tmp;
	if (y <= -4.1e+152) {
		tmp = -z;
	} else if (y <= -1.02e+101) {
		tmp = x + y;
	} else if (y <= -3.65e+77) {
		tmp = -z;
	} else if (y <= -1.32e-90) {
		tmp = t_0;
	} else if (y <= 2.3e-72) {
		tmp = x + y;
	} else if (y <= 5e+44) {
		tmp = t_0;
	} else {
		tmp = -z;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = x / (1.0 - (y / z))
	tmp = 0
	if y <= -4.1e+152:
		tmp = -z
	elif y <= -1.02e+101:
		tmp = x + y
	elif y <= -3.65e+77:
		tmp = -z
	elif y <= -1.32e-90:
		tmp = t_0
	elif y <= 2.3e-72:
		tmp = x + y
	elif y <= 5e+44:
		tmp = t_0
	else:
		tmp = -z
	return tmp
function code(x, y, z)
	t_0 = Float64(x / Float64(1.0 - Float64(y / z)))
	tmp = 0.0
	if (y <= -4.1e+152)
		tmp = Float64(-z);
	elseif (y <= -1.02e+101)
		tmp = Float64(x + y);
	elseif (y <= -3.65e+77)
		tmp = Float64(-z);
	elseif (y <= -1.32e-90)
		tmp = t_0;
	elseif (y <= 2.3e-72)
		tmp = Float64(x + y);
	elseif (y <= 5e+44)
		tmp = t_0;
	else
		tmp = Float64(-z);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = x / (1.0 - (y / z));
	tmp = 0.0;
	if (y <= -4.1e+152)
		tmp = -z;
	elseif (y <= -1.02e+101)
		tmp = x + y;
	elseif (y <= -3.65e+77)
		tmp = -z;
	elseif (y <= -1.32e-90)
		tmp = t_0;
	elseif (y <= 2.3e-72)
		tmp = x + y;
	elseif (y <= 5e+44)
		tmp = t_0;
	else
		tmp = -z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(x / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.1e+152], (-z), If[LessEqual[y, -1.02e+101], N[(x + y), $MachinePrecision], If[LessEqual[y, -3.65e+77], (-z), If[LessEqual[y, -1.32e-90], t$95$0, If[LessEqual[y, 2.3e-72], N[(x + y), $MachinePrecision], If[LessEqual[y, 5e+44], t$95$0, (-z)]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{x}{1 - \frac{y}{z}}\\
\mathbf{if}\;y \leq -4.1 \cdot 10^{+152}:\\
\;\;\;\;-z\\

\mathbf{elif}\;y \leq -1.02 \cdot 10^{+101}:\\
\;\;\;\;x + y\\

\mathbf{elif}\;y \leq -3.65 \cdot 10^{+77}:\\
\;\;\;\;-z\\

\mathbf{elif}\;y \leq -1.32 \cdot 10^{-90}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;y \leq 2.3 \cdot 10^{-72}:\\
\;\;\;\;x + y\\

\mathbf{elif}\;y \leq 5 \cdot 10^{+44}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;-z\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -4.0999999999999998e152 or -1.02000000000000002e101 < y < -3.65000000000000012e77 or 4.9999999999999996e44 < y

    1. Initial program 72.4%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 75.6%

      \[\leadsto \color{blue}{-1 \cdot z} \]
    4. Step-by-step derivation
      1. mul-1-neg75.6%

        \[\leadsto \color{blue}{-z} \]
    5. Simplified75.6%

      \[\leadsto \color{blue}{-z} \]

    if -4.0999999999999998e152 < y < -1.02000000000000002e101 or -1.32000000000000005e-90 < y < 2.29999999999999995e-72

    1. Initial program 99.1%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 82.6%

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

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

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

    if -3.65000000000000012e77 < y < -1.32000000000000005e-90 or 2.29999999999999995e-72 < y < 4.9999999999999996e44

    1. Initial program 97.3%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 74.1%

      \[\leadsto \color{blue}{\frac{x}{1 - \frac{y}{z}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification78.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.1 \cdot 10^{+152}:\\ \;\;\;\;-z\\ \mathbf{elif}\;y \leq -1.02 \cdot 10^{+101}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;y \leq -3.65 \cdot 10^{+77}:\\ \;\;\;\;-z\\ \mathbf{elif}\;y \leq -1.32 \cdot 10^{-90}:\\ \;\;\;\;\frac{x}{1 - \frac{y}{z}}\\ \mathbf{elif}\;y \leq 2.3 \cdot 10^{-72}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;y \leq 5 \cdot 10^{+44}:\\ \;\;\;\;\frac{x}{1 - \frac{y}{z}}\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 74.2% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 1 - \frac{y}{z}\\ \mathbf{if}\;y \leq -1.02 \cdot 10^{+150}:\\ \;\;\;\;\frac{z}{\frac{y}{\left(-y\right) - x}}\\ \mathbf{elif}\;y \leq -3.6 \cdot 10^{+77}:\\ \;\;\;\;\frac{y}{t\_0}\\ \mathbf{elif}\;y \leq -5.3 \cdot 10^{-116}:\\ \;\;\;\;\frac{x}{t\_0}\\ \mathbf{elif}\;y \leq 1.22 \cdot 10^{-57}:\\ \;\;\;\;\left(x + y\right) \cdot \left(1 + \frac{y}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{x + y}{-y}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (- 1.0 (/ y z))))
   (if (<= y -1.02e+150)
     (/ z (/ y (- (- y) x)))
     (if (<= y -3.6e+77)
       (/ y t_0)
       (if (<= y -5.3e-116)
         (/ x t_0)
         (if (<= y 1.22e-57)
           (* (+ x y) (+ 1.0 (/ y z)))
           (* z (/ (+ x y) (- y)))))))))
double code(double x, double y, double z) {
	double t_0 = 1.0 - (y / z);
	double tmp;
	if (y <= -1.02e+150) {
		tmp = z / (y / (-y - x));
	} else if (y <= -3.6e+77) {
		tmp = y / t_0;
	} else if (y <= -5.3e-116) {
		tmp = x / t_0;
	} else if (y <= 1.22e-57) {
		tmp = (x + y) * (1.0 + (y / z));
	} else {
		tmp = z * ((x + y) / -y);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = 1.0d0 - (y / z)
    if (y <= (-1.02d+150)) then
        tmp = z / (y / (-y - x))
    else if (y <= (-3.6d+77)) then
        tmp = y / t_0
    else if (y <= (-5.3d-116)) then
        tmp = x / t_0
    else if (y <= 1.22d-57) then
        tmp = (x + y) * (1.0d0 + (y / z))
    else
        tmp = z * ((x + y) / -y)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = 1.0 - (y / z);
	double tmp;
	if (y <= -1.02e+150) {
		tmp = z / (y / (-y - x));
	} else if (y <= -3.6e+77) {
		tmp = y / t_0;
	} else if (y <= -5.3e-116) {
		tmp = x / t_0;
	} else if (y <= 1.22e-57) {
		tmp = (x + y) * (1.0 + (y / z));
	} else {
		tmp = z * ((x + y) / -y);
	}
	return tmp;
}
def code(x, y, z):
	t_0 = 1.0 - (y / z)
	tmp = 0
	if y <= -1.02e+150:
		tmp = z / (y / (-y - x))
	elif y <= -3.6e+77:
		tmp = y / t_0
	elif y <= -5.3e-116:
		tmp = x / t_0
	elif y <= 1.22e-57:
		tmp = (x + y) * (1.0 + (y / z))
	else:
		tmp = z * ((x + y) / -y)
	return tmp
function code(x, y, z)
	t_0 = Float64(1.0 - Float64(y / z))
	tmp = 0.0
	if (y <= -1.02e+150)
		tmp = Float64(z / Float64(y / Float64(Float64(-y) - x)));
	elseif (y <= -3.6e+77)
		tmp = Float64(y / t_0);
	elseif (y <= -5.3e-116)
		tmp = Float64(x / t_0);
	elseif (y <= 1.22e-57)
		tmp = Float64(Float64(x + y) * Float64(1.0 + Float64(y / z)));
	else
		tmp = Float64(z * Float64(Float64(x + y) / Float64(-y)));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = 1.0 - (y / z);
	tmp = 0.0;
	if (y <= -1.02e+150)
		tmp = z / (y / (-y - x));
	elseif (y <= -3.6e+77)
		tmp = y / t_0;
	elseif (y <= -5.3e-116)
		tmp = x / t_0;
	elseif (y <= 1.22e-57)
		tmp = (x + y) * (1.0 + (y / z));
	else
		tmp = z * ((x + y) / -y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.02e+150], N[(z / N[(y / N[((-y) - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -3.6e+77], N[(y / t$95$0), $MachinePrecision], If[LessEqual[y, -5.3e-116], N[(x / t$95$0), $MachinePrecision], If[LessEqual[y, 1.22e-57], N[(N[(x + y), $MachinePrecision] * N[(1.0 + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(x + y), $MachinePrecision] / (-y)), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 1 - \frac{y}{z}\\
\mathbf{if}\;y \leq -1.02 \cdot 10^{+150}:\\
\;\;\;\;\frac{z}{\frac{y}{\left(-y\right) - x}}\\

\mathbf{elif}\;y \leq -3.6 \cdot 10^{+77}:\\
\;\;\;\;\frac{y}{t\_0}\\

\mathbf{elif}\;y \leq -5.3 \cdot 10^{-116}:\\
\;\;\;\;\frac{x}{t\_0}\\

\mathbf{elif}\;y \leq 1.22 \cdot 10^{-57}:\\
\;\;\;\;\left(x + y\right) \cdot \left(1 + \frac{y}{z}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -1.0199999999999999e150

    1. Initial program 62.8%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 71.9%

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

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

        \[\leadsto -\color{blue}{z \cdot \frac{x + y}{y}} \]
      3. distribute-rgt-neg-in88.6%

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

        \[\leadsto z \cdot \color{blue}{\frac{x + y}{-y}} \]
      5. +-commutative88.6%

        \[\leadsto z \cdot \frac{\color{blue}{y + x}}{-y} \]
    5. Simplified88.6%

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

        \[\leadsto \color{blue}{\frac{z \cdot \left(y + x\right)}{-y}} \]
      2. distribute-frac-neg271.9%

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

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

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

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

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

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

        \[\leadsto -\color{blue}{z \cdot \frac{y + x}{-y}} \]
      9. clear-num3.0%

        \[\leadsto -z \cdot \color{blue}{\frac{1}{\frac{-y}{y + x}}} \]
      10. un-div-inv3.0%

        \[\leadsto -\color{blue}{\frac{z}{\frac{-y}{y + x}}} \]
      11. add-sqr-sqrt3.0%

        \[\leadsto -\frac{z}{\frac{\color{blue}{\sqrt{-y} \cdot \sqrt{-y}}}{y + x}} \]
      12. sqrt-unprod3.9%

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

        \[\leadsto -\frac{z}{\frac{\sqrt{\color{blue}{y \cdot y}}}{y + x}} \]
      14. sqrt-unprod0.0%

        \[\leadsto -\frac{z}{\frac{\color{blue}{\sqrt{y} \cdot \sqrt{y}}}{y + x}} \]
      15. add-sqr-sqrt88.6%

        \[\leadsto -\frac{z}{\frac{\color{blue}{y}}{y + x}} \]
    7. Applied egg-rr88.6%

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

    if -1.0199999999999999e150 < y < -3.5999999999999998e77

    1. Initial program 89.3%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 73.3%

      \[\leadsto \color{blue}{\frac{y}{1 - \frac{y}{z}}} \]

    if -3.5999999999999998e77 < y < -5.3e-116

    1. Initial program 95.6%

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

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

    if -5.3e-116 < y < 1.2200000000000001e-57

    1. Initial program 100.0%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 87.0%

      \[\leadsto \color{blue}{x + \left(y + \frac{y \cdot \left(x + y\right)}{z}\right)} \]
    4. Step-by-step derivation
      1. associate-+r+87.0%

        \[\leadsto \color{blue}{\left(x + y\right) + \frac{y \cdot \left(x + y\right)}{z}} \]
      2. *-rgt-identity87.0%

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

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

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

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

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

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

    if 1.2200000000000001e-57 < y

    1. Initial program 82.9%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 73.1%

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

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

        \[\leadsto -\color{blue}{z \cdot \frac{x + y}{y}} \]
      3. distribute-rgt-neg-in83.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.02 \cdot 10^{+150}:\\ \;\;\;\;\frac{z}{\frac{y}{\left(-y\right) - x}}\\ \mathbf{elif}\;y \leq -3.6 \cdot 10^{+77}:\\ \;\;\;\;\frac{y}{1 - \frac{y}{z}}\\ \mathbf{elif}\;y \leq -5.3 \cdot 10^{-116}:\\ \;\;\;\;\frac{x}{1 - \frac{y}{z}}\\ \mathbf{elif}\;y \leq 1.22 \cdot 10^{-57}:\\ \;\;\;\;\left(x + y\right) \cdot \left(1 + \frac{y}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{x + y}{-y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 74.2% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 1 - \frac{y}{z}\\ t_1 := \frac{z}{\frac{y}{\left(-y\right) - x}}\\ \mathbf{if}\;y \leq -5.8 \cdot 10^{+149}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -3.7 \cdot 10^{+77}:\\ \;\;\;\;\frac{y}{t\_0}\\ \mathbf{elif}\;y \leq -1.95 \cdot 10^{-89}:\\ \;\;\;\;\frac{x}{t\_0}\\ \mathbf{elif}\;y \leq 1.7 \cdot 10^{-56}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (- 1.0 (/ y z))) (t_1 (/ z (/ y (- (- y) x)))))
   (if (<= y -5.8e+149)
     t_1
     (if (<= y -3.7e+77)
       (/ y t_0)
       (if (<= y -1.95e-89) (/ x t_0) (if (<= y 1.7e-56) (+ x y) t_1))))))
double code(double x, double y, double z) {
	double t_0 = 1.0 - (y / z);
	double t_1 = z / (y / (-y - x));
	double tmp;
	if (y <= -5.8e+149) {
		tmp = t_1;
	} else if (y <= -3.7e+77) {
		tmp = y / t_0;
	} else if (y <= -1.95e-89) {
		tmp = x / t_0;
	} else if (y <= 1.7e-56) {
		tmp = x + y;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = 1.0d0 - (y / z)
    t_1 = z / (y / (-y - x))
    if (y <= (-5.8d+149)) then
        tmp = t_1
    else if (y <= (-3.7d+77)) then
        tmp = y / t_0
    else if (y <= (-1.95d-89)) then
        tmp = x / t_0
    else if (y <= 1.7d-56) then
        tmp = x + y
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = 1.0 - (y / z);
	double t_1 = z / (y / (-y - x));
	double tmp;
	if (y <= -5.8e+149) {
		tmp = t_1;
	} else if (y <= -3.7e+77) {
		tmp = y / t_0;
	} else if (y <= -1.95e-89) {
		tmp = x / t_0;
	} else if (y <= 1.7e-56) {
		tmp = x + y;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = 1.0 - (y / z)
	t_1 = z / (y / (-y - x))
	tmp = 0
	if y <= -5.8e+149:
		tmp = t_1
	elif y <= -3.7e+77:
		tmp = y / t_0
	elif y <= -1.95e-89:
		tmp = x / t_0
	elif y <= 1.7e-56:
		tmp = x + y
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(1.0 - Float64(y / z))
	t_1 = Float64(z / Float64(y / Float64(Float64(-y) - x)))
	tmp = 0.0
	if (y <= -5.8e+149)
		tmp = t_1;
	elseif (y <= -3.7e+77)
		tmp = Float64(y / t_0);
	elseif (y <= -1.95e-89)
		tmp = Float64(x / t_0);
	elseif (y <= 1.7e-56)
		tmp = Float64(x + y);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = 1.0 - (y / z);
	t_1 = z / (y / (-y - x));
	tmp = 0.0;
	if (y <= -5.8e+149)
		tmp = t_1;
	elseif (y <= -3.7e+77)
		tmp = y / t_0;
	elseif (y <= -1.95e-89)
		tmp = x / t_0;
	elseif (y <= 1.7e-56)
		tmp = x + y;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(z / N[(y / N[((-y) - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.8e+149], t$95$1, If[LessEqual[y, -3.7e+77], N[(y / t$95$0), $MachinePrecision], If[LessEqual[y, -1.95e-89], N[(x / t$95$0), $MachinePrecision], If[LessEqual[y, 1.7e-56], N[(x + y), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 1 - \frac{y}{z}\\
t_1 := \frac{z}{\frac{y}{\left(-y\right) - x}}\\
\mathbf{if}\;y \leq -5.8 \cdot 10^{+149}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -3.7 \cdot 10^{+77}:\\
\;\;\;\;\frac{y}{t\_0}\\

\mathbf{elif}\;y \leq -1.95 \cdot 10^{-89}:\\
\;\;\;\;\frac{x}{t\_0}\\

\mathbf{elif}\;y \leq 1.7 \cdot 10^{-56}:\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -5.8000000000000004e149 or 1.69999999999999991e-56 < y

    1. Initial program 76.6%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 72.8%

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

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

        \[\leadsto -\color{blue}{z \cdot \frac{x + y}{y}} \]
      3. distribute-rgt-neg-in84.7%

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

        \[\leadsto z \cdot \color{blue}{\frac{x + y}{-y}} \]
      5. +-commutative84.7%

        \[\leadsto z \cdot \frac{\color{blue}{y + x}}{-y} \]
    5. Simplified84.7%

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{z \cdot \frac{y + x}{-y}} \]
      9. clear-num2.7%

        \[\leadsto -z \cdot \color{blue}{\frac{1}{\frac{-y}{y + x}}} \]
      10. un-div-inv2.7%

        \[\leadsto -\color{blue}{\frac{z}{\frac{-y}{y + x}}} \]
      11. add-sqr-sqrt0.9%

        \[\leadsto -\frac{z}{\frac{\color{blue}{\sqrt{-y} \cdot \sqrt{-y}}}{y + x}} \]
      12. sqrt-unprod34.9%

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

        \[\leadsto -\frac{z}{\frac{\sqrt{\color{blue}{y \cdot y}}}{y + x}} \]
      14. sqrt-unprod56.5%

        \[\leadsto -\frac{z}{\frac{\color{blue}{\sqrt{y} \cdot \sqrt{y}}}{y + x}} \]
      15. add-sqr-sqrt84.7%

        \[\leadsto -\frac{z}{\frac{\color{blue}{y}}{y + x}} \]
    7. Applied egg-rr84.7%

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

    if -5.8000000000000004e149 < y < -3.69999999999999995e77

    1. Initial program 89.3%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 73.3%

      \[\leadsto \color{blue}{\frac{y}{1 - \frac{y}{z}}} \]

    if -3.69999999999999995e77 < y < -1.94999999999999989e-89

    1. Initial program 94.1%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 82.0%

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

    if -1.94999999999999989e-89 < y < 1.69999999999999991e-56

    1. Initial program 99.9%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 85.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.8 \cdot 10^{+149}:\\ \;\;\;\;\frac{z}{\frac{y}{\left(-y\right) - x}}\\ \mathbf{elif}\;y \leq -3.7 \cdot 10^{+77}:\\ \;\;\;\;\frac{y}{1 - \frac{y}{z}}\\ \mathbf{elif}\;y \leq -1.95 \cdot 10^{-89}:\\ \;\;\;\;\frac{x}{1 - \frac{y}{z}}\\ \mathbf{elif}\;y \leq 1.7 \cdot 10^{-56}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{\frac{y}{\left(-y\right) - x}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 74.1% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 1 - \frac{y}{z}\\ \mathbf{if}\;y \leq -1.75 \cdot 10^{+150}:\\ \;\;\;\;\frac{z}{\frac{y}{\left(-y\right) - x}}\\ \mathbf{elif}\;y \leq -7.3 \cdot 10^{+77}:\\ \;\;\;\;\frac{y}{t\_0}\\ \mathbf{elif}\;y \leq -5 \cdot 10^{-92}:\\ \;\;\;\;\frac{x}{t\_0}\\ \mathbf{elif}\;y \leq 3.8 \cdot 10^{-59}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{x + y}{-y}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (- 1.0 (/ y z))))
   (if (<= y -1.75e+150)
     (/ z (/ y (- (- y) x)))
     (if (<= y -7.3e+77)
       (/ y t_0)
       (if (<= y -5e-92)
         (/ x t_0)
         (if (<= y 3.8e-59) (+ x y) (* z (/ (+ x y) (- y)))))))))
double code(double x, double y, double z) {
	double t_0 = 1.0 - (y / z);
	double tmp;
	if (y <= -1.75e+150) {
		tmp = z / (y / (-y - x));
	} else if (y <= -7.3e+77) {
		tmp = y / t_0;
	} else if (y <= -5e-92) {
		tmp = x / t_0;
	} else if (y <= 3.8e-59) {
		tmp = x + y;
	} else {
		tmp = z * ((x + y) / -y);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = 1.0d0 - (y / z)
    if (y <= (-1.75d+150)) then
        tmp = z / (y / (-y - x))
    else if (y <= (-7.3d+77)) then
        tmp = y / t_0
    else if (y <= (-5d-92)) then
        tmp = x / t_0
    else if (y <= 3.8d-59) then
        tmp = x + y
    else
        tmp = z * ((x + y) / -y)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = 1.0 - (y / z);
	double tmp;
	if (y <= -1.75e+150) {
		tmp = z / (y / (-y - x));
	} else if (y <= -7.3e+77) {
		tmp = y / t_0;
	} else if (y <= -5e-92) {
		tmp = x / t_0;
	} else if (y <= 3.8e-59) {
		tmp = x + y;
	} else {
		tmp = z * ((x + y) / -y);
	}
	return tmp;
}
def code(x, y, z):
	t_0 = 1.0 - (y / z)
	tmp = 0
	if y <= -1.75e+150:
		tmp = z / (y / (-y - x))
	elif y <= -7.3e+77:
		tmp = y / t_0
	elif y <= -5e-92:
		tmp = x / t_0
	elif y <= 3.8e-59:
		tmp = x + y
	else:
		tmp = z * ((x + y) / -y)
	return tmp
function code(x, y, z)
	t_0 = Float64(1.0 - Float64(y / z))
	tmp = 0.0
	if (y <= -1.75e+150)
		tmp = Float64(z / Float64(y / Float64(Float64(-y) - x)));
	elseif (y <= -7.3e+77)
		tmp = Float64(y / t_0);
	elseif (y <= -5e-92)
		tmp = Float64(x / t_0);
	elseif (y <= 3.8e-59)
		tmp = Float64(x + y);
	else
		tmp = Float64(z * Float64(Float64(x + y) / Float64(-y)));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = 1.0 - (y / z);
	tmp = 0.0;
	if (y <= -1.75e+150)
		tmp = z / (y / (-y - x));
	elseif (y <= -7.3e+77)
		tmp = y / t_0;
	elseif (y <= -5e-92)
		tmp = x / t_0;
	elseif (y <= 3.8e-59)
		tmp = x + y;
	else
		tmp = z * ((x + y) / -y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.75e+150], N[(z / N[(y / N[((-y) - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -7.3e+77], N[(y / t$95$0), $MachinePrecision], If[LessEqual[y, -5e-92], N[(x / t$95$0), $MachinePrecision], If[LessEqual[y, 3.8e-59], N[(x + y), $MachinePrecision], N[(z * N[(N[(x + y), $MachinePrecision] / (-y)), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 1 - \frac{y}{z}\\
\mathbf{if}\;y \leq -1.75 \cdot 10^{+150}:\\
\;\;\;\;\frac{z}{\frac{y}{\left(-y\right) - x}}\\

\mathbf{elif}\;y \leq -7.3 \cdot 10^{+77}:\\
\;\;\;\;\frac{y}{t\_0}\\

\mathbf{elif}\;y \leq -5 \cdot 10^{-92}:\\
\;\;\;\;\frac{x}{t\_0}\\

\mathbf{elif}\;y \leq 3.8 \cdot 10^{-59}:\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -1.74999999999999992e150

    1. Initial program 62.8%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 71.9%

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

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

        \[\leadsto -\color{blue}{z \cdot \frac{x + y}{y}} \]
      3. distribute-rgt-neg-in88.6%

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

        \[\leadsto z \cdot \color{blue}{\frac{x + y}{-y}} \]
      5. +-commutative88.6%

        \[\leadsto z \cdot \frac{\color{blue}{y + x}}{-y} \]
    5. Simplified88.6%

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

        \[\leadsto \color{blue}{\frac{z \cdot \left(y + x\right)}{-y}} \]
      2. distribute-frac-neg271.9%

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

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

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

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

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

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

        \[\leadsto -\color{blue}{z \cdot \frac{y + x}{-y}} \]
      9. clear-num3.0%

        \[\leadsto -z \cdot \color{blue}{\frac{1}{\frac{-y}{y + x}}} \]
      10. un-div-inv3.0%

        \[\leadsto -\color{blue}{\frac{z}{\frac{-y}{y + x}}} \]
      11. add-sqr-sqrt3.0%

        \[\leadsto -\frac{z}{\frac{\color{blue}{\sqrt{-y} \cdot \sqrt{-y}}}{y + x}} \]
      12. sqrt-unprod3.9%

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

        \[\leadsto -\frac{z}{\frac{\sqrt{\color{blue}{y \cdot y}}}{y + x}} \]
      14. sqrt-unprod0.0%

        \[\leadsto -\frac{z}{\frac{\color{blue}{\sqrt{y} \cdot \sqrt{y}}}{y + x}} \]
      15. add-sqr-sqrt88.6%

        \[\leadsto -\frac{z}{\frac{\color{blue}{y}}{y + x}} \]
    7. Applied egg-rr88.6%

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

    if -1.74999999999999992e150 < y < -7.30000000000000025e77

    1. Initial program 89.3%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 73.3%

      \[\leadsto \color{blue}{\frac{y}{1 - \frac{y}{z}}} \]

    if -7.30000000000000025e77 < y < -5.00000000000000011e-92

    1. Initial program 94.1%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 82.0%

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

    if -5.00000000000000011e-92 < y < 3.79999999999999983e-59

    1. Initial program 99.9%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 85.6%

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

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

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

    if 3.79999999999999983e-59 < y

    1. Initial program 82.9%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 73.1%

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

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

        \[\leadsto -\color{blue}{z \cdot \frac{x + y}{y}} \]
      3. distribute-rgt-neg-in83.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.75 \cdot 10^{+150}:\\ \;\;\;\;\frac{z}{\frac{y}{\left(-y\right) - x}}\\ \mathbf{elif}\;y \leq -7.3 \cdot 10^{+77}:\\ \;\;\;\;\frac{y}{1 - \frac{y}{z}}\\ \mathbf{elif}\;y \leq -5 \cdot 10^{-92}:\\ \;\;\;\;\frac{x}{1 - \frac{y}{z}}\\ \mathbf{elif}\;y \leq 3.8 \cdot 10^{-59}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{x + y}{-y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 68.3% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -4.2 \cdot 10^{+152}:\\ \;\;\;\;-z\\ \mathbf{elif}\;y \leq 0.19:\\ \;\;\;\;x + y\\ \mathbf{elif}\;y \leq 1.7 \cdot 10^{+35}:\\ \;\;\;\;\frac{z}{\frac{y}{-x}}\\ \mathbf{elif}\;y \leq 3.35 \cdot 10^{+44}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= y -4.2e+152)
   (- z)
   (if (<= y 0.19)
     (+ x y)
     (if (<= y 1.7e+35)
       (/ z (/ y (- x)))
       (if (<= y 3.35e+44) (+ x y) (- z))))))
double code(double x, double y, double z) {
	double tmp;
	if (y <= -4.2e+152) {
		tmp = -z;
	} else if (y <= 0.19) {
		tmp = x + y;
	} else if (y <= 1.7e+35) {
		tmp = z / (y / -x);
	} else if (y <= 3.35e+44) {
		tmp = x + y;
	} else {
		tmp = -z;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (y <= (-4.2d+152)) then
        tmp = -z
    else if (y <= 0.19d0) then
        tmp = x + y
    else if (y <= 1.7d+35) then
        tmp = z / (y / -x)
    else if (y <= 3.35d+44) then
        tmp = x + y
    else
        tmp = -z
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (y <= -4.2e+152) {
		tmp = -z;
	} else if (y <= 0.19) {
		tmp = x + y;
	} else if (y <= 1.7e+35) {
		tmp = z / (y / -x);
	} else if (y <= 3.35e+44) {
		tmp = x + y;
	} else {
		tmp = -z;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if y <= -4.2e+152:
		tmp = -z
	elif y <= 0.19:
		tmp = x + y
	elif y <= 1.7e+35:
		tmp = z / (y / -x)
	elif y <= 3.35e+44:
		tmp = x + y
	else:
		tmp = -z
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (y <= -4.2e+152)
		tmp = Float64(-z);
	elseif (y <= 0.19)
		tmp = Float64(x + y);
	elseif (y <= 1.7e+35)
		tmp = Float64(z / Float64(y / Float64(-x)));
	elseif (y <= 3.35e+44)
		tmp = Float64(x + y);
	else
		tmp = Float64(-z);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (y <= -4.2e+152)
		tmp = -z;
	elseif (y <= 0.19)
		tmp = x + y;
	elseif (y <= 1.7e+35)
		tmp = z / (y / -x);
	elseif (y <= 3.35e+44)
		tmp = x + y;
	else
		tmp = -z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[y, -4.2e+152], (-z), If[LessEqual[y, 0.19], N[(x + y), $MachinePrecision], If[LessEqual[y, 1.7e+35], N[(z / N[(y / (-x)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.35e+44], N[(x + y), $MachinePrecision], (-z)]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.2 \cdot 10^{+152}:\\
\;\;\;\;-z\\

\mathbf{elif}\;y \leq 0.19:\\
\;\;\;\;x + y\\

\mathbf{elif}\;y \leq 1.7 \cdot 10^{+35}:\\
\;\;\;\;\frac{z}{\frac{y}{-x}}\\

\mathbf{elif}\;y \leq 3.35 \cdot 10^{+44}:\\
\;\;\;\;x + y\\

\mathbf{else}:\\
\;\;\;\;-z\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -4.2000000000000003e152 or 3.35000000000000018e44 < y

    1. Initial program 71.4%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 76.8%

      \[\leadsto \color{blue}{-1 \cdot z} \]
    4. Step-by-step derivation
      1. mul-1-neg76.8%

        \[\leadsto \color{blue}{-z} \]
    5. Simplified76.8%

      \[\leadsto \color{blue}{-z} \]

    if -4.2000000000000003e152 < y < 0.19 or 1.7000000000000001e35 < y < 3.35000000000000018e44

    1. Initial program 98.0%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    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 0.19 < y < 1.7000000000000001e35

    1. Initial program 99.6%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 93.0%

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

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

        \[\leadsto -\color{blue}{z \cdot \frac{x + y}{y}} \]
      3. distribute-rgt-neg-in92.8%

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

        \[\leadsto z \cdot \color{blue}{\frac{x + y}{-y}} \]
      5. +-commutative92.8%

        \[\leadsto z \cdot \frac{\color{blue}{y + x}}{-y} \]
    5. Simplified92.8%

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

        \[\leadsto \color{blue}{\frac{z \cdot \left(y + x\right)}{-y}} \]
      2. distribute-frac-neg293.0%

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

        \[\leadsto -\frac{z \cdot \left(y + x\right)}{\color{blue}{\sqrt{y} \cdot \sqrt{y}}} \]
      4. sqrt-unprod93.0%

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

        \[\leadsto -\frac{z \cdot \left(y + x\right)}{\sqrt{\color{blue}{\left(-y\right) \cdot \left(-y\right)}}} \]
      6. sqrt-unprod0.0%

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

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

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

        \[\leadsto -z \cdot \color{blue}{\frac{1}{\frac{-y}{y + x}}} \]
      10. un-div-inv1.4%

        \[\leadsto -\color{blue}{\frac{z}{\frac{-y}{y + x}}} \]
      11. add-sqr-sqrt0.0%

        \[\leadsto -\frac{z}{\frac{\color{blue}{\sqrt{-y} \cdot \sqrt{-y}}}{y + x}} \]
      12. sqrt-unprod93.2%

        \[\leadsto -\frac{z}{\frac{\color{blue}{\sqrt{\left(-y\right) \cdot \left(-y\right)}}}{y + x}} \]
      13. sqr-neg93.2%

        \[\leadsto -\frac{z}{\frac{\sqrt{\color{blue}{y \cdot y}}}{y + x}} \]
      14. sqrt-unprod92.4%

        \[\leadsto -\frac{z}{\frac{\color{blue}{\sqrt{y} \cdot \sqrt{y}}}{y + x}} \]
      15. add-sqr-sqrt93.2%

        \[\leadsto -\frac{z}{\frac{\color{blue}{y}}{y + x}} \]
    7. Applied egg-rr93.2%

      \[\leadsto \color{blue}{-\frac{z}{\frac{y}{y + x}}} \]
    8. Taylor expanded in y around 0 65.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.2 \cdot 10^{+152}:\\ \;\;\;\;-z\\ \mathbf{elif}\;y \leq 0.19:\\ \;\;\;\;x + y\\ \mathbf{elif}\;y \leq 1.7 \cdot 10^{+35}:\\ \;\;\;\;\frac{z}{\frac{y}{-x}}\\ \mathbf{elif}\;y \leq 3.35 \cdot 10^{+44}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 68.2% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -4.1 \cdot 10^{+152}:\\ \;\;\;\;-z\\ \mathbf{elif}\;y \leq 0.0035:\\ \;\;\;\;x + y\\ \mathbf{elif}\;y \leq 4 \cdot 10^{+35}:\\ \;\;\;\;x \cdot \frac{z}{-y}\\ \mathbf{elif}\;y \leq 1.7 \cdot 10^{+46}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= y -4.1e+152)
   (- z)
   (if (<= y 0.0035)
     (+ x y)
     (if (<= y 4e+35) (* x (/ z (- y))) (if (<= y 1.7e+46) (+ x y) (- z))))))
double code(double x, double y, double z) {
	double tmp;
	if (y <= -4.1e+152) {
		tmp = -z;
	} else if (y <= 0.0035) {
		tmp = x + y;
	} else if (y <= 4e+35) {
		tmp = x * (z / -y);
	} else if (y <= 1.7e+46) {
		tmp = x + y;
	} else {
		tmp = -z;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (y <= (-4.1d+152)) then
        tmp = -z
    else if (y <= 0.0035d0) then
        tmp = x + y
    else if (y <= 4d+35) then
        tmp = x * (z / -y)
    else if (y <= 1.7d+46) then
        tmp = x + y
    else
        tmp = -z
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (y <= -4.1e+152) {
		tmp = -z;
	} else if (y <= 0.0035) {
		tmp = x + y;
	} else if (y <= 4e+35) {
		tmp = x * (z / -y);
	} else if (y <= 1.7e+46) {
		tmp = x + y;
	} else {
		tmp = -z;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if y <= -4.1e+152:
		tmp = -z
	elif y <= 0.0035:
		tmp = x + y
	elif y <= 4e+35:
		tmp = x * (z / -y)
	elif y <= 1.7e+46:
		tmp = x + y
	else:
		tmp = -z
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (y <= -4.1e+152)
		tmp = Float64(-z);
	elseif (y <= 0.0035)
		tmp = Float64(x + y);
	elseif (y <= 4e+35)
		tmp = Float64(x * Float64(z / Float64(-y)));
	elseif (y <= 1.7e+46)
		tmp = Float64(x + y);
	else
		tmp = Float64(-z);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (y <= -4.1e+152)
		tmp = -z;
	elseif (y <= 0.0035)
		tmp = x + y;
	elseif (y <= 4e+35)
		tmp = x * (z / -y);
	elseif (y <= 1.7e+46)
		tmp = x + y;
	else
		tmp = -z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[y, -4.1e+152], (-z), If[LessEqual[y, 0.0035], N[(x + y), $MachinePrecision], If[LessEqual[y, 4e+35], N[(x * N[(z / (-y)), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.7e+46], N[(x + y), $MachinePrecision], (-z)]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.1 \cdot 10^{+152}:\\
\;\;\;\;-z\\

\mathbf{elif}\;y \leq 0.0035:\\
\;\;\;\;x + y\\

\mathbf{elif}\;y \leq 4 \cdot 10^{+35}:\\
\;\;\;\;x \cdot \frac{z}{-y}\\

\mathbf{elif}\;y \leq 1.7 \cdot 10^{+46}:\\
\;\;\;\;x + y\\

\mathbf{else}:\\
\;\;\;\;-z\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -4.0999999999999998e152 or 1.6999999999999999e46 < y

    1. Initial program 71.4%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 76.8%

      \[\leadsto \color{blue}{-1 \cdot z} \]
    4. Step-by-step derivation
      1. mul-1-neg76.8%

        \[\leadsto \color{blue}{-z} \]
    5. Simplified76.8%

      \[\leadsto \color{blue}{-z} \]

    if -4.0999999999999998e152 < y < 0.00350000000000000007 or 3.9999999999999999e35 < y < 1.6999999999999999e46

    1. Initial program 98.0%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    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 0.00350000000000000007 < y < 3.9999999999999999e35

    1. Initial program 99.6%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in z around 0 93.0%

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

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

        \[\leadsto -\color{blue}{z \cdot \frac{x + y}{y}} \]
      3. distribute-rgt-neg-in92.8%

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

        \[\leadsto z \cdot \color{blue}{\frac{x + y}{-y}} \]
      5. +-commutative92.8%

        \[\leadsto z \cdot \frac{\color{blue}{y + x}}{-y} \]
    5. Simplified92.8%

      \[\leadsto \color{blue}{z \cdot \frac{y + x}{-y}} \]
    6. Taylor expanded in y around 0 65.4%

      \[\leadsto z \cdot \color{blue}{\left(-1 \cdot \frac{x}{y}\right)} \]
    7. Step-by-step derivation
      1. associate-*r/65.4%

        \[\leadsto z \cdot \color{blue}{\frac{-1 \cdot x}{y}} \]
      2. neg-mul-165.4%

        \[\leadsto z \cdot \frac{\color{blue}{-x}}{y} \]
    8. Simplified65.4%

      \[\leadsto z \cdot \color{blue}{\frac{-x}{y}} \]
    9. Taylor expanded in z around 0 65.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot z}{y}} \]
    10. Step-by-step derivation
      1. mul-1-neg65.6%

        \[\leadsto \color{blue}{-\frac{x \cdot z}{y}} \]
      2. associate-*r/66.1%

        \[\leadsto -\color{blue}{x \cdot \frac{z}{y}} \]
      3. distribute-rgt-neg-in66.1%

        \[\leadsto \color{blue}{x \cdot \left(-\frac{z}{y}\right)} \]
      4. distribute-frac-neg266.1%

        \[\leadsto x \cdot \color{blue}{\frac{z}{-y}} \]
    11. Simplified66.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.1 \cdot 10^{+152}:\\ \;\;\;\;-z\\ \mathbf{elif}\;y \leq 0.0035:\\ \;\;\;\;x + y\\ \mathbf{elif}\;y \leq 4 \cdot 10^{+35}:\\ \;\;\;\;x \cdot \frac{z}{-y}\\ \mathbf{elif}\;y \leq 1.7 \cdot 10^{+46}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 59.2% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.9 \cdot 10^{+130}:\\ \;\;\;\;-z\\ \mathbf{elif}\;y \leq -1.95 \cdot 10^{+101}:\\ \;\;\;\;y\\ \mathbf{elif}\;y \leq -3.6 \cdot 10^{+77} \lor \neg \left(y \leq 2.02 \cdot 10^{-10}\right):\\ \;\;\;\;-z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= y -1.9e+130)
   (- z)
   (if (<= y -1.95e+101)
     y
     (if (or (<= y -3.6e+77) (not (<= y 2.02e-10))) (- z) x))))
double code(double x, double y, double z) {
	double tmp;
	if (y <= -1.9e+130) {
		tmp = -z;
	} else if (y <= -1.95e+101) {
		tmp = y;
	} else if ((y <= -3.6e+77) || !(y <= 2.02e-10)) {
		tmp = -z;
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (y <= (-1.9d+130)) then
        tmp = -z
    else if (y <= (-1.95d+101)) then
        tmp = y
    else if ((y <= (-3.6d+77)) .or. (.not. (y <= 2.02d-10))) then
        tmp = -z
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (y <= -1.9e+130) {
		tmp = -z;
	} else if (y <= -1.95e+101) {
		tmp = y;
	} else if ((y <= -3.6e+77) || !(y <= 2.02e-10)) {
		tmp = -z;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if y <= -1.9e+130:
		tmp = -z
	elif y <= -1.95e+101:
		tmp = y
	elif (y <= -3.6e+77) or not (y <= 2.02e-10):
		tmp = -z
	else:
		tmp = x
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (y <= -1.9e+130)
		tmp = Float64(-z);
	elseif (y <= -1.95e+101)
		tmp = y;
	elseif ((y <= -3.6e+77) || !(y <= 2.02e-10))
		tmp = Float64(-z);
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (y <= -1.9e+130)
		tmp = -z;
	elseif (y <= -1.95e+101)
		tmp = y;
	elseif ((y <= -3.6e+77) || ~((y <= 2.02e-10)))
		tmp = -z;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[y, -1.9e+130], (-z), If[LessEqual[y, -1.95e+101], y, If[Or[LessEqual[y, -3.6e+77], N[Not[LessEqual[y, 2.02e-10]], $MachinePrecision]], (-z), x]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.9 \cdot 10^{+130}:\\
\;\;\;\;-z\\

\mathbf{elif}\;y \leq -1.95 \cdot 10^{+101}:\\
\;\;\;\;y\\

\mathbf{elif}\;y \leq -3.6 \cdot 10^{+77} \lor \neg \left(y \leq 2.02 \cdot 10^{-10}\right):\\
\;\;\;\;-z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.9000000000000001e130 or -1.95e101 < y < -3.5999999999999998e77 or 2.02e-10 < y

    1. Initial program 76.0%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 70.1%

      \[\leadsto \color{blue}{-1 \cdot z} \]
    4. Step-by-step derivation
      1. mul-1-neg70.1%

        \[\leadsto \color{blue}{-z} \]
    5. Simplified70.1%

      \[\leadsto \color{blue}{-z} \]

    if -1.9000000000000001e130 < y < -1.95e101

    1. Initial program 88.2%

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

      \[\leadsto \color{blue}{\frac{y}{1 - \frac{y}{z}}} \]
    4. Taylor expanded in y around 0 64.3%

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

    if -3.5999999999999998e77 < y < 2.02e-10

    1. Initial program 99.2%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 65.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.9 \cdot 10^{+130}:\\ \;\;\;\;-z\\ \mathbf{elif}\;y \leq -1.95 \cdot 10^{+101}:\\ \;\;\;\;y\\ \mathbf{elif}\;y \leq -3.6 \cdot 10^{+77} \lor \neg \left(y \leq 2.02 \cdot 10^{-10}\right):\\ \;\;\;\;-z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 69.8% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 1 - \frac{y}{z}\\ \mathbf{if}\;y \leq -3.35 \cdot 10^{+159}:\\ \;\;\;\;-z\\ \mathbf{elif}\;y \leq -3.6 \cdot 10^{+77}:\\ \;\;\;\;\frac{y}{t\_0}\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{+41}:\\ \;\;\;\;\frac{x}{t\_0}\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (- 1.0 (/ y z))))
   (if (<= y -3.35e+159)
     (- z)
     (if (<= y -3.6e+77) (/ y t_0) (if (<= y 1.35e+41) (/ x t_0) (- z))))))
double code(double x, double y, double z) {
	double t_0 = 1.0 - (y / z);
	double tmp;
	if (y <= -3.35e+159) {
		tmp = -z;
	} else if (y <= -3.6e+77) {
		tmp = y / t_0;
	} else if (y <= 1.35e+41) {
		tmp = x / t_0;
	} else {
		tmp = -z;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = 1.0d0 - (y / z)
    if (y <= (-3.35d+159)) then
        tmp = -z
    else if (y <= (-3.6d+77)) then
        tmp = y / t_0
    else if (y <= 1.35d+41) then
        tmp = x / t_0
    else
        tmp = -z
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = 1.0 - (y / z);
	double tmp;
	if (y <= -3.35e+159) {
		tmp = -z;
	} else if (y <= -3.6e+77) {
		tmp = y / t_0;
	} else if (y <= 1.35e+41) {
		tmp = x / t_0;
	} else {
		tmp = -z;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = 1.0 - (y / z)
	tmp = 0
	if y <= -3.35e+159:
		tmp = -z
	elif y <= -3.6e+77:
		tmp = y / t_0
	elif y <= 1.35e+41:
		tmp = x / t_0
	else:
		tmp = -z
	return tmp
function code(x, y, z)
	t_0 = Float64(1.0 - Float64(y / z))
	tmp = 0.0
	if (y <= -3.35e+159)
		tmp = Float64(-z);
	elseif (y <= -3.6e+77)
		tmp = Float64(y / t_0);
	elseif (y <= 1.35e+41)
		tmp = Float64(x / t_0);
	else
		tmp = Float64(-z);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = 1.0 - (y / z);
	tmp = 0.0;
	if (y <= -3.35e+159)
		tmp = -z;
	elseif (y <= -3.6e+77)
		tmp = y / t_0;
	elseif (y <= 1.35e+41)
		tmp = x / t_0;
	else
		tmp = -z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.35e+159], (-z), If[LessEqual[y, -3.6e+77], N[(y / t$95$0), $MachinePrecision], If[LessEqual[y, 1.35e+41], N[(x / t$95$0), $MachinePrecision], (-z)]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 1 - \frac{y}{z}\\
\mathbf{if}\;y \leq -3.35 \cdot 10^{+159}:\\
\;\;\;\;-z\\

\mathbf{elif}\;y \leq -3.6 \cdot 10^{+77}:\\
\;\;\;\;\frac{y}{t\_0}\\

\mathbf{elif}\;y \leq 1.35 \cdot 10^{+41}:\\
\;\;\;\;\frac{x}{t\_0}\\

\mathbf{else}:\\
\;\;\;\;-z\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.35000000000000009e159 or 1.35e41 < y

    1. Initial program 71.1%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 76.6%

      \[\leadsto \color{blue}{-1 \cdot z} \]
    4. Step-by-step derivation
      1. mul-1-neg76.6%

        \[\leadsto \color{blue}{-z} \]
    5. Simplified76.6%

      \[\leadsto \color{blue}{-z} \]

    if -3.35000000000000009e159 < y < -3.5999999999999998e77

    1. Initial program 90.8%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 72.4%

      \[\leadsto \color{blue}{\frac{y}{1 - \frac{y}{z}}} \]

    if -3.5999999999999998e77 < y < 1.35e41

    1. Initial program 99.2%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf 78.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.35 \cdot 10^{+159}:\\ \;\;\;\;-z\\ \mathbf{elif}\;y \leq -3.6 \cdot 10^{+77}:\\ \;\;\;\;\frac{y}{1 - \frac{y}{z}}\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{+41}:\\ \;\;\;\;\frac{x}{1 - \frac{y}{z}}\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 68.9% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.1 \cdot 10^{+152} \lor \neg \left(y \leq 1.66 \cdot 10^{+28}\right):\\
\;\;\;\;-z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.0999999999999998e152 or 1.6599999999999999e28 < y

    1. Initial program 73.0%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 74.5%

      \[\leadsto \color{blue}{-1 \cdot z} \]
    4. Step-by-step derivation
      1. mul-1-neg74.5%

        \[\leadsto \color{blue}{-z} \]
    5. Simplified74.5%

      \[\leadsto \color{blue}{-z} \]

    if -4.0999999999999998e152 < y < 1.6599999999999999e28

    1. Initial program 98.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.1 \cdot 10^{+152} \lor \neg \left(y \leq 1.66 \cdot 10^{+28}\right):\\ \;\;\;\;-z\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 41.2% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -4.2 \cdot 10^{-200}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 1.9 \cdot 10^{-160}:\\ \;\;\;\;y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x -4.2e-200) x (if (<= x 1.9e-160) y x)))
double code(double x, double y, double z) {
	double tmp;
	if (x <= -4.2e-200) {
		tmp = x;
	} else if (x <= 1.9e-160) {
		tmp = y;
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (x <= (-4.2d-200)) then
        tmp = x
    else if (x <= 1.9d-160) then
        tmp = y
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (x <= -4.2e-200) {
		tmp = x;
	} else if (x <= 1.9e-160) {
		tmp = y;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= -4.2e-200:
		tmp = x
	elif x <= 1.9e-160:
		tmp = y
	else:
		tmp = x
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= -4.2e-200)
		tmp = x;
	elseif (x <= 1.9e-160)
		tmp = y;
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= -4.2e-200)
		tmp = x;
	elseif (x <= 1.9e-160)
		tmp = y;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, -4.2e-200], x, If[LessEqual[x, 1.9e-160], y, x]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.2 \cdot 10^{-200}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq 1.9 \cdot 10^{-160}:\\
\;\;\;\;y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.1999999999999998e-200 or 1.8999999999999999e-160 < x

    1. Initial program 87.5%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 42.7%

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

    if -4.1999999999999998e-200 < x < 1.8999999999999999e-160

    1. Initial program 88.8%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 79.4%

      \[\leadsto \color{blue}{\frac{y}{1 - \frac{y}{z}}} \]
    4. Taylor expanded in y around 0 41.7%

      \[\leadsto \color{blue}{y} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification42.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.2 \cdot 10^{-200}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 1.9 \cdot 10^{-160}:\\ \;\;\;\;y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 35.5% accurate, 9.0× speedup?

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

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

    \[\frac{x + y}{1 - \frac{y}{z}} \]
  2. Add Preprocessing
  3. Taylor expanded in y around 0 35.8%

    \[\leadsto \color{blue}{x} \]
  4. Final simplification35.8%

    \[\leadsto x \]
  5. Add Preprocessing

Developer target: 93.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{y + x}{-y} \cdot z\\ \mathbf{if}\;y < -3.7429310762689856 \cdot 10^{+171}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y < 3.5534662456086734 \cdot 10^{+168}:\\ \;\;\;\;\frac{x + y}{1 - \frac{y}{z}}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* (/ (+ y x) (- y)) z)))
   (if (< y -3.7429310762689856e+171)
     t_0
     (if (< y 3.5534662456086734e+168) (/ (+ x y) (- 1.0 (/ y z))) t_0))))
double code(double x, double y, double z) {
	double t_0 = ((y + x) / -y) * z;
	double tmp;
	if (y < -3.7429310762689856e+171) {
		tmp = t_0;
	} else if (y < 3.5534662456086734e+168) {
		tmp = (x + y) / (1.0 - (y / z));
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = ((y + x) / -y) * z
    if (y < (-3.7429310762689856d+171)) then
        tmp = t_0
    else if (y < 3.5534662456086734d+168) then
        tmp = (x + y) / (1.0d0 - (y / z))
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = ((y + x) / -y) * z;
	double tmp;
	if (y < -3.7429310762689856e+171) {
		tmp = t_0;
	} else if (y < 3.5534662456086734e+168) {
		tmp = (x + y) / (1.0 - (y / z));
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = ((y + x) / -y) * z
	tmp = 0
	if y < -3.7429310762689856e+171:
		tmp = t_0
	elif y < 3.5534662456086734e+168:
		tmp = (x + y) / (1.0 - (y / z))
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(Float64(Float64(y + x) / Float64(-y)) * z)
	tmp = 0.0
	if (y < -3.7429310762689856e+171)
		tmp = t_0;
	elseif (y < 3.5534662456086734e+168)
		tmp = Float64(Float64(x + y) / Float64(1.0 - Float64(y / z)));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = ((y + x) / -y) * z;
	tmp = 0.0;
	if (y < -3.7429310762689856e+171)
		tmp = t_0;
	elseif (y < 3.5534662456086734e+168)
		tmp = (x + y) / (1.0 - (y / z));
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[(y + x), $MachinePrecision] / (-y)), $MachinePrecision] * z), $MachinePrecision]}, If[Less[y, -3.7429310762689856e+171], t$95$0, If[Less[y, 3.5534662456086734e+168], N[(N[(x + y), $MachinePrecision] / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{y + x}{-y} \cdot z\\
\mathbf{if}\;y < -3.7429310762689856 \cdot 10^{+171}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;y < 3.5534662456086734 \cdot 10^{+168}:\\
\;\;\;\;\frac{x + y}{1 - \frac{y}{z}}\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024059 
(FPCore (x y z)
  :name "Graphics.Rendering.Chart.Backend.Diagrams:calcFontMetrics from Chart-diagrams-1.5.1, A"
  :precision binary64

  :alt
  (if (< y -3.7429310762689856e+171) (* (/ (+ y x) (- y)) z) (if (< y 3.5534662456086734e+168) (/ (+ x y) (- 1.0 (/ y z))) (* (/ (+ y x) (- y)) z)))

  (/ (+ x y) (- 1.0 (/ y z))))