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

Percentage Accurate: 88.1% → 99.7%
Time: 6.4s
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.1% 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^{-267} \lor \neg \left(t_0 \leq 0\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-267) (not (<= t_0 0.0))) 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-267) || !(t_0 <= 0.0)) {
		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-267)) .or. (.not. (t_0 <= 0.0d0))) 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-267) || !(t_0 <= 0.0)) {
		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-267) or not (t_0 <= 0.0):
		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-267) || !(t_0 <= 0.0))
		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-267) || ~((t_0 <= 0.0)))
		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-267], N[Not[LessEqual[t$95$0, 0.0]], $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^{-267} \lor \neg \left(t_0 \leq 0\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))) < -2e-267 or -0.0 < (/.f64 (+.f64 x y) (-.f64 1 (/.f64 y z)))

    1. Initial program 99.8%

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

    if -2e-267 < (/.f64 (+.f64 x y) (-.f64 1 (/.f64 y z))) < -0.0

    1. Initial program 15.5%

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

      \[\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. associate--l+99.9%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-\left(x \cdot z + \color{blue}{\left(--1\right)} \cdot {z}^{2}\right)}{y} + -1 \cdot z \]
      10. cancel-sign-sub-inv99.9%

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

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

        \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot z - -1 \cdot {z}^{2}}{y}} + -1 \cdot z \]
      13. mul-1-neg99.9%

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

        \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot z - -1 \cdot {z}^{2}}{y} - z} \]
    4. Simplified99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 71.0% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;z \leq 1.55 \cdot 10^{-158}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;z \leq 2.8 \cdot 10^{+101}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5e21 or 2.79999999999999981e101 < z

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

    if -5e21 < z < 1.55000000000000009e-158 or 5.4e-99 < z < 2.79999999999999981e101

    1. Initial program 76.1%

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

      \[\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. associate--l+77.6%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-\left(x \cdot z + \color{blue}{\left(--1\right)} \cdot {z}^{2}\right)}{y} + -1 \cdot z \]
      10. cancel-sign-sub-inv77.6%

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

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

        \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot z - -1 \cdot {z}^{2}}{y}} + -1 \cdot z \]
      13. mul-1-neg77.6%

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

        \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot z - -1 \cdot {z}^{2}}{y} - z} \]
    4. Simplified77.6%

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

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

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

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

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

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

    if 1.55000000000000009e-158 < z < 5.4e-99

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5 \cdot 10^{+21}:\\ \;\;\;\;\left(x + y\right) \cdot \left(1 + \frac{y}{z}\right)\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{-158}:\\ \;\;\;\;\left(-z\right) - \frac{x \cdot z}{y}\\ \mathbf{elif}\;z \leq 5.4 \cdot 10^{-99}:\\ \;\;\;\;\frac{x}{1 - \frac{y}{z}}\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{+101}:\\ \;\;\;\;\left(-z\right) - \frac{x \cdot z}{y}\\ \mathbf{else}:\\ \;\;\;\;\left(x + y\right) \cdot \left(1 + \frac{y}{z}\right)\\ \end{array} \]

Alternative 3: 71.3% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;z \leq 1.55 \cdot 10^{-158}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;z \leq 1.15 \cdot 10^{+90}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -7.8e21 or 1.15e90 < z

    1. Initial program 99.9%

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

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

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

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

    if -7.8e21 < z < 1.55000000000000009e-158 or 5.4e-99 < z < 1.15e90

    1. Initial program 75.8%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Taylor expanded in y around inf 78.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. associate--l+78.0%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-\left(x \cdot z + \color{blue}{\left(--1\right)} \cdot {z}^{2}\right)}{y} + -1 \cdot z \]
      10. cancel-sign-sub-inv78.0%

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

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

        \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot z - -1 \cdot {z}^{2}}{y}} + -1 \cdot z \]
      13. mul-1-neg78.0%

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

        \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot z - -1 \cdot {z}^{2}}{y} - z} \]
    4. Simplified78.0%

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

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

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

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

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

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

    if 1.55000000000000009e-158 < z < 5.4e-99

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.8 \cdot 10^{+21}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{-158}:\\ \;\;\;\;\left(-z\right) - \frac{x \cdot z}{y}\\ \mathbf{elif}\;z \leq 5.4 \cdot 10^{-99}:\\ \;\;\;\;\frac{x}{1 - \frac{y}{z}}\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{+90}:\\ \;\;\;\;\left(-z\right) - \frac{x \cdot z}{y}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 4: 74.9% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;y \leq -4.2 \cdot 10^{-166}:\\
\;\;\;\;x + y\\

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

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -7.49999999999999998e62 or 5.9e13 < y

    1. Initial program 71.7%

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

      \[\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. associate--l+71.3%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-\left(x \cdot z + \color{blue}{\left(--1\right)} \cdot {z}^{2}\right)}{y} + -1 \cdot z \]
      10. cancel-sign-sub-inv71.3%

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

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

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

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

        \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot z - -1 \cdot {z}^{2}}{y} - z} \]
    4. Simplified71.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.49999999999999998e62 < y < -4.1999999999999999e-166

    1. Initial program 99.9%

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

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

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

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

    if -4.1999999999999999e-166 < y < 5.9e13

    1. Initial program 99.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.5 \cdot 10^{+62}:\\ \;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\ \mathbf{elif}\;y \leq -4.2 \cdot 10^{-166}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;y \leq 59000000000000:\\ \;\;\;\;\frac{x}{1 - \frac{y}{z}}\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\ \end{array} \]

