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

Percentage Accurate: 88.5% → 99.7%
Time: 7.0s
Alternatives: 9
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 9 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.7% accurate, 0.3× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (+.f64 x y) (-.f64 1 (/.f64 y z))) < -1.9999999999999999e-280 or 1.00000000000000007e-285 < (/.f64 (+.f64 x y) (-.f64 1 (/.f64 y z)))

    1. Initial program 99.8%

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

    if -1.9999999999999999e-280 < (/.f64 (+.f64 x y) (-.f64 1 (/.f64 y z))) < 1.00000000000000007e-285

    1. Initial program 16.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{z \cdot \left(-1 - \frac{x}{y}\right)} \]
  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 -2 \cdot 10^{-280} \lor \neg \left(\frac{x + y}{1 - \frac{y}{z}} \leq 10^{-285}\right):\\ \;\;\;\;\frac{x + y}{1 - \frac{y}{z}}\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 74.0% accurate, 0.3× speedup?

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

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

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

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

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

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


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

    1. Initial program 75.5%

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

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

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

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

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

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

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

    if -3.4e124 < y < -1.34999999999999996e33

    1. Initial program 85.7%

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

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

    if -1.34999999999999996e33 < y < -4.6999999999999999e-101

    1. Initial program 96.4%

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

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

    if -4.6999999999999999e-101 < y < 2.59999999999999973e61

    1. Initial program 99.1%

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

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

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

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

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

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

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

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

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

    if 2.59999999999999973e61 < y

    1. Initial program 84.3%

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

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

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

        \[\leadsto -\color{blue}{\frac{z}{\frac{y}{x + y}}} \]
      3. distribute-neg-frac72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.4 \cdot 10^{+124}:\\ \;\;\;\;\frac{-z}{\frac{y}{x + y}}\\ \mathbf{elif}\;y \leq -1.35 \cdot 10^{+33}:\\ \;\;\;\;\frac{y}{1 - \frac{y}{z}}\\ \mathbf{elif}\;y \leq -4.7 \cdot 10^{-101}:\\ \;\;\;\;\frac{x}{1 - \frac{y}{z}}\\ \mathbf{elif}\;y \leq 2.6 \cdot 10^{+61}:\\ \;\;\;\;\left(x + y\right) \cdot \left(1 + \frac{y}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 72.8% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.5 \cdot 10^{+123} \lor \neg \left(y \leq -8 \cdot 10^{+26} \lor \neg \left(y \leq -7 \cdot 10^{-8}\right) \land y \leq 3.8 \cdot 10^{+60}\right):\\
\;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -7.4999999999999999e123 or -8.00000000000000038e26 < y < -7.00000000000000048e-8 or 3.80000000000000009e60 < y

    1. Initial program 80.7%

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

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

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

        \[\leadsto -\color{blue}{\frac{z}{\frac{y}{x + y}}} \]
      3. distribute-neg-frac80.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto z \cdot \color{blue}{\left(-1 - \frac{x}{y}\right)} \]
    11. Simplified80.3%

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

    if -7.4999999999999999e123 < y < -8.00000000000000038e26 or -7.00000000000000048e-8 < y < 3.80000000000000009e60

    1. Initial program 98.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.5 \cdot 10^{+123} \lor \neg \left(y \leq -8 \cdot 10^{+26} \lor \neg \left(y \leq -7 \cdot 10^{-8}\right) \land y \leq 3.8 \cdot 10^{+60}\right):\\ \;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 74.2% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 1 - \frac{y}{z}\\ t_1 := z \cdot \left(-1 - \frac{x}{y}\right)\\ \mathbf{if}\;y \leq -3.2 \cdot 10^{+125}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -6.5 \cdot 10^{+33}:\\ \;\;\;\;\frac{y}{t\_0}\\ \mathbf{elif}\;y \leq -1.2 \cdot 10^{-107}:\\ \;\;\;\;\frac{x}{t\_0}\\ \mathbf{elif}\;y \leq 2.45 \cdot 10^{+58}:\\ \;\;\;\;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 (- -1.0 (/ x y)))))
   (if (<= y -3.2e+125)
     t_1
     (if (<= y -6.5e+33)
       (/ y t_0)
       (if (<= y -1.2e-107) (/ x t_0) (if (<= y 2.45e+58) (+ x y) t_1))))))
