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

Percentage Accurate: 88.5% → 99.8%
Time: 8.7s
Alternatives: 11
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 11 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: 88.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.8% 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^{-289} \lor \neg \left(t_0 \leq 3.5 \cdot 10^{-288}\right):\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\left(\left(-z\right) - z \cdot \frac{x}{y}\right) - \frac{z}{\frac{y}{z}}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (/ (+ x y) (- 1.0 (/ y z)))))
   (if (or (<= t_0 -1e-289) (not (<= t_0 3.5e-288)))
     t_0
     (- (- (- z) (* z (/ x y))) (/ z (/ y z))))))
double code(double x, double y, double z) {
	double t_0 = (x + y) / (1.0 - (y / z));
	double tmp;
	if ((t_0 <= -1e-289) || !(t_0 <= 3.5e-288)) {
		tmp = t_0;
	} else {
		tmp = (-z - (z * (x / 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) :: t_0
    real(8) :: tmp
    t_0 = (x + y) / (1.0d0 - (y / z))
    if ((t_0 <= (-1d-289)) .or. (.not. (t_0 <= 3.5d-288))) then
        tmp = t_0
    else
        tmp = (-z - (z * (x / y))) - (z / (y / z))
    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-289) || !(t_0 <= 3.5e-288)) {
		tmp = t_0;
	} else {
		tmp = (-z - (z * (x / y))) - (z / (y / z));
	}
	return tmp;
}
def code(x, y, z):
	t_0 = (x + y) / (1.0 - (y / z))
	tmp = 0
	if (t_0 <= -1e-289) or not (t_0 <= 3.5e-288):
		tmp = t_0
	else:
		tmp = (-z - (z * (x / y))) - (z / (y / z))
	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-289) || !(t_0 <= 3.5e-288))
		tmp = t_0;
	else
		tmp = Float64(Float64(Float64(-z) - Float64(z * Float64(x / y))) - Float64(z / Float64(y / z)));
	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-289) || ~((t_0 <= 3.5e-288)))
		tmp = t_0;
	else
		tmp = (-z - (z * (x / y))) - (z / (y / z));
	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-289], N[Not[LessEqual[t$95$0, 3.5e-288]], $MachinePrecision]], t$95$0, N[(N[((-z) - N[(z * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(z / N[(y / z), $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^{-289} \lor \neg \left(t_0 \leq 3.5 \cdot 10^{-288}\right):\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (+.f64 x y) (-.f64 1 (/.f64 y z))) < -1e-289 or 3.5000000000000003e-288 < (/.f64 (+.f64 x y) (-.f64 1 (/.f64 y z)))

    1. Initial program 99.9%

      \[\frac{x + y}{1 - \frac{y}{z}} \]

    if -1e-289 < (/.f64 (+.f64 x y) (-.f64 1 (/.f64 y z))) < 3.5000000000000003e-288

    1. Initial program 12.7%

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

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

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

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

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

        \[\leadsto \left(\left(-z\right) - \color{blue}{\frac{x}{\frac{y}{z}}}\right) - \frac{{z}^{2}}{y} \]
      5. associate-/r/100.0%

        \[\leadsto \left(\left(-z\right) - \color{blue}{\frac{x}{y} \cdot z}\right) - \frac{{z}^{2}}{y} \]
      6. unpow2100.0%

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

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

      \[\leadsto \color{blue}{\left(\left(-z\right) - \frac{x}{y} \cdot z\right) - \frac{z}{\frac{y}{z}}} \]
  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^{-289} \lor \neg \left(\frac{x + y}{1 - \frac{y}{z}} \leq 3.5 \cdot 10^{-288}\right):\\ \;\;\;\;\frac{x + y}{1 - \frac{y}{z}}\\ \mathbf{else}:\\ \;\;\;\;\left(\left(-z\right) - z \cdot \frac{x}{y}\right) - \frac{z}{\frac{y}{z}}\\ \end{array} \]

Alternative 2: 99.8% 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^{-289} \lor \neg \left(t_0 \leq 3.5 \cdot 10^{-288}\right):\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{-z}{\frac{y}{x + y}}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (/ (+ x y) (- 1.0 (/ y z)))))
   (if (or (<= t_0 -1e-289) (not (<= t_0 3.5e-288)))
     t_0
     (/ (- z) (/ y (+ x y))))))
double code(double x, double y, double z) {
	double t_0 = (x + y) / (1.0 - (y / z));
	double tmp;
	if ((t_0 <= -1e-289) || !(t_0 <= 3.5e-288)) {
		tmp = t_0;
	} 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) :: t_0
    real(8) :: tmp
    t_0 = (x + y) / (1.0d0 - (y / z))
    if ((t_0 <= (-1d-289)) .or. (.not. (t_0 <= 3.5d-288))) then
        tmp = t_0
    else
        tmp = -z / (y / (x + y))
    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-289) || !(t_0 <= 3.5e-288)) {
		tmp = t_0;
	} else {
		tmp = -z / (y / (x + y));
	}
	return tmp;
}
def code(x, y, z):
	t_0 = (x + y) / (1.0 - (y / z))
	tmp = 0
	if (t_0 <= -1e-289) or not (t_0 <= 3.5e-288):
		tmp = t_0
	else:
		tmp = -z / (y / (x + y))
	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-289) || !(t_0 <= 3.5e-288))
		tmp = t_0;
	else
		tmp = Float64(Float64(-z) / Float64(y / Float64(x + y)));
	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-289) || ~((t_0 <= 3.5e-288)))
		tmp = t_0;
	else
		tmp = -z / (y / (x + y));
	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-289], N[Not[LessEqual[t$95$0, 3.5e-288]], $MachinePrecision]], t$95$0, N[((-z) / N[(y / N[(x + y), $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^{-289} \lor \neg \left(t_0 \leq 3.5 \cdot 10^{-288}\right):\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (+.f64 x y) (-.f64 1 (/.f64 y z))) < -1e-289 or 3.5000000000000003e-288 < (/.f64 (+.f64 x y) (-.f64 1 (/.f64 y z)))

    1. Initial program 99.9%

      \[\frac{x + y}{1 - \frac{y}{z}} \]

    if -1e-289 < (/.f64 (+.f64 x y) (-.f64 1 (/.f64 y z))) < 3.5000000000000003e-288

    1. Initial program 12.7%

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot z}{\frac{y}{x + y}}} \]
      3. mul-1-neg100.0%

        \[\leadsto \frac{\color{blue}{-z}}{\frac{y}{x + y}} \]
      4. +-commutative100.0%

        \[\leadsto \frac{-z}{\frac{y}{\color{blue}{y + x}}} \]
    4. Simplified100.0%

      \[\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^{-289} \lor \neg \left(\frac{x + y}{1 - \frac{y}{z}} \leq 3.5 \cdot 10^{-288}\right):\\ \;\;\;\;\frac{x + y}{1 - \frac{y}{z}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-z}{\frac{y}{x + y}}\\ \end{array} \]

Alternative 3: 60.6% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -16000000000000:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq -7.6 \cdot 10^{-14}:\\ \;\;\;\;-z\\ \mathbf{elif}\;z \leq -1.3 \cdot 10^{-95}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-272}:\\ \;\;\;\;-z\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{-202}:\\ \;\;\;\;\frac{x}{1 - \frac{y}{z}}\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{-75}:\\ \;\;\;\;-z\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= z -16000000000000.0)
   (+ x y)
   (if (<= z -7.6e-14)
     (- z)
     (if (<= z -1.3e-95)
       (+ x y)
       (if (<= z 5.5e-272)
         (- z)
         (if (<= z 1.35e-202)
           (/ x (- 1.0 (/ y z)))
           (if (<= z 1.8e-75) (- z) (+ x y))))))))