Alternative 5: 74.9% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -4.2 \cdot 10^{+67} \lor \neg \left(y \leq 3000000000000\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 -4.2e+67) (not (<= y 3000000000000.0)))
   (* z (- -1.0 (/ x y)))
   (+ x y)))
double code(double x, double y, double z) {
	double tmp;
	if ((y <= -4.2e+67) || !(y <= 3000000000000.0)) {
		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 <= (-4.2d+67)) .or. (.not. (y <= 3000000000000.0d0))) 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 <= -4.2e+67) || !(y <= 3000000000000.0)) {
		tmp = z * (-1.0 - (x / y));
	} else {
		tmp = x + y;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (y <= -4.2e+67) or not (y <= 3000000000000.0):
		tmp = z * (-1.0 - (x / y))
	else:
		tmp = x + y
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((y <= -4.2e+67) || !(y <= 3000000000000.0))
		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 <= -4.2e+67) || ~((y <= 3000000000000.0)))
		tmp = z * (-1.0 - (x / y));
	else
		tmp = x + y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[y, -4.2e+67], N[Not[LessEqual[y, 3000000000000.0]], $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 -4.2 \cdot 10^{+67} \lor \neg \left(y \leq 3000000000000\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 < -4.2000000000000003e67 or 3e12 < y

    1. Initial program 71.7%

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

      \[\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. associate--l+71.3%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{-\left(x \cdot z + \color{blue}{\left(--1\right)} \cdot {z}^{2}\right)}{y} + -1 \cdot z \]
      10. cancel-sign-sub-inv71.3%

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

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

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

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

        \[\leadsto \color{blue}{-1 \cdot \frac{x \cdot z - -1 \cdot {z}^{2}}{y} - z} \]
    4. Simplified71.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.2000000000000003e67 < y < 3e12

    1. Initial program 99.8%

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

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

        \[\leadsto \color{blue}{y + x} \]
    4. Simplified73.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.2 \cdot 10^{+67} \lor \neg \left(y \leq 3000000000000\right):\\ \;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 6: 58.3% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;y \leq -2.85 \cdot 10^{-64}:\\
\;\;\;\;y\\

\mathbf{elif}\;y \leq 480000000:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.6000000000000001e55 or 4.8e8 < y

    1. Initial program 72.5%

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

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

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

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

    if -1.6000000000000001e55 < y < -2.8500000000000001e-64

    1. Initial program 99.9%

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

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

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

    if -2.8500000000000001e-64 < y < 4.8e8

    1. Initial program 99.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.6 \cdot 10^{+55}:\\ \;\;\;\;-z\\ \mathbf{elif}\;y \leq -2.85 \cdot 10^{-64}:\\ \;\;\;\;y\\ \mathbf{elif}\;y \leq 480000000:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \]

Alternative 7: 67.8% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.6 \cdot 10^{+59} \lor \neg \left(y \leq 4 \cdot 10^{+14}\right):\\
\;\;\;\;-z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.59999999999999999e59 or 4e14 < y

    1. Initial program 71.7%

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

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

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

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

    if -2.59999999999999999e59 < y < 4e14

    1. Initial program 99.8%

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

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

        \[\leadsto \color{blue}{y + x} \]
    4. Simplified73.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.6 \cdot 10^{+59} \lor \neg \left(y \leq 4 \cdot 10^{+14}\right):\\ \;\;\;\;-z\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 8: 41.0% accurate, 1.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.3999999999999998e-84 or 2.29999999999999992e-45 < x

    1. Initial program 85.2%

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

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

    if -4.3999999999999998e-84 < x < 2.29999999999999992e-45

    1. Initial program 90.4%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.4 \cdot 10^{-84}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 2.3 \cdot 10^{-45}:\\ \;\;\;\;y\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 9: 35.2% accurate, 9.0× speedup?

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

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

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

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

    \[\leadsto x \]

Developer target: 94.0% 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 2023322 
(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))))