double code(double x, double y, double z) {
	double t_0 = 1.0 - (y / z);
	double t_1 = z * (-1.0 - (x / y));
	double tmp;
	if (y <= -3.2e+125) {
		tmp = t_1;
	} else if (y <= -6.5e+33) {
		tmp = y / t_0;
	} else if (y <= -1.2e-107) {
		tmp = x / t_0;
	} else if (y <= 2.45e+58) {
		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 * ((-1.0d0) - (x / y))
    if (y <= (-3.2d+125)) then
        tmp = t_1
    else if (y <= (-6.5d+33)) then
        tmp = y / t_0
    else if (y <= (-1.2d-107)) then
        tmp = x / t_0
    else if (y <= 2.45d+58) 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 * (-1.0 - (x / y));
	double tmp;
	if (y <= -3.2e+125) {
		tmp = t_1;
	} else if (y <= -6.5e+33) {
		tmp = y / t_0;
	} else if (y <= -1.2e-107) {
		tmp = x / t_0;
	} else if (y <= 2.45e+58) {
		tmp = x + y;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = 1.0 - (y / z)
	t_1 = z * (-1.0 - (x / y))
	tmp = 0
	if y <= -3.2e+125:
		tmp = t_1
	elif y <= -6.5e+33:
		tmp = y / t_0
	elif y <= -1.2e-107:
		tmp = x / t_0
	elif y <= 2.45e+58:
		tmp = x + y
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(1.0 - Float64(y / z))
	t_1 = Float64(z * Float64(-1.0 - Float64(x / y)))
	tmp = 0.0
	if (y <= -3.2e+125)
		tmp = t_1;
	elseif (y <= -6.5e+33)
		tmp = Float64(y / t_0);
	elseif (y <= -1.2e-107)
		tmp = Float64(x / t_0);
	elseif (y <= 2.45e+58)
		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 * (-1.0 - (x / y));
	tmp = 0.0;
	if (y <= -3.2e+125)
		tmp = t_1;
	elseif (y <= -6.5e+33)
		tmp = y / t_0;
	elseif (y <= -1.2e-107)
		tmp = x / t_0;
	elseif (y <= 2.45e+58)
		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[(-1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.2e+125], t$95$1, If[LessEqual[y, -6.5e+33], N[(y / t$95$0), $MachinePrecision], If[LessEqual[y, -1.2e-107], N[(x / t$95$0), $MachinePrecision], If[LessEqual[y, 2.45e+58], N[(x + y), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}

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

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

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

\mathbf{elif}\;y \leq 2.45 \cdot 10^{+58}:\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -3.19999999999999983e125 or 2.45000000000000009e58 < y

    1. Initial program 80.1%

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

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

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

        \[\leadsto -\color{blue}{\frac{z}{\frac{y}{x + y}}} \]
      3. distribute-neg-frac80.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto z \cdot \color{blue}{\left(-1 - \frac{x}{y}\right)} \]
    11. Simplified80.2%

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

    if -3.19999999999999983e125 < y < -6.49999999999999993e33

    1. Initial program 85.7%

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

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

    if -6.49999999999999993e33 < y < -1.19999999999999997e-107

    1. Initial program 96.5%

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

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

    if -1.19999999999999997e-107 < y < 2.45000000000000009e58

    1. Initial program 99.1%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.2 \cdot 10^{+125}:\\ \;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\ \mathbf{elif}\;y \leq -6.5 \cdot 10^{+33}:\\ \;\;\;\;\frac{y}{1 - \frac{y}{z}}\\ \mathbf{elif}\;y \leq -1.2 \cdot 10^{-107}:\\ \;\;\;\;\frac{x}{1 - \frac{y}{z}}\\ \mathbf{elif}\;y \leq 2.45 \cdot 10^{+58}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 74.2% accurate, 0.3× speedup?

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

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

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

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

\mathbf{elif}\;y \leq 2.4 \cdot 10^{+61}:\\
\;\;\;\;x + y\\

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


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

    1. Initial program 75.5%

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

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

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

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

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

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

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

    if -6.0000000000000003e125 < y < -2.30000000000000011e33

    1. Initial program 85.7%

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

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

    if -2.30000000000000011e33 < y < -8.6000000000000001e-108

    1. Initial program 96.5%

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

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

    if -8.6000000000000001e-108 < y < 2.3999999999999999e61

    1. Initial program 99.1%

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

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

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

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

    if 2.3999999999999999e61 < y

    1. Initial program 84.3%

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

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

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

        \[\leadsto -\color{blue}{\frac{z}{\frac{y}{x + y}}} \]
      3. distribute-neg-frac72.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6 \cdot 10^{+125}:\\ \;\;\;\;\frac{-z}{\frac{y}{x + y}}\\ \mathbf{elif}\;y \leq -2.3 \cdot 10^{+33}:\\ \;\;\;\;\frac{y}{1 - \frac{y}{z}}\\ \mathbf{elif}\;y \leq -8.6 \cdot 10^{-108}:\\ \;\;\;\;\frac{x}{1 - \frac{y}{z}}\\ \mathbf{elif}\;y \leq 2.4 \cdot 10^{+61}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 57.3% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;y \leq -1.35 \cdot 10^{+43}:\\
\;\;\;\;y\\

\mathbf{elif}\;y \leq 2.5 \cdot 10^{+62}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.12e126 or 2.50000000000000014e62 < y

    1. Initial program 79.7%

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

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

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

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

    if -1.12e126 < y < -1.3500000000000001e43

    1. Initial program 86.7%

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

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

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

    if -1.3500000000000001e43 < y < 2.50000000000000014e62

    1. Initial program 98.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.12 \cdot 10^{+126}:\\ \;\;\;\;-z\\ \mathbf{elif}\;y \leq -1.35 \cdot 10^{+43}:\\ \;\;\;\;y\\ \mathbf{elif}\;y \leq 2.5 \cdot 10^{+62}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 68.0% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.5 \cdot 10^{+123} \lor \neg \left(y \leq 1.8 \cdot 10^{+113}\right):\\
\;\;\;\;-z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -7.4999999999999999e123 or 1.79999999999999996e113 < y

    1. Initial program 78.1%

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

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

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

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

    if -7.4999999999999999e123 < y < 1.79999999999999996e113

    1. Initial program 97.1%

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

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

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

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

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

Alternative 8: 40.2% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;x \leq 1.3 \cdot 10^{-52}:\\
\;\;\;\;y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.44999999999999997e-96 or 1.2999999999999999e-52 < x

    1. Initial program 90.0%

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

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

    if -1.44999999999999997e-96 < x < 1.2999999999999999e-52

    1. Initial program 90.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.45 \cdot 10^{-96}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 1.3 \cdot 10^{-52}:\\ \;\;\;\;y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 35.3% 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 90.3%

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

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

    \[\leadsto x \]
  5. Add Preprocessing

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