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

Percentage Accurate: 87.9% → 99.9%
Time: 7.0s
Alternatives: 13
Speedup: 0.5×

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 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: 87.9% 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.9% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -0.0025 \lor \neg \left(y \leq 120000000\right):\\ \;\;\;\;\frac{z}{\frac{z - y}{y + x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y + x}{1 - \frac{y}{z}}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= y -0.0025) (not (<= y 120000000.0)))
   (/ z (/ (- z y) (+ y x)))
   (/ (+ y x) (- 1.0 (/ y z)))))
double code(double x, double y, double z) {
	double tmp;
	if ((y <= -0.0025) || !(y <= 120000000.0)) {
		tmp = z / ((z - y) / (y + x));
	} else {
		tmp = (y + x) / (1.0 - (y / 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 <= (-0.0025d0)) .or. (.not. (y <= 120000000.0d0))) then
        tmp = z / ((z - y) / (y + x))
    else
        tmp = (y + x) / (1.0d0 - (y / z))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((y <= -0.0025) || !(y <= 120000000.0)) {
		tmp = z / ((z - y) / (y + x));
	} else {
		tmp = (y + x) / (1.0 - (y / z));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (y <= -0.0025) or not (y <= 120000000.0):
		tmp = z / ((z - y) / (y + x))
	else:
		tmp = (y + x) / (1.0 - (y / z))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((y <= -0.0025) || !(y <= 120000000.0))
		tmp = Float64(z / Float64(Float64(z - y) / Float64(y + x)));
	else
		tmp = Float64(Float64(y + x) / Float64(1.0 - Float64(y / z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((y <= -0.0025) || ~((y <= 120000000.0)))
		tmp = z / ((z - y) / (y + x));
	else
		tmp = (y + x) / (1.0 - (y / z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[y, -0.0025], N[Not[LessEqual[y, 120000000.0]], $MachinePrecision]], N[(z / N[(N[(z - y), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y + x), $MachinePrecision] / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.0025 \lor \neg \left(y \leq 120000000\right):\\
\;\;\;\;\frac{z}{\frac{z - y}{y + x}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -0.00250000000000000005 or 1.2e8 < y

    1. Initial program 78.5%

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

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

        \[\leadsto \color{blue}{\frac{x + y}{z - y} \cdot z} \]
      2. add-cube-cbrt97.7%

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

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

        \[\leadsto \left(\frac{x + y}{z - y} \cdot \color{blue}{{\left(\sqrt[3]{z}\right)}^{2}}\right) \cdot \sqrt[3]{z} \]
    5. Applied egg-rr97.6%

      \[\leadsto \color{blue}{\left(\frac{x + y}{z - y} \cdot {\left(\sqrt[3]{z}\right)}^{2}\right) \cdot \sqrt[3]{z}} \]
    6. Step-by-step derivation
      1. associate-*l*97.7%

        \[\leadsto \color{blue}{\frac{x + y}{z - y} \cdot \left({\left(\sqrt[3]{z}\right)}^{2} \cdot \sqrt[3]{z}\right)} \]
      2. clear-num97.7%

        \[\leadsto \color{blue}{\frac{1}{\frac{z - y}{x + y}}} \cdot \left({\left(\sqrt[3]{z}\right)}^{2} \cdot \sqrt[3]{z}\right) \]
      3. unpow297.7%

        \[\leadsto \frac{1}{\frac{z - y}{x + y}} \cdot \left(\color{blue}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right)} \cdot \sqrt[3]{z}\right) \]
      4. add-cube-cbrt99.8%

        \[\leadsto \frac{1}{\frac{z - y}{x + y}} \cdot \color{blue}{z} \]
      5. associate-*l/99.9%

        \[\leadsto \color{blue}{\frac{1 \cdot z}{\frac{z - y}{x + y}}} \]
      6. *-un-lft-identity99.9%

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

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

    if -0.00250000000000000005 < y < 1.2e8

    1. Initial program 99.9%

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

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

Alternative 2: 68.5% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 1 - \frac{y}{z}\\ \mathbf{if}\;y \leq -3.2 \cdot 10^{+150}:\\ \;\;\;\;-z\\ \mathbf{elif}\;y \leq -0.00016:\\ \;\;\;\;\frac{z}{\frac{z - y}{x}}\\ \mathbf{elif}\;y \leq 2.7 \cdot 10^{-41}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;y \leq 9 \cdot 10^{+34}:\\ \;\;\;\;\frac{x}{t\_0}\\ \mathbf{elif}\;y \leq 6 \cdot 10^{+138}:\\ \;\;\;\;\frac{y}{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.2e+150)
     (- z)
     (if (<= y -0.00016)
       (/ z (/ (- z y) x))
       (if (<= y 2.7e-41)
         (+ y x)
         (if (<= y 9e+34) (/ x t_0) (if (<= y 6e+138) (/ y t_0) (- z))))))))
double code(double x, double y, double z) {
	double t_0 = 1.0 - (y / z);
	double tmp;
	if (y <= -3.2e+150) {
		tmp = -z;
	} else if (y <= -0.00016) {
		tmp = z / ((z - y) / x);
	} else if (y <= 2.7e-41) {
		tmp = y + x;
	} else if (y <= 9e+34) {
		tmp = x / t_0;
	} else if (y <= 6e+138) {
		tmp = y / 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.2d+150)) then
        tmp = -z
    else if (y <= (-0.00016d0)) then
        tmp = z / ((z - y) / x)
    else if (y <= 2.7d-41) then
        tmp = y + x
    else if (y <= 9d+34) then
        tmp = x / t_0
    else if (y <= 6d+138) then
        tmp = y / 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.2e+150) {
		tmp = -z;
	} else if (y <= -0.00016) {
		tmp = z / ((z - y) / x);
	} else if (y <= 2.7e-41) {
		tmp = y + x;
	} else if (y <= 9e+34) {
		tmp = x / t_0;
	} else if (y <= 6e+138) {
		tmp = y / t_0;
	} else {
		tmp = -z;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = 1.0 - (y / z)
	tmp = 0
	if y <= -3.2e+150:
		tmp = -z
	elif y <= -0.00016:
		tmp = z / ((z - y) / x)
	elif y <= 2.7e-41:
		tmp = y + x
	elif y <= 9e+34:
		tmp = x / t_0
	elif y <= 6e+138:
		tmp = y / 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.2e+150)
		tmp = Float64(-z);
	elseif (y <= -0.00016)
		tmp = Float64(z / Float64(Float64(z - y) / x));
	elseif (y <= 2.7e-41)
		tmp = Float64(y + x);
	elseif (y <= 9e+34)
		tmp = Float64(x / t_0);
	elseif (y <= 6e+138)
		tmp = Float64(y / 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.2e+150)
		tmp = -z;
	elseif (y <= -0.00016)
		tmp = z / ((z - y) / x);
	elseif (y <= 2.7e-41)
		tmp = y + x;
	elseif (y <= 9e+34)
		tmp = x / t_0;
	elseif (y <= 6e+138)
		tmp = y / 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.2e+150], (-z), If[LessEqual[y, -0.00016], N[(z / N[(N[(z - y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.7e-41], N[(y + x), $MachinePrecision], If[LessEqual[y, 9e+34], N[(x / t$95$0), $MachinePrecision], If[LessEqual[y, 6e+138], N[(y / t$95$0), $MachinePrecision], (-z)]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -0.00016:\\
\;\;\;\;\frac{z}{\frac{z - y}{x}}\\

\mathbf{elif}\;y \leq 2.7 \cdot 10^{-41}:\\
\;\;\;\;y + x\\

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

\mathbf{elif}\;y \leq 6 \cdot 10^{+138}:\\
\;\;\;\;\frac{y}{t\_0}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -3.20000000000000016e150 or 6.0000000000000002e138 < y

    1. Initial program 64.6%

      \[\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. neg-mul-176.6%

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

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

    if -3.20000000000000016e150 < y < -1.60000000000000013e-4

    1. Initial program 86.8%

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

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

        \[\leadsto \color{blue}{\frac{x + y}{z - y} \cdot z} \]
      2. add-cube-cbrt97.7%

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

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

        \[\leadsto \left(\frac{x + y}{z - y} \cdot \color{blue}{{\left(\sqrt[3]{z}\right)}^{2}}\right) \cdot \sqrt[3]{z} \]
    5. Applied egg-rr97.7%

      \[\leadsto \color{blue}{\left(\frac{x + y}{z - y} \cdot {\left(\sqrt[3]{z}\right)}^{2}\right) \cdot \sqrt[3]{z}} \]
    6. Step-by-step derivation
      1. associate-*l*97.7%

        \[\leadsto \color{blue}{\frac{x + y}{z - y} \cdot \left({\left(\sqrt[3]{z}\right)}^{2} \cdot \sqrt[3]{z}\right)} \]
      2. clear-num97.7%

        \[\leadsto \color{blue}{\frac{1}{\frac{z - y}{x + y}}} \cdot \left({\left(\sqrt[3]{z}\right)}^{2} \cdot \sqrt[3]{z}\right) \]
      3. unpow297.7%

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

        \[\leadsto \frac{1}{\frac{z - y}{x + y}} \cdot \color{blue}{z} \]
      5. associate-*l/99.9%

        \[\leadsto \color{blue}{\frac{1 \cdot z}{\frac{z - y}{x + y}}} \]
      6. *-un-lft-identity99.9%

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

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

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

    if -1.60000000000000013e-4 < y < 2.7e-41

    1. Initial program 99.9%

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

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

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

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

    if 2.7e-41 < y < 9.0000000000000001e34

    1. Initial program 99.8%

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

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

    if 9.0000000000000001e34 < y < 6.0000000000000002e138

    1. Initial program 95.9%

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

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

Alternative 3: 72.2% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{z}{\frac{z - y}{y}}\\ \mathbf{if}\;y \leq -1 \cdot 10^{+146}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq -0.001:\\ \;\;\;\;\frac{z}{\frac{z - y}{x}}\\ \mathbf{elif}\;y \leq 2.7 \cdot 10^{-41}:\\ \;\;\;\;y + x\\ \mathbf{elif}\;y \leq 7.6 \cdot 10^{+31}:\\ \;\;\;\;\frac{x}{1 - \frac{y}{z}}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (/ z (/ (- z y) y))))
   (if (<= y -1e+146)
     t_0
     (if (<= y -0.001)
       (/ z (/ (- z y) x))
       (if (<= y 2.7e-41)
         (+ y x)
         (if (<= y 7.6e+31) (/ x (- 1.0 (/ y z))) t_0))))))
double code(double x, double y, double z) {
	double t_0 = z / ((z - y) / y);
	double tmp;
	if (y <= -1e+146) {
		tmp = t_0;
	} else if (y <= -0.001) {
		tmp = z / ((z - y) / x);
	} else if (y <= 2.7e-41) {
		tmp = y + x;
	} else if (y <= 7.6e+31) {
		tmp = x / (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 = z / ((z - y) / y)
    if (y <= (-1d+146)) then
        tmp = t_0
    else if (y <= (-0.001d0)) then
        tmp = z / ((z - y) / x)
    else if (y <= 2.7d-41) then
        tmp = y + x
    else if (y <= 7.6d+31) then
        tmp = x / (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 = z / ((z - y) / y);
	double tmp;
	if (y <= -1e+146) {
		tmp = t_0;
	} else if (y <= -0.001) {
		tmp = z / ((z - y) / x);
	} else if (y <= 2.7e-41) {
		tmp = y + x;
	} else if (y <= 7.6e+31) {
		tmp = x / (1.0 - (y / z));
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = z / ((z - y) / y)
	tmp = 0
	if y <= -1e+146:
		tmp = t_0
	elif y <= -0.001:
		tmp = z / ((z - y) / x)
	elif y <= 2.7e-41:
		tmp = y + x
	elif y <= 7.6e+31:
		tmp = x / (1.0 - (y / z))
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(z / Float64(Float64(z - y) / y))
	tmp = 0.0
	if (y <= -1e+146)
		tmp = t_0;
	elseif (y <= -0.001)
		tmp = Float64(z / Float64(Float64(z - y) / x));
	elseif (y <= 2.7e-41)
		tmp = Float64(y + x);
	elseif (y <= 7.6e+31)
		tmp = Float64(x / Float64(1.0 - Float64(y / z)));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = z / ((z - y) / y);
	tmp = 0.0;
	if (y <= -1e+146)
		tmp = t_0;
	elseif (y <= -0.001)
		tmp = z / ((z - y) / x);
	elseif (y <= 2.7e-41)
		tmp = y + x;
	elseif (y <= 7.6e+31)
		tmp = x / (1.0 - (y / z));
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(z / N[(N[(z - y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1e+146], t$95$0, If[LessEqual[y, -0.001], N[(z / N[(N[(z - y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.7e-41], N[(y + x), $MachinePrecision], If[LessEqual[y, 7.6e+31], N[(x / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -0.001:\\
\;\;\;\;\frac{z}{\frac{z - y}{x}}\\

\mathbf{elif}\;y \leq 2.7 \cdot 10^{-41}:\\
\;\;\;\;y + x\\

\mathbf{elif}\;y \leq 7.6 \cdot 10^{+31}:\\
\;\;\;\;\frac{x}{1 - \frac{y}{z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -9.99999999999999934e145 or 7.6000000000000003e31 < y

    1. Initial program 73.2%

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

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

        \[\leadsto \color{blue}{\frac{x + y}{z - y} \cdot z} \]
      2. add-cube-cbrt97.7%

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

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

        \[\leadsto \left(\frac{x + y}{z - y} \cdot \color{blue}{{\left(\sqrt[3]{z}\right)}^{2}}\right) \cdot \sqrt[3]{z} \]
    5. Applied egg-rr97.6%

      \[\leadsto \color{blue}{\left(\frac{x + y}{z - y} \cdot {\left(\sqrt[3]{z}\right)}^{2}\right) \cdot \sqrt[3]{z}} \]
    6. Step-by-step derivation
      1. associate-*l*97.7%

        \[\leadsto \color{blue}{\frac{x + y}{z - y} \cdot \left({\left(\sqrt[3]{z}\right)}^{2} \cdot \sqrt[3]{z}\right)} \]
      2. clear-num97.7%

        \[\leadsto \color{blue}{\frac{1}{\frac{z - y}{x + y}}} \cdot \left({\left(\sqrt[3]{z}\right)}^{2} \cdot \sqrt[3]{z}\right) \]
      3. unpow297.7%

        \[\leadsto \frac{1}{\frac{z - y}{x + y}} \cdot \left(\color{blue}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right)} \cdot \sqrt[3]{z}\right) \]
      4. add-cube-cbrt99.8%

        \[\leadsto \frac{1}{\frac{z - y}{x + y}} \cdot \color{blue}{z} \]
      5. associate-*l/99.9%

        \[\leadsto \color{blue}{\frac{1 \cdot z}{\frac{z - y}{x + y}}} \]
      6. *-un-lft-identity99.9%

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

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

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

    if -9.99999999999999934e145 < y < -1e-3

    1. Initial program 86.8%

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

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

        \[\leadsto \color{blue}{\frac{x + y}{z - y} \cdot z} \]
      2. add-cube-cbrt97.7%

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

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

        \[\leadsto \left(\frac{x + y}{z - y} \cdot \color{blue}{{\left(\sqrt[3]{z}\right)}^{2}}\right) \cdot \sqrt[3]{z} \]
    5. Applied egg-rr97.7%

      \[\leadsto \color{blue}{\left(\frac{x + y}{z - y} \cdot {\left(\sqrt[3]{z}\right)}^{2}\right) \cdot \sqrt[3]{z}} \]
    6. Step-by-step derivation
      1. associate-*l*97.7%

        \[\leadsto \color{blue}{\frac{x + y}{z - y} \cdot \left({\left(\sqrt[3]{z}\right)}^{2} \cdot \sqrt[3]{z}\right)} \]
      2. clear-num97.7%

        \[\leadsto \color{blue}{\frac{1}{\frac{z - y}{x + y}}} \cdot \left({\left(\sqrt[3]{z}\right)}^{2} \cdot \sqrt[3]{z}\right) \]
      3. unpow297.7%

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

        \[\leadsto \frac{1}{\frac{z - y}{x + y}} \cdot \color{blue}{z} \]
      5. associate-*l/99.9%

        \[\leadsto \color{blue}{\frac{1 \cdot z}{\frac{z - y}{x + y}}} \]
      6. *-un-lft-identity99.9%

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

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

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

    if -1e-3 < y < 2.7e-41

    1. Initial program 99.9%

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

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

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

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

    if 2.7e-41 < y < 7.6000000000000003e31

    1. Initial program 99.8%

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

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

Alternative 4: 94.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -4.5 \cdot 10^{-119} \lor \neg \left(y \leq 2.5 \cdot 10^{-185}\right):\\ \;\;\;\;\frac{z}{\frac{z - y}{y + x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{1 - \frac{y}{z}}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= y -4.5e-119) (not (<= y 2.5e-185)))
   (/ z (/ (- z y) (+ y x)))
   (/ x (- 1.0 (/ y z)))))
double code(double x, double y, double z) {
	double tmp;
	if ((y <= -4.5e-119) || !(y <= 2.5e-185)) {
		tmp = z / ((z - y) / (y + x));
	} else {
		tmp = x / (1.0 - (y / 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.5d-119)) .or. (.not. (y <= 2.5d-185))) then
        tmp = z / ((z - y) / (y + x))
    else
        tmp = x / (1.0d0 - (y / z))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((y <= -4.5e-119) || !(y <= 2.5e-185)) {
		tmp = z / ((z - y) / (y + x));
	} else {
		tmp = x / (1.0 - (y / z));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (y <= -4.5e-119) or not (y <= 2.5e-185):
		tmp = z / ((z - y) / (y + x))
	else:
		tmp = x / (1.0 - (y / z))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((y <= -4.5e-119) || !(y <= 2.5e-185))
		tmp = Float64(z / Float64(Float64(z - y) / Float64(y + x)));
	else
		tmp = Float64(x / Float64(1.0 - Float64(y / z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((y <= -4.5e-119) || ~((y <= 2.5e-185)))
		tmp = z / ((z - y) / (y + x));
	else
		tmp = x / (1.0 - (y / z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[y, -4.5e-119], N[Not[LessEqual[y, 2.5e-185]], $MachinePrecision]], N[(z / N[(N[(z - y), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.5 \cdot 10^{-119} \lor \neg \left(y \leq 2.5 \cdot 10^{-185}\right):\\
\;\;\;\;\frac{z}{\frac{z - y}{y + x}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.5000000000000003e-119 or 2.5000000000000001e-185 < y

    1. Initial program 84.6%

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

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

        \[\leadsto \color{blue}{\frac{x + y}{z - y} \cdot z} \]
      2. add-cube-cbrt96.2%

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

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

        \[\leadsto \left(\frac{x + y}{z - y} \cdot \color{blue}{{\left(\sqrt[3]{z}\right)}^{2}}\right) \cdot \sqrt[3]{z} \]
    5. Applied egg-rr96.2%

      \[\leadsto \color{blue}{\left(\frac{x + y}{z - y} \cdot {\left(\sqrt[3]{z}\right)}^{2}\right) \cdot \sqrt[3]{z}} \]
    6. Step-by-step derivation
      1. associate-*l*96.2%

        \[\leadsto \color{blue}{\frac{x + y}{z - y} \cdot \left({\left(\sqrt[3]{z}\right)}^{2} \cdot \sqrt[3]{z}\right)} \]
      2. clear-num96.2%

        \[\leadsto \color{blue}{\frac{1}{\frac{z - y}{x + y}}} \cdot \left({\left(\sqrt[3]{z}\right)}^{2} \cdot \sqrt[3]{z}\right) \]
      3. unpow296.2%

        \[\leadsto \frac{1}{\frac{z - y}{x + y}} \cdot \left(\color{blue}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right)} \cdot \sqrt[3]{z}\right) \]
      4. add-cube-cbrt98.2%

        \[\leadsto \frac{1}{\frac{z - y}{x + y}} \cdot \color{blue}{z} \]
      5. associate-*l/98.4%

        \[\leadsto \color{blue}{\frac{1 \cdot z}{\frac{z - y}{x + y}}} \]
      6. *-un-lft-identity98.4%

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

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

    if -4.5000000000000003e-119 < y < 2.5000000000000001e-185

    1. Initial program 100.0%

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

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

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

Alternative 5: 75.5% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.02 \lor \neg \left(y \leq 9.2 \cdot 10^{+35}\right):\\
\;\;\;\;z \cdot \frac{y + x}{-y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -0.0200000000000000004 or 9.1999999999999993e35 < y

    1. Initial program 77.0%

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

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

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

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

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

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

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

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

    if -0.0200000000000000004 < y < 9.1999999999999993e35

    1. Initial program 99.9%

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

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

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

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

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

Alternative 6: 75.5% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.7:\\
\;\;\;\;\frac{-z}{\frac{y}{y + x}}\\

\mathbf{elif}\;y \leq 1.9 \cdot 10^{+35}:\\
\;\;\;\;y + x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -0.69999999999999996

    1. Initial program 78.1%

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

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

        \[\leadsto \color{blue}{\frac{x + y}{z - y} \cdot z} \]
      2. add-cube-cbrt97.6%

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

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

        \[\leadsto \left(\frac{x + y}{z - y} \cdot \color{blue}{{\left(\sqrt[3]{z}\right)}^{2}}\right) \cdot \sqrt[3]{z} \]
    5. Applied egg-rr97.6%

      \[\leadsto \color{blue}{\left(\frac{x + y}{z - y} \cdot {\left(\sqrt[3]{z}\right)}^{2}\right) \cdot \sqrt[3]{z}} \]
    6. Step-by-step derivation
      1. associate-*l*97.6%

        \[\leadsto \color{blue}{\frac{x + y}{z - y} \cdot \left({\left(\sqrt[3]{z}\right)}^{2} \cdot \sqrt[3]{z}\right)} \]
      2. clear-num97.6%

        \[\leadsto \color{blue}{\frac{1}{\frac{z - y}{x + y}}} \cdot \left({\left(\sqrt[3]{z}\right)}^{2} \cdot \sqrt[3]{z}\right) \]
      3. unpow297.6%

        \[\leadsto \frac{1}{\frac{z - y}{x + y}} \cdot \left(\color{blue}{\left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right)} \cdot \sqrt[3]{z}\right) \]
      4. add-cube-cbrt99.8%

        \[\leadsto \frac{1}{\frac{z - y}{x + y}} \cdot \color{blue}{z} \]
      5. associate-*l/99.9%

        \[\leadsto \color{blue}{\frac{1 \cdot z}{\frac{z - y}{x + y}}} \]
      6. *-un-lft-identity99.9%

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

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

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

        \[\leadsto \frac{z}{\frac{\color{blue}{-y}}{x + y}} \]
    10. Simplified81.7%

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

    if -0.69999999999999996 < y < 1.9e35

    1. Initial program 99.9%

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

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

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

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

    if 1.9e35 < y

    1. Initial program 75.6%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -0.7:\\ \;\;\;\;\frac{-z}{\frac{y}{y + x}}\\ \mathbf{elif}\;y \leq 1.9 \cdot 10^{+35}:\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{y + x}{-y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 66.5% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.5 \cdot 10^{+42} \lor \neg \left(x \leq 380000000000\right):\\
\;\;\;\;\frac{x}{1 - \frac{y}{z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -9.50000000000000019e42 or 3.8e11 < x

    1. Initial program 89.1%

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

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

    if -9.50000000000000019e42 < x < 3.8e11

    1. Initial program 87.8%

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

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

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

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

Alternative 8: 66.6% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.79999999999999998e40 or 5.2e11 < x

    1. Initial program 89.1%

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

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

    if -1.79999999999999998e40 < x < 5.2e11

    1. Initial program 87.8%

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

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

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

Alternative 9: 68.3% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.9 \cdot 10^{+84} \lor \neg \left(y \leq 9 \cdot 10^{+36}\right):\\
\;\;\;\;-z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -5.89999999999999984e84 or 8.99999999999999994e36 < y

    1. Initial program 72.4%

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

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

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

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

    if -5.89999999999999984e84 < y < 8.99999999999999994e36

    1. Initial program 99.2%

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

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

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

Alternative 10: 68.7% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.8 \cdot 10^{+51} \lor \neg \left(y \leq 9.6 \cdot 10^{+36}\right):\\
\;\;\;\;-z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -5.7999999999999997e51 or 9.5999999999999997e36 < y

    1. Initial program 75.2%

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

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

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

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

    if -5.7999999999999997e51 < y < 9.5999999999999997e36

    1. Initial program 99.2%

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

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

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

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

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

Alternative 11: 59.2% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.65 \cdot 10^{+47} \lor \neg \left(y \leq 3.1 \cdot 10^{+35}\right):\\
\;\;\;\;-z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.65e47 or 3.09999999999999987e35 < y

    1. Initial program 75.2%

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

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

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

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

    if -1.65e47 < y < 3.09999999999999987e35

    1. Initial program 99.2%

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

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

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

Alternative 12: 40.5% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -4.7 \cdot 10^{-29}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 10^{-179}:\\ \;\;\;\;y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= x -4.7e-29) x (if (<= x 1e-179) y x)))
double code(double x, double y, double z) {
	double tmp;
	if (x <= -4.7e-29) {
		tmp = x;
	} else if (x <= 1e-179) {
		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.7d-29)) then
        tmp = x
    else if (x <= 1d-179) 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.7e-29) {
		tmp = x;
	} else if (x <= 1e-179) {
		tmp = y;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if x <= -4.7e-29:
		tmp = x
	elif x <= 1e-179:
		tmp = y
	else:
		tmp = x
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (x <= -4.7e-29)
		tmp = x;
	elseif (x <= 1e-179)
		tmp = y;
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (x <= -4.7e-29)
		tmp = x;
	elseif (x <= 1e-179)
		tmp = y;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[x, -4.7e-29], x, If[LessEqual[x, 1e-179], y, x]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq 10^{-179}:\\
\;\;\;\;y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.6999999999999998e-29 or 1e-179 < x

    1. Initial program 88.3%

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

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

    if -4.6999999999999998e-29 < x < 1e-179

    1. Initial program 89.2%

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

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

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

      \[\leadsto \color{blue}{y + x} \]
    6. Taylor expanded in y around inf 35.0%

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

Alternative 13: 35.2% 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 88.5%

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

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

Developer Target 1: 93.9% 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 2024191 
(FPCore (x y z)
  :name "Graphics.Rendering.Chart.Backend.Diagrams:calcFontMetrics from Chart-diagrams-1.5.1, A"
  :precision binary64

  :alt
  (! :herbie-platform default (if (< y -3742931076268985600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (* (/ (+ y x) (- y)) z) (if (< y 3553466245608673400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ (+ x y) (- 1 (/ y z))) (* (/ (+ y x) (- y)) z))))

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