double code(double x, double y, double z) {
	double tmp;
	if (z <= -16000000000000.0) {
		tmp = x + y;
	} else if (z <= -7.6e-14) {
		tmp = -z;
	} else if (z <= -1.3e-95) {
		tmp = x + y;
	} else if (z <= 5.5e-272) {
		tmp = -z;
	} else if (z <= 1.35e-202) {
		tmp = x / (1.0 - (y / z));
	} else if (z <= 1.8e-75) {
		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 (z <= (-16000000000000.0d0)) then
        tmp = x + y
    else if (z <= (-7.6d-14)) then
        tmp = -z
    else if (z <= (-1.3d-95)) then
        tmp = x + y
    else if (z <= 5.5d-272) then
        tmp = -z
    else if (z <= 1.35d-202) then
        tmp = x / (1.0d0 - (y / z))
    else if (z <= 1.8d-75) 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 (z <= -16000000000000.0) {
		tmp = x + y;
	} else if (z <= -7.6e-14) {
		tmp = -z;
	} else if (z <= -1.3e-95) {
		tmp = x + y;
	} else if (z <= 5.5e-272) {
		tmp = -z;
	} else if (z <= 1.35e-202) {
		tmp = x / (1.0 - (y / z));
	} else if (z <= 1.8e-75) {
		tmp = -z;
	} else {
		tmp = x + y;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if z <= -16000000000000.0:
		tmp = x + y
	elif z <= -7.6e-14:
		tmp = -z
	elif z <= -1.3e-95:
		tmp = x + y
	elif z <= 5.5e-272:
		tmp = -z
	elif z <= 1.35e-202:
		tmp = x / (1.0 - (y / z))
	elif z <= 1.8e-75:
		tmp = -z
	else:
		tmp = x + y
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (z <= -16000000000000.0)
		tmp = Float64(x + y);
	elseif (z <= -7.6e-14)
		tmp = Float64(-z);
	elseif (z <= -1.3e-95)
		tmp = Float64(x + y);
	elseif (z <= 5.5e-272)
		tmp = Float64(-z);
	elseif (z <= 1.35e-202)
		tmp = Float64(x / Float64(1.0 - Float64(y / z)));
	elseif (z <= 1.8e-75)
		tmp = Float64(-z);
	else
		tmp = Float64(x + y);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (z <= -16000000000000.0)
		tmp = x + y;
	elseif (z <= -7.6e-14)
		tmp = -z;
	elseif (z <= -1.3e-95)
		tmp = x + y;
	elseif (z <= 5.5e-272)
		tmp = -z;
	elseif (z <= 1.35e-202)
		tmp = x / (1.0 - (y / z));
	elseif (z <= 1.8e-75)
		tmp = -z;
	else
		tmp = x + y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[z, -16000000000000.0], N[(x + y), $MachinePrecision], If[LessEqual[z, -7.6e-14], (-z), If[LessEqual[z, -1.3e-95], N[(x + y), $MachinePrecision], If[LessEqual[z, 5.5e-272], (-z), If[LessEqual[z, 1.35e-202], N[(x / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.8e-75], (-z), N[(x + y), $MachinePrecision]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -7.6 \cdot 10^{-14}:\\
\;\;\;\;-z\\

\mathbf{elif}\;z \leq -1.3 \cdot 10^{-95}:\\
\;\;\;\;x + y\\

\mathbf{elif}\;z \leq 5.5 \cdot 10^{-272}:\\
\;\;\;\;-z\\

\mathbf{elif}\;z \leq 1.35 \cdot 10^{-202}:\\
\;\;\;\;\frac{x}{1 - \frac{y}{z}}\\

\mathbf{elif}\;z \leq 1.8 \cdot 10^{-75}:\\
\;\;\;\;-z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.6e13 or -7.6000000000000004e-14 < z < -1.3e-95 or 1.8e-75 < z

    1. Initial program 98.8%

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

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

        \[\leadsto \color{blue}{y + x} \]
    4. Simplified76.1%

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

    if -1.6e13 < z < -7.6000000000000004e-14 or -1.3e-95 < z < 5.4999999999999999e-272 or 1.3499999999999999e-202 < z < 1.8e-75

    1. Initial program 71.4%

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

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

        \[\leadsto \color{blue}{-z} \]
    4. Simplified66.4%

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

    if 5.4999999999999999e-272 < z < 1.3499999999999999e-202

    1. Initial program 72.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -16000000000000:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq -7.6 \cdot 10^{-14}:\\ \;\;\;\;-z\\ \mathbf{elif}\;z \leq -1.3 \cdot 10^{-95}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-272}:\\ \;\;\;\;-z\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{-202}:\\ \;\;\;\;\frac{x}{1 - \frac{y}{z}}\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{-75}:\\ \;\;\;\;-z\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 4: 73.9% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 1 - \frac{y}{z}\\ t_1 := \frac{-z}{\frac{y}{x + y}}\\ \mathbf{if}\;y \leq -3.7 \cdot 10^{+68}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -42:\\ \;\;\;\;\frac{y}{t_0}\\ \mathbf{elif}\;y \leq -1.24 \cdot 10^{-116}:\\ \;\;\;\;\frac{x}{t_0}\\ \mathbf{elif}\;y \leq 3 \cdot 10^{-47}:\\ \;\;\;\;\left(x + y\right) \cdot \left(1 + \frac{y}{z}\right)\\ \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 (+ x y)))))
   (if (<= y -3.7e+68)
     t_1
     (if (<= y -42.0)
       (/ y t_0)
       (if (<= y -1.24e-116)
         (/ x t_0)
         (if (<= y 3e-47) (* (+ x y) (+ 1.0 (/ y z))) t_1))))))
double code(double x, double y, double z) {
	double t_0 = 1.0 - (y / z);
	double t_1 = -z / (y / (x + y));
	double tmp;
	if (y <= -3.7e+68) {
		tmp = t_1;
	} else if (y <= -42.0) {
		tmp = y / t_0;
	} else if (y <= -1.24e-116) {
		tmp = x / t_0;
	} else if (y <= 3e-47) {
		tmp = (x + y) * (1.0 + (y / z));
	} 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 / (x + y))
    if (y <= (-3.7d+68)) then
        tmp = t_1
    else if (y <= (-42.0d0)) then
        tmp = y / t_0
    else if (y <= (-1.24d-116)) then
        tmp = x / t_0
    else if (y <= 3d-47) then
        tmp = (x + y) * (1.0d0 + (y / z))
    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 / (x + y));
	double tmp;
	if (y <= -3.7e+68) {
		tmp = t_1;
	} else if (y <= -42.0) {
		tmp = y / t_0;
	} else if (y <= -1.24e-116) {
		tmp = x / t_0;
	} else if (y <= 3e-47) {
		tmp = (x + y) * (1.0 + (y / z));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = 1.0 - (y / z)
	t_1 = -z / (y / (x + y))
	tmp = 0
	if y <= -3.7e+68:
		tmp = t_1
	elif y <= -42.0:
		tmp = y / t_0
	elif y <= -1.24e-116:
		tmp = x / t_0
	elif y <= 3e-47:
		tmp = (x + y) * (1.0 + (y / z))
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(1.0 - Float64(y / z))
	t_1 = Float64(Float64(-z) / Float64(y / Float64(x + y)))
	tmp = 0.0
	if (y <= -3.7e+68)
		tmp = t_1;
	elseif (y <= -42.0)
		tmp = Float64(y / t_0);
	elseif (y <= -1.24e-116)
		tmp = Float64(x / t_0);
	elseif (y <= 3e-47)
		tmp = Float64(Float64(x + y) * Float64(1.0 + Float64(y / z)));
	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 / (x + y));
	tmp = 0.0;
	if (y <= -3.7e+68)
		tmp = t_1;
	elseif (y <= -42.0)
		tmp = y / t_0;
	elseif (y <= -1.24e-116)
		tmp = x / t_0;
	elseif (y <= 3e-47)
		tmp = (x + y) * (1.0 + (y / z));
	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[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.7e+68], t$95$1, If[LessEqual[y, -42.0], N[(y / t$95$0), $MachinePrecision], If[LessEqual[y, -1.24e-116], N[(x / t$95$0), $MachinePrecision], If[LessEqual[y, 3e-47], N[(N[(x + y), $MachinePrecision] * N[(1.0 + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -42:\\
\;\;\;\;\frac{y}{t_0}\\

\mathbf{elif}\;y \leq -1.24 \cdot 10^{-116}:\\
\;\;\;\;\frac{x}{t_0}\\

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -3.69999999999999998e68 or 3.00000000000000017e-47 < y

    1. Initial program 75.9%

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot z}{\frac{y}{x + y}}} \]
      3. mul-1-neg76.1%

        \[\leadsto \frac{\color{blue}{-z}}{\frac{y}{x + y}} \]
      4. +-commutative76.1%

        \[\leadsto \frac{-z}{\frac{y}{\color{blue}{y + x}}} \]
    4. Simplified76.1%

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

    if -3.69999999999999998e68 < y < -42

    1. Initial program 100.0%

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

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

    if -42 < y < -1.24000000000000004e-116

    1. Initial program 99.9%

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

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

    if -1.24000000000000004e-116 < y < 3.00000000000000017e-47

    1. Initial program 99.9%

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

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

        \[\leadsto \color{blue}{\left(x + y\right) + \frac{y \cdot \left(x + y\right)}{z}} \]
      2. *-lft-identity89.6%

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

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

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

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

      \[\leadsto \color{blue}{\left(y + x\right) \cdot \left(1 + \frac{y}{z}\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification80.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.7 \cdot 10^{+68}:\\ \;\;\;\;\frac{-z}{\frac{y}{x + y}}\\ \mathbf{elif}\;y \leq -42:\\ \;\;\;\;\frac{y}{1 - \frac{y}{z}}\\ \mathbf{elif}\;y \leq -1.24 \cdot 10^{-116}:\\ \;\;\;\;\frac{x}{1 - \frac{y}{z}}\\ \mathbf{elif}\;y \leq 3 \cdot 10^{-47}:\\ \;\;\;\;\left(x + y\right) \cdot \left(1 + \frac{y}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-z}{\frac{y}{x + y}}\\ \end{array} \]

Alternative 5: 69.5% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{y}{1 - \frac{y}{z}}\\ \mathbf{if}\;y \leq -4.6 \cdot 10^{+141}:\\ \;\;\;\;-z\\ \mathbf{elif}\;y \leq -11800000000:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 5.3 \cdot 10^{-17}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;y \leq 3 \cdot 10^{+178}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\left(-z\right) - z \cdot \frac{z}{y}\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (/ y (- 1.0 (/ y z)))))
   (if (<= y -4.6e+141)
     (- z)
     (if (<= y -11800000000.0)
       t_0
       (if (<= y 5.3e-17)
         (+ x y)
         (if (<= y 3e+178) t_0 (- (- z) (* z (/ z y)))))))))
double code(double x, double y, double z) {
	double t_0 = y / (1.0 - (y / z));
	double tmp;
	if (y <= -4.6e+141) {
		tmp = -z;
	} else if (y <= -11800000000.0) {
		tmp = t_0;
	} else if (y <= 5.3e-17) {
		tmp = x + y;
	} else if (y <= 3e+178) {
		tmp = t_0;
	} else {
		tmp = -z - (z * (z / 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 = y / (1.0d0 - (y / z))
    if (y <= (-4.6d+141)) then
        tmp = -z
    else if (y <= (-11800000000.0d0)) then
        tmp = t_0
    else if (y <= 5.3d-17) then
        tmp = x + y
    else if (y <= 3d+178) then
        tmp = t_0
    else
        tmp = -z - (z * (z / y))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = y / (1.0 - (y / z));
	double tmp;
	if (y <= -4.6e+141) {
		tmp = -z;
	} else if (y <= -11800000000.0) {
		tmp = t_0;
	} else if (y <= 5.3e-17) {
		tmp = x + y;
	} else if (y <= 3e+178) {
		tmp = t_0;
	} else {
		tmp = -z - (z * (z / y));
	}
	return tmp;
}
def code(x, y, z):
	t_0 = y / (1.0 - (y / z))
	tmp = 0
	if y <= -4.6e+141:
		tmp = -z
	elif y <= -11800000000.0:
		tmp = t_0
	elif y <= 5.3e-17:
		tmp = x + y
	elif y <= 3e+178:
		tmp = t_0
	else:
		tmp = -z - (z * (z / y))
	return tmp
function code(x, y, z)
	t_0 = Float64(y / Float64(1.0 - Float64(y / z)))
	tmp = 0.0
	if (y <= -4.6e+141)
		tmp = Float64(-z);
	elseif (y <= -11800000000.0)
		tmp = t_0;
	elseif (y <= 5.3e-17)
		tmp = Float64(x + y);
	elseif (y <= 3e+178)
		tmp = t_0;
	else
		tmp = Float64(Float64(-z) - Float64(z * Float64(z / y)));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = y / (1.0 - (y / z));
	tmp = 0.0;
	if (y <= -4.6e+141)
		tmp = -z;
	elseif (y <= -11800000000.0)
		tmp = t_0;
	elseif (y <= 5.3e-17)
		tmp = x + y;
	elseif (y <= 3e+178)
		tmp = t_0;
	else
		tmp = -z - (z * (z / y));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(y / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.6e+141], (-z), If[LessEqual[y, -11800000000.0], t$95$0, If[LessEqual[y, 5.3e-17], N[(x + y), $MachinePrecision], If[LessEqual[y, 3e+178], t$95$0, N[((-z) - N[(z * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -11800000000:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y \leq 5.3 \cdot 10^{-17}:\\
\;\;\;\;x + y\\

\mathbf{elif}\;y \leq 3 \cdot 10^{+178}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -4.6000000000000003e141

    1. Initial program 53.9%

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

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

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

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

    if -4.6000000000000003e141 < y < -1.18e10 or 5.2999999999999998e-17 < y < 3.00000000000000016e178

    1. Initial program 90.7%

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

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

    if -1.18e10 < y < 5.2999999999999998e-17

    1. Initial program 99.9%

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

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

        \[\leadsto \color{blue}{y + x} \]
    4. Simplified80.2%

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

    if 3.00000000000000016e178 < y

    1. Initial program 73.1%

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

      \[\leadsto \color{blue}{\frac{y}{1 - \frac{y}{z}}} \]
    3. Taylor expanded in y around inf 88.3%

      \[\leadsto \color{blue}{-1 \cdot z + -1 \cdot \frac{{z}^{2}}{y}} \]
    4. Step-by-step derivation
      1. distribute-lft-in88.3%

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

        \[\leadsto \color{blue}{-\left(z + \frac{{z}^{2}}{y}\right)} \]
      3. unpow288.3%

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

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

      \[\leadsto \color{blue}{-\left(z + z \cdot \frac{z}{y}\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification76.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.6 \cdot 10^{+141}:\\ \;\;\;\;-z\\ \mathbf{elif}\;y \leq -11800000000:\\ \;\;\;\;\frac{y}{1 - \frac{y}{z}}\\ \mathbf{elif}\;y \leq 5.3 \cdot 10^{-17}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;y \leq 3 \cdot 10^{+178}:\\ \;\;\;\;\frac{y}{1 - \frac{y}{z}}\\ \mathbf{else}:\\ \;\;\;\;\left(-z\right) - z \cdot \frac{z}{y}\\ \end{array} \]

Alternative 6: 73.8% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 1 - \frac{y}{z}\\ t_1 := \frac{-z}{\frac{y}{x + y}}\\ \mathbf{if}\;y \leq -4.3 \cdot 10^{+70}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -70:\\ \;\;\;\;\frac{y}{t_0}\\ \mathbf{elif}\;y \leq -4.4 \cdot 10^{-115}:\\ \;\;\;\;\frac{x}{t_0}\\ \mathbf{elif}\;y \leq 2.9 \cdot 10^{-47}:\\ \;\;\;\;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 (+ x y)))))
   (if (<= y -4.3e+70)
     t_1
     (if (<= y -70.0)
       (/ y t_0)
       (if (<= y -4.4e-115) (/ x t_0) (if (<= y 2.9e-47) (+ x y) t_1))))))
double code(double x, double y, double z) {
	double t_0 = 1.0 - (y / z);
	double t_1 = -z / (y / (x + y));
	double tmp;
	if (y <= -4.3e+70) {
		tmp = t_1;
	} else if (y <= -70.0) {
		tmp = y / t_0;
	} else if (y <= -4.4e-115) {
		tmp = x / t_0;
	} else if (y <= 2.9e-47) {
		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 / (x + y))
    if (y <= (-4.3d+70)) then
        tmp = t_1
    else if (y <= (-70.0d0)) then
        tmp = y / t_0
    else if (y <= (-4.4d-115)) then
        tmp = x / t_0
    else if (y <= 2.9d-47) 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 / (x + y));
	double tmp;
	if (y <= -4.3e+70) {
		tmp = t_1;
	} else if (y <= -70.0) {
		tmp = y / t_0;
	} else if (y <= -4.4e-115) {
		tmp = x / t_0;
	} else if (y <= 2.9e-47) {
		tmp = x + y;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = 1.0 - (y / z)
	t_1 = -z / (y / (x + y))
	tmp = 0
	if y <= -4.3e+70:
		tmp = t_1
	elif y <= -70.0:
		tmp = y / t_0
	elif y <= -4.4e-115:
		tmp = x / t_0
	elif y <= 2.9e-47:
		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(Float64(-z) / Float64(y / Float64(x + y)))
	tmp = 0.0
	if (y <= -4.3e+70)
		tmp = t_1;
	elseif (y <= -70.0)
		tmp = Float64(y / t_0);
	elseif (y <= -4.4e-115)
		tmp = Float64(x / t_0);
	elseif (y <= 2.9e-47)
		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 / (x + y));
	tmp = 0.0;
	if (y <= -4.3e+70)
		tmp = t_1;
	elseif (y <= -70.0)
		tmp = y / t_0;
	elseif (y <= -4.4e-115)
		tmp = x / t_0;
	elseif (y <= 2.9e-47)
		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[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.3e+70], t$95$1, If[LessEqual[y, -70.0], N[(y / t$95$0), $MachinePrecision], If[LessEqual[y, -4.4e-115], N[(x / t$95$0), $MachinePrecision], If[LessEqual[y, 2.9e-47], 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}{x + y}}\\
\mathbf{if}\;y \leq -4.3 \cdot 10^{+70}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq -70:\\
\;\;\;\;\frac{y}{t_0}\\

\mathbf{elif}\;y \leq -4.4 \cdot 10^{-115}:\\
\;\;\;\;\frac{x}{t_0}\\

\mathbf{elif}\;y \leq 2.9 \cdot 10^{-47}:\\
\;\;\;\;x + y\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -4.3000000000000001e70 or 2.9e-47 < y

    1. Initial program 75.9%

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot z}{\frac{y}{x + y}}} \]
      3. mul-1-neg76.1%

        \[\leadsto \frac{\color{blue}{-z}}{\frac{y}{x + y}} \]
      4. +-commutative76.1%

        \[\leadsto \frac{-z}{\frac{y}{\color{blue}{y + x}}} \]
    4. Simplified76.1%

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

    if -4.3000000000000001e70 < y < -70

    1. Initial program 100.0%

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

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

    if -70 < y < -4.3999999999999999e-115

    1. Initial program 99.9%

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

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

    if -4.3999999999999999e-115 < y < 2.9e-47

    1. Initial program 99.9%

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

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

        \[\leadsto \color{blue}{y + x} \]
    4. Simplified89.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.3 \cdot 10^{+70}:\\ \;\;\;\;\frac{-z}{\frac{y}{x + y}}\\ \mathbf{elif}\;y \leq -70:\\ \;\;\;\;\frac{y}{1 - \frac{y}{z}}\\ \mathbf{elif}\;y \leq -4.4 \cdot 10^{-115}:\\ \;\;\;\;\frac{x}{1 - \frac{y}{z}}\\ \mathbf{elif}\;y \leq 2.9 \cdot 10^{-47}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;\frac{-z}{\frac{y}{x + y}}\\ \end{array} \]

Alternative 7: 69.4% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;y \leq -1750000:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y \leq 7 \cdot 10^{-17}:\\
\;\;\;\;x + y\\

\mathbf{elif}\;y \leq 4.6 \cdot 10^{+177}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.1000000000000002e140 or 4.5999999999999998e177 < y

    1. Initial program 59.8%

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

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

        \[\leadsto \color{blue}{-z} \]
    4. Simplified79.8%

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

    if -2.1000000000000002e140 < y < -1.75e6 or 7.0000000000000003e-17 < y < 4.5999999999999998e177

    1. Initial program 90.7%

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

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

    if -1.75e6 < y < 7.0000000000000003e-17

    1. Initial program 99.9%

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

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

        \[\leadsto \color{blue}{y + x} \]
    4. Simplified80.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.1 \cdot 10^{+140}:\\ \;\;\;\;-z\\ \mathbf{elif}\;y \leq -1750000:\\ \;\;\;\;\frac{y}{1 - \frac{y}{z}}\\ \mathbf{elif}\;y \leq 7 \cdot 10^{-17}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;y \leq 4.6 \cdot 10^{+177}:\\ \;\;\;\;\frac{y}{1 - \frac{y}{z}}\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \]

Alternative 8: 60.6% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.2 \cdot 10^{+17}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq -8 \cdot 10^{-14} \lor \neg \left(z \leq -7.8 \cdot 10^{-94}\right) \land z \leq 2.1 \cdot 10^{-69}:\\ \;\;\;\;-z\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= z -1.2e+17)
   (+ x y)
   (if (or (<= z -8e-14) (and (not (<= z -7.8e-94)) (<= z 2.1e-69)))
     (- z)
     (+ x y))))
double code(double x, double y, double z) {
	double tmp;
	if (z <= -1.2e+17) {
		tmp = x + y;
	} else if ((z <= -8e-14) || (!(z <= -7.8e-94) && (z <= 2.1e-69))) {
		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 (z <= (-1.2d+17)) then
        tmp = x + y
    else if ((z <= (-8d-14)) .or. (.not. (z <= (-7.8d-94))) .and. (z <= 2.1d-69)) 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 (z <= -1.2e+17) {
		tmp = x + y;
	} else if ((z <= -8e-14) || (!(z <= -7.8e-94) && (z <= 2.1e-69))) {
		tmp = -z;
	} else {
		tmp = x + y;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if z <= -1.2e+17:
		tmp = x + y
	elif (z <= -8e-14) or (not (z <= -7.8e-94) and (z <= 2.1e-69)):
		tmp = -z
	else:
		tmp = x + y
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (z <= -1.2e+17)
		tmp = Float64(x + y);
	elseif ((z <= -8e-14) || (!(z <= -7.8e-94) && (z <= 2.1e-69)))
		tmp = Float64(-z);
	else
		tmp = Float64(x + y);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (z <= -1.2e+17)
		tmp = x + y;
	elseif ((z <= -8e-14) || (~((z <= -7.8e-94)) && (z <= 2.1e-69)))
		tmp = -z;
	else
		tmp = x + y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[z, -1.2e+17], N[(x + y), $MachinePrecision], If[Or[LessEqual[z, -8e-14], And[N[Not[LessEqual[z, -7.8e-94]], $MachinePrecision], LessEqual[z, 2.1e-69]]], (-z), N[(x + y), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -8 \cdot 10^{-14} \lor \neg \left(z \leq -7.8 \cdot 10^{-94}\right) \land z \leq 2.1 \cdot 10^{-69}:\\
\;\;\;\;-z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.2e17 or -7.99999999999999999e-14 < z < -7.8000000000000004e-94 or 2.1e-69 < z

    1. Initial program 98.8%

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

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

        \[\leadsto \color{blue}{y + x} \]
    4. Simplified76.1%

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

    if -1.2e17 < z < -7.99999999999999999e-14 or -7.8000000000000004e-94 < z < 2.1e-69

    1. Initial program 71.5%

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

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

        \[\leadsto \color{blue}{-z} \]
    4. Simplified59.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.2 \cdot 10^{+17}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq -8 \cdot 10^{-14} \lor \neg \left(z \leq -7.8 \cdot 10^{-94}\right) \land z \leq 2.1 \cdot 10^{-69}:\\ \;\;\;\;-z\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 9: 40.0% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;x \leq 1.12 \cdot 10^{-212}:\\
\;\;\;\;y\\

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

\mathbf{elif}\;x \leq 7.2 \cdot 10^{-90}:\\
\;\;\;\;y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.49999999999999999e-162 or 1.12e-212 < x < 9.9999999999999995e-144 or 7.19999999999999961e-90 < x

    1. Initial program 88.8%

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

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

    if -1.49999999999999999e-162 < x < 1.12e-212 or 9.9999999999999995e-144 < x < 7.19999999999999961e-90

    1. Initial program 88.3%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.5 \cdot 10^{-162}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 1.12 \cdot 10^{-212}:\\ \;\;\;\;y\\ \mathbf{elif}\;x \leq 10^{-143}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 7.2 \cdot 10^{-90}:\\ \;\;\;\;y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 10: 57.7% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -35:\\
\;\;\;\;-z\\

\mathbf{elif}\;y \leq 5 \cdot 10^{-18}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -35 or 5.00000000000000036e-18 < y

    1. Initial program 77.0%

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

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

        \[\leadsto \color{blue}{-z} \]
    4. Simplified60.4%

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

    if -35 < y < 5.00000000000000036e-18

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -35:\\ \;\;\;\;-z\\ \mathbf{elif}\;y \leq 5 \cdot 10^{-18}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \]

Alternative 11: 35.0% 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.6%

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

    \[\leadsto \color{blue}{x} \]
  3. Final simplification37.3%

    \[\leadsto x \]

Developer target: 93.7% accurate, 0.7× 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 2023297 
(FPCore (x y z)
  :name "Graphics.Rendering.Chart.Backend.Diagrams:calcFontMetrics from Chart-diagrams-1.5.1, A"
  :precision binary64

  :herbie-target
  (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))))