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

Percentage Accurate: 88.1% → 99.7%
Time: 5.8s
Alternatives: 11
Speedup: 0.3×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 11 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

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

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

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


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

    1. Initial program 99.9%

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

    if -9.99999999999999963e-272 < (/.f64 (+.f64 x y) (-.f64 1 (/.f64 y z))) < 0.0

    1. Initial program 9.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 70.8% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(x + y\right) \cdot \left(1 + \frac{y}{z}\right)\\ t_1 := \left(-z\right) - \frac{z}{\frac{y}{x}}\\ \mathbf{if}\;z \leq -8 \cdot 10^{+128}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -2 \cdot 10^{+78}:\\ \;\;\;\;\left(-z\right) - z \cdot \frac{x}{y}\\ \mathbf{elif}\;z \leq -25000000000000:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -4 \cdot 10^{-294}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 9.4 \cdot 10^{-294}:\\ \;\;\;\;\frac{x}{1 - \frac{y}{z}}\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-31}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* (+ x y) (+ 1.0 (/ y z)))) (t_1 (- (- z) (/ z (/ y x)))))
   (if (<= z -8e+128)
     t_0
     (if (<= z -2e+78)
       (- (- z) (* z (/ x y)))
       (if (<= z -25000000000000.0)
         t_0
         (if (<= z -4e-294)
           t_1
           (if (<= z 9.4e-294)
             (/ x (- 1.0 (/ y z)))
             (if (<= z 5.5e-31) t_1 t_0))))))))
double code(double x, double y, double z) {
	double t_0 = (x + y) * (1.0 + (y / z));
	double t_1 = -z - (z / (y / x));
	double tmp;
	if (z <= -8e+128) {
		tmp = t_0;
	} else if (z <= -2e+78) {
		tmp = -z - (z * (x / y));
	} else if (z <= -25000000000000.0) {
		tmp = t_0;
	} else if (z <= -4e-294) {
		tmp = t_1;
	} else if (z <= 9.4e-294) {
		tmp = x / (1.0 - (y / z));
	} else if (z <= 5.5e-31) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_0 = (x + y) * (1.0d0 + (y / z))
    t_1 = -z - (z / (y / x))
    if (z <= (-8d+128)) then
        tmp = t_0
    else if (z <= (-2d+78)) then
        tmp = -z - (z * (x / y))
    else if (z <= (-25000000000000.0d0)) then
        tmp = t_0
    else if (z <= (-4d-294)) then
        tmp = t_1
    else if (z <= 9.4d-294) then
        tmp = x / (1.0d0 - (y / z))
    else if (z <= 5.5d-31) then
        tmp = t_1
    else
        tmp = t_0
    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 t_1 = -z - (z / (y / x));
	double tmp;
	if (z <= -8e+128) {
		tmp = t_0;
	} else if (z <= -2e+78) {
		tmp = -z - (z * (x / y));
	} else if (z <= -25000000000000.0) {
		tmp = t_0;
	} else if (z <= -4e-294) {
		tmp = t_1;
	} else if (z <= 9.4e-294) {
		tmp = x / (1.0 - (y / z));
	} else if (z <= 5.5e-31) {
		tmp = t_1;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = (x + y) * (1.0 + (y / z))
	t_1 = -z - (z / (y / x))
	tmp = 0
	if z <= -8e+128:
		tmp = t_0
	elif z <= -2e+78:
		tmp = -z - (z * (x / y))
	elif z <= -25000000000000.0:
		tmp = t_0
	elif z <= -4e-294:
		tmp = t_1
	elif z <= 9.4e-294:
		tmp = x / (1.0 - (y / z))
	elif z <= 5.5e-31:
		tmp = t_1
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(Float64(x + y) * Float64(1.0 + Float64(y / z)))
	t_1 = Float64(Float64(-z) - Float64(z / Float64(y / x)))
	tmp = 0.0
	if (z <= -8e+128)
		tmp = t_0;
	elseif (z <= -2e+78)
		tmp = Float64(Float64(-z) - Float64(z * Float64(x / y)));
	elseif (z <= -25000000000000.0)
		tmp = t_0;
	elseif (z <= -4e-294)
		tmp = t_1;
	elseif (z <= 9.4e-294)
		tmp = Float64(x / Float64(1.0 - Float64(y / z)));
	elseif (z <= 5.5e-31)
		tmp = t_1;
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = (x + y) * (1.0 + (y / z));
	t_1 = -z - (z / (y / x));
	tmp = 0.0;
	if (z <= -8e+128)
		tmp = t_0;
	elseif (z <= -2e+78)
		tmp = -z - (z * (x / y));
	elseif (z <= -25000000000000.0)
		tmp = t_0;
	elseif (z <= -4e-294)
		tmp = t_1;
	elseif (z <= 9.4e-294)
		tmp = x / (1.0 - (y / z));
	elseif (z <= 5.5e-31)
		tmp = t_1;
	else
		tmp = t_0;
	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]}, Block[{t$95$1 = N[((-z) - N[(z / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8e+128], t$95$0, If[LessEqual[z, -2e+78], N[((-z) - N[(z * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -25000000000000.0], t$95$0, If[LessEqual[z, -4e-294], t$95$1, If[LessEqual[z, 9.4e-294], N[(x / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.5e-31], t$95$1, t$95$0]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;z \leq -25000000000000:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq -4 \cdot 10^{-294}:\\
\;\;\;\;t_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -8.0000000000000006e128 or -2.00000000000000002e78 < z < -2.5e13 or 5.49999999999999958e-31 < z

    1. Initial program 99.9%

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

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

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

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

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

        \[\leadsto \frac{y}{z} \cdot \left(x + y\right) + \color{blue}{\left(x + y\right)} \]
      5. *-lft-identity82.3%

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

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

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

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

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

    if -8.0000000000000006e128 < z < -2.00000000000000002e78

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(-z\right) - \frac{z}{\frac{y}{x}}} \]
    8. Step-by-step derivation
      1. clear-num100.0%

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

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

        \[\leadsto \left(-z\right) - \color{blue}{\frac{x}{y}} \cdot z \]
    9. Applied egg-rr100.0%

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

    if -2.5e13 < z < -4.00000000000000007e-294 or 9.4000000000000003e-294 < z < 5.49999999999999958e-31

    1. Initial program 74.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.00000000000000007e-294 < z < 9.4000000000000003e-294

    1. Initial program 90.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8 \cdot 10^{+128}:\\ \;\;\;\;\left(x + y\right) \cdot \left(1 + \frac{y}{z}\right)\\ \mathbf{elif}\;z \leq -2 \cdot 10^{+78}:\\ \;\;\;\;\left(-z\right) - z \cdot \frac{x}{y}\\ \mathbf{elif}\;z \leq -25000000000000:\\ \;\;\;\;\left(x + y\right) \cdot \left(1 + \frac{y}{z}\right)\\ \mathbf{elif}\;z \leq -4 \cdot 10^{-294}:\\ \;\;\;\;\left(-z\right) - \frac{z}{\frac{y}{x}}\\ \mathbf{elif}\;z \leq 9.4 \cdot 10^{-294}:\\ \;\;\;\;\frac{x}{1 - \frac{y}{z}}\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-31}:\\ \;\;\;\;\left(-z\right) - \frac{z}{\frac{y}{x}}\\ \mathbf{else}:\\ \;\;\;\;\left(x + y\right) \cdot \left(1 + \frac{y}{z}\right)\\ \end{array} \]

Alternative 3: 68.4% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;y \leq -1.2 \cdot 10^{-40}:\\
\;\;\;\;x + y\\

\mathbf{elif}\;y \leq -5.4 \cdot 10^{-71}:\\
\;\;\;\;\frac{y}{t_0}\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -2.8999999999999998e104 or 7.5000000000000004e154 < y

    1. Initial program 64.0%

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

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

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

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

    if -2.8999999999999998e104 < y < -1.19999999999999996e-40 or 4.29999999999999996e-162 < y < 7.2999999999999998e-62

    1. Initial program 97.9%

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

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

    if -1.19999999999999996e-40 < y < -5.4000000000000003e-71

    1. Initial program 99.8%

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

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

    if -5.4000000000000003e-71 < y < 4.29999999999999996e-162

    1. Initial program 99.9%

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

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

    if 7.2999999999999998e-62 < y < 7.5000000000000004e154

    1. Initial program 94.7%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Step-by-step derivation
      1. clear-num94.2%

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

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

      \[\leadsto \color{blue}{\frac{1}{1 - \frac{y}{z}} \cdot \left(x + y\right)} \]
    4. Taylor expanded in y around inf 64.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.9 \cdot 10^{+104}:\\ \;\;\;\;-z\\ \mathbf{elif}\;y \leq -1.2 \cdot 10^{-40}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;y \leq -5.4 \cdot 10^{-71}:\\ \;\;\;\;\frac{y}{1 - \frac{y}{z}}\\ \mathbf{elif}\;y \leq 4.3 \cdot 10^{-162}:\\ \;\;\;\;\frac{x}{1 - \frac{y}{z}}\\ \mathbf{elif}\;y \leq 7.3 \cdot 10^{-62}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;y \leq 7.5 \cdot 10^{+154}:\\ \;\;\;\;\left(x + y\right) \cdot \left(-\frac{z}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \]

Alternative 4: 70.9% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(-z\right) - z \cdot \frac{x}{y}\\ \mathbf{if}\;z \leq -8 \cdot 10^{+128}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq -9 \cdot 10^{+80}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq -1380000000000:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq -8.8 \cdot 10^{-294}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{-294}:\\ \;\;\;\;\frac{x}{1 - \frac{y}{z}}\\ \mathbf{elif}\;z \leq 5.1 \cdot 10^{-30}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (- (- z) (* z (/ x y)))))
   (if (<= z -8e+128)
     (+ x y)
     (if (<= z -9e+80)
       t_0
       (if (<= z -1380000000000.0)
         (+ x y)
         (if (<= z -8.8e-294)
           t_0
           (if (<= z 2.8e-294)
             (/ x (- 1.0 (/ y z)))
             (if (<= z 5.1e-30) t_0 (+ x y)))))))))
double code(double x, double y, double z) {
	double t_0 = -z - (z * (x / y));
	double tmp;
	if (z <= -8e+128) {
		tmp = x + y;
	} else if (z <= -9e+80) {
		tmp = t_0;
	} else if (z <= -1380000000000.0) {
		tmp = x + y;
	} else if (z <= -8.8e-294) {
		tmp = t_0;
	} else if (z <= 2.8e-294) {
		tmp = x / (1.0 - (y / z));
	} else if (z <= 5.1e-30) {
		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 - (z * (x / y))
    if (z <= (-8d+128)) then
        tmp = x + y
    else if (z <= (-9d+80)) then
        tmp = t_0
    else if (z <= (-1380000000000.0d0)) then
        tmp = x + y
    else if (z <= (-8.8d-294)) then
        tmp = t_0
    else if (z <= 2.8d-294) then
        tmp = x / (1.0d0 - (y / z))
    else if (z <= 5.1d-30) 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 - (z * (x / y));
	double tmp;
	if (z <= -8e+128) {
		tmp = x + y;
	} else if (z <= -9e+80) {
		tmp = t_0;
	} else if (z <= -1380000000000.0) {
		tmp = x + y;
	} else if (z <= -8.8e-294) {
		tmp = t_0;
	} else if (z <= 2.8e-294) {
		tmp = x / (1.0 - (y / z));
	} else if (z <= 5.1e-30) {
		tmp = t_0;
	} else {
		tmp = x + y;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -z - (z * (x / y))
	tmp = 0
	if z <= -8e+128:
		tmp = x + y
	elif z <= -9e+80:
		tmp = t_0
	elif z <= -1380000000000.0:
		tmp = x + y
	elif z <= -8.8e-294:
		tmp = t_0
	elif z <= 2.8e-294:
		tmp = x / (1.0 - (y / z))
	elif z <= 5.1e-30:
		tmp = t_0
	else:
		tmp = x + y
	return tmp
function code(x, y, z)
	t_0 = Float64(Float64(-z) - Float64(z * Float64(x / y)))
	tmp = 0.0
	if (z <= -8e+128)
		tmp = Float64(x + y);
	elseif (z <= -9e+80)
		tmp = t_0;
	elseif (z <= -1380000000000.0)
		tmp = Float64(x + y);
	elseif (z <= -8.8e-294)
		tmp = t_0;
	elseif (z <= 2.8e-294)
		tmp = Float64(x / Float64(1.0 - Float64(y / z)));
	elseif (z <= 5.1e-30)
		tmp = t_0;
	else
		tmp = Float64(x + y);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = -z - (z * (x / y));
	tmp = 0.0;
	if (z <= -8e+128)
		tmp = x + y;
	elseif (z <= -9e+80)
		tmp = t_0;
	elseif (z <= -1380000000000.0)
		tmp = x + y;
	elseif (z <= -8.8e-294)
		tmp = t_0;
	elseif (z <= 2.8e-294)
		tmp = x / (1.0 - (y / z));
	elseif (z <= 5.1e-30)
		tmp = t_0;
	else
		tmp = x + y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[((-z) - N[(z * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8e+128], N[(x + y), $MachinePrecision], If[LessEqual[z, -9e+80], t$95$0, If[LessEqual[z, -1380000000000.0], N[(x + y), $MachinePrecision], If[LessEqual[z, -8.8e-294], t$95$0, If[LessEqual[z, 2.8e-294], N[(x / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.1e-30], t$95$0, N[(x + y), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -9 \cdot 10^{+80}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;z \leq -1380000000000:\\
\;\;\;\;x + y\\

\mathbf{elif}\;z \leq -8.8 \cdot 10^{-294}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;z \leq 5.1 \cdot 10^{-30}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -8.0000000000000006e128 or -9.00000000000000013e80 < z < -1.38e12 or 5.09999999999999972e-30 < z

    1. Initial program 99.9%

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

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

    if -8.0000000000000006e128 < z < -9.00000000000000013e80 or -1.38e12 < z < -8.8e-294 or 2.79999999999999991e-294 < z < 5.09999999999999972e-30

    1. Initial program 76.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(-z\right) - \color{blue}{\frac{x}{y}} \cdot z \]
    9. Applied egg-rr76.5%

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

    if -8.8e-294 < z < 2.79999999999999991e-294

    1. Initial program 90.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8 \cdot 10^{+128}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq -9 \cdot 10^{+80}:\\ \;\;\;\;\left(-z\right) - z \cdot \frac{x}{y}\\ \mathbf{elif}\;z \leq -1380000000000:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq -8.8 \cdot 10^{-294}:\\ \;\;\;\;\left(-z\right) - z \cdot \frac{x}{y}\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{-294}:\\ \;\;\;\;\frac{x}{1 - \frac{y}{z}}\\ \mathbf{elif}\;z \leq 5.1 \cdot 10^{-30}:\\ \;\;\;\;\left(-z\right) - z \cdot \frac{x}{y}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 5: 71.0% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(-z\right) - \frac{z}{\frac{y}{x}}\\ \mathbf{if}\;z \leq -8 \cdot 10^{+128}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq -3.7 \cdot 10^{+79}:\\ \;\;\;\;\left(-z\right) - z \cdot \frac{x}{y}\\ \mathbf{elif}\;z \leq -15200000:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq -4 \cdot 10^{-294}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;z \leq 9.4 \cdot 10^{-294}:\\ \;\;\;\;\frac{x}{1 - \frac{y}{z}}\\ \mathbf{elif}\;z \leq 2 \cdot 10^{-32}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (- (- z) (/ z (/ y x)))))
   (if (<= z -8e+128)
     (+ x y)
     (if (<= z -3.7e+79)
       (- (- z) (* z (/ x y)))
       (if (<= z -15200000.0)
         (+ x y)
         (if (<= z -4e-294)
           t_0
           (if (<= z 9.4e-294)
             (/ x (- 1.0 (/ y z)))
             (if (<= z 2e-32) t_0 (+ x y)))))))))
double code(double x, double y, double z) {
	double t_0 = -z - (z / (y / x));
	double tmp;
	if (z <= -8e+128) {
		tmp = x + y;
	} else if (z <= -3.7e+79) {
		tmp = -z - (z * (x / y));
	} else if (z <= -15200000.0) {
		tmp = x + y;
	} else if (z <= -4e-294) {
		tmp = t_0;
	} else if (z <= 9.4e-294) {
		tmp = x / (1.0 - (y / z));
	} else if (z <= 2e-32) {
		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 - (z / (y / x))
    if (z <= (-8d+128)) then
        tmp = x + y
    else if (z <= (-3.7d+79)) then
        tmp = -z - (z * (x / y))
    else if (z <= (-15200000.0d0)) then
        tmp = x + y
    else if (z <= (-4d-294)) then
        tmp = t_0
    else if (z <= 9.4d-294) then
        tmp = x / (1.0d0 - (y / z))
    else if (z <= 2d-32) 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 - (z / (y / x));
	double tmp;
	if (z <= -8e+128) {
		tmp = x + y;
	} else if (z <= -3.7e+79) {
		tmp = -z - (z * (x / y));
	} else if (z <= -15200000.0) {
		tmp = x + y;
	} else if (z <= -4e-294) {
		tmp = t_0;
	} else if (z <= 9.4e-294) {
		tmp = x / (1.0 - (y / z));
	} else if (z <= 2e-32) {
		tmp = t_0;
	} else {
		tmp = x + y;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = -z - (z / (y / x))
	tmp = 0
	if z <= -8e+128:
		tmp = x + y
	elif z <= -3.7e+79:
		tmp = -z - (z * (x / y))
	elif z <= -15200000.0:
		tmp = x + y
	elif z <= -4e-294:
		tmp = t_0
	elif z <= 9.4e-294:
		tmp = x / (1.0 - (y / z))
	elif z <= 2e-32:
		tmp = t_0
	else:
		tmp = x + y
	return tmp
function code(x, y, z)
	t_0 = Float64(Float64(-z) - Float64(z / Float64(y / x)))
	tmp = 0.0
	if (z <= -8e+128)
		tmp = Float64(x + y);
	elseif (z <= -3.7e+79)
		tmp = Float64(Float64(-z) - Float64(z * Float64(x / y)));
	elseif (z <= -15200000.0)
		tmp = Float64(x + y);
	elseif (z <= -4e-294)
		tmp = t_0;
	elseif (z <= 9.4e-294)
		tmp = Float64(x / Float64(1.0 - Float64(y / z)));
	elseif (z <= 2e-32)
		tmp = t_0;
	else
		tmp = Float64(x + y);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = -z - (z / (y / x));
	tmp = 0.0;
	if (z <= -8e+128)
		tmp = x + y;
	elseif (z <= -3.7e+79)
		tmp = -z - (z * (x / y));
	elseif (z <= -15200000.0)
		tmp = x + y;
	elseif (z <= -4e-294)
		tmp = t_0;
	elseif (z <= 9.4e-294)
		tmp = x / (1.0 - (y / z));
	elseif (z <= 2e-32)
		tmp = t_0;
	else
		tmp = x + y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[((-z) - N[(z / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8e+128], N[(x + y), $MachinePrecision], If[LessEqual[z, -3.7e+79], N[((-z) - N[(z * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -15200000.0], N[(x + y), $MachinePrecision], If[LessEqual[z, -4e-294], t$95$0, If[LessEqual[z, 9.4e-294], N[(x / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2e-32], t$95$0, N[(x + y), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;z \leq -15200000:\\
\;\;\;\;x + y\\

\mathbf{elif}\;z \leq -4 \cdot 10^{-294}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;z \leq 2 \cdot 10^{-32}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -8.0000000000000006e128 or -3.70000000000000009e79 < z < -1.52e7 or 2.00000000000000011e-32 < z

    1. Initial program 99.9%

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

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

    if -8.0000000000000006e128 < z < -3.70000000000000009e79

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(-z\right) - \frac{z}{\frac{y}{x}}} \]
    8. Step-by-step derivation
      1. clear-num100.0%

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

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

        \[\leadsto \left(-z\right) - \color{blue}{\frac{x}{y}} \cdot z \]
    9. Applied egg-rr100.0%

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

    if -1.52e7 < z < -4.00000000000000007e-294 or 9.4000000000000003e-294 < z < 2.00000000000000011e-32

    1. Initial program 74.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.00000000000000007e-294 < z < 9.4000000000000003e-294

    1. Initial program 90.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8 \cdot 10^{+128}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq -3.7 \cdot 10^{+79}:\\ \;\;\;\;\left(-z\right) - z \cdot \frac{x}{y}\\ \mathbf{elif}\;z \leq -15200000:\\ \;\;\;\;x + y\\ \mathbf{elif}\;z \leq -4 \cdot 10^{-294}:\\ \;\;\;\;\left(-z\right) - \frac{z}{\frac{y}{x}}\\ \mathbf{elif}\;z \leq 9.4 \cdot 10^{-294}:\\ \;\;\;\;\frac{x}{1 - \frac{y}{z}}\\ \mathbf{elif}\;z \leq 2 \cdot 10^{-32}:\\ \;\;\;\;\left(-z\right) - \frac{z}{\frac{y}{x}}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]

Alternative 6: 67.4% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 1 - \frac{y}{z}\\ t_1 := \frac{x}{t_0}\\ \mathbf{if}\;y \leq -6 \cdot 10^{+104}:\\ \;\;\;\;-z\\ \mathbf{elif}\;y \leq -2.15 \cdot 10^{-40}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;y \leq -5.8 \cdot 10^{-69}:\\ \;\;\;\;\frac{y}{t_0}\\ \mathbf{elif}\;y \leq 1.15 \cdot 10^{-160}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 9.2 \cdot 10^{-43}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;y \leq 2.95 \cdot 10^{+26}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (- 1.0 (/ y z))) (t_1 (/ x t_0)))
   (if (<= y -6e+104)
     (- z)
     (if (<= y -2.15e-40)
       (+ x y)
       (if (<= y -5.8e-69)
         (/ y t_0)
         (if (<= y 1.15e-160)
           t_1
           (if (<= y 9.2e-43) (+ x y) (if (<= y 2.95e+26) t_1 (- z)))))))))
double code(double x, double y, double z) {
	double t_0 = 1.0 - (y / z);
	double t_1 = x / t_0;
	double tmp;
	if (y <= -6e+104) {
		tmp = -z;
	} else if (y <= -2.15e-40) {
		tmp = x + y;
	} else if (y <= -5.8e-69) {
		tmp = y / t_0;
	} else if (y <= 1.15e-160) {
		tmp = t_1;
	} else if (y <= 9.2e-43) {
		tmp = x + y;
	} else if (y <= 2.95e+26) {
		tmp = t_1;
	} else {
		tmp = -z;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = 1.0d0 - (y / z)
    t_1 = x / t_0
    if (y <= (-6d+104)) then
        tmp = -z
    else if (y <= (-2.15d-40)) then
        tmp = x + y
    else if (y <= (-5.8d-69)) then
        tmp = y / t_0
    else if (y <= 1.15d-160) then
        tmp = t_1
    else if (y <= 9.2d-43) then
        tmp = x + y
    else if (y <= 2.95d+26) then
        tmp = t_1
    else
        tmp = -z
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = 1.0 - (y / z);
	double t_1 = x / t_0;
	double tmp;
	if (y <= -6e+104) {
		tmp = -z;
	} else if (y <= -2.15e-40) {
		tmp = x + y;
	} else if (y <= -5.8e-69) {
		tmp = y / t_0;
	} else if (y <= 1.15e-160) {
		tmp = t_1;
	} else if (y <= 9.2e-43) {
		tmp = x + y;
	} else if (y <= 2.95e+26) {
		tmp = t_1;
	} else {
		tmp = -z;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = 1.0 - (y / z)
	t_1 = x / t_0
	tmp = 0
	if y <= -6e+104:
		tmp = -z
	elif y <= -2.15e-40:
		tmp = x + y
	elif y <= -5.8e-69:
		tmp = y / t_0
	elif y <= 1.15e-160:
		tmp = t_1
	elif y <= 9.2e-43:
		tmp = x + y
	elif y <= 2.95e+26:
		tmp = t_1
	else:
		tmp = -z
	return tmp
function code(x, y, z)
	t_0 = Float64(1.0 - Float64(y / z))
	t_1 = Float64(x / t_0)
	tmp = 0.0
	if (y <= -6e+104)
		tmp = Float64(-z);
	elseif (y <= -2.15e-40)
		tmp = Float64(x + y);
	elseif (y <= -5.8e-69)
		tmp = Float64(y / t_0);
	elseif (y <= 1.15e-160)
		tmp = t_1;
	elseif (y <= 9.2e-43)
		tmp = Float64(x + y);
	elseif (y <= 2.95e+26)
		tmp = t_1;
	else
		tmp = Float64(-z);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = 1.0 - (y / z);
	t_1 = x / t_0;
	tmp = 0.0;
	if (y <= -6e+104)
		tmp = -z;
	elseif (y <= -2.15e-40)
		tmp = x + y;
	elseif (y <= -5.8e-69)
		tmp = y / t_0;
	elseif (y <= 1.15e-160)
		tmp = t_1;
	elseif (y <= 9.2e-43)
		tmp = x + y;
	elseif (y <= 2.95e+26)
		tmp = t_1;
	else
		tmp = -z;
	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[(x / t$95$0), $MachinePrecision]}, If[LessEqual[y, -6e+104], (-z), If[LessEqual[y, -2.15e-40], N[(x + y), $MachinePrecision], If[LessEqual[y, -5.8e-69], N[(y / t$95$0), $MachinePrecision], If[LessEqual[y, 1.15e-160], t$95$1, If[LessEqual[y, 9.2e-43], N[(x + y), $MachinePrecision], If[LessEqual[y, 2.95e+26], t$95$1, (-z)]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -2.15 \cdot 10^{-40}:\\
\;\;\;\;x + y\\

\mathbf{elif}\;y \leq -5.8 \cdot 10^{-69}:\\
\;\;\;\;\frac{y}{t_0}\\

\mathbf{elif}\;y \leq 1.15 \cdot 10^{-160}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;y \leq 2.95 \cdot 10^{+26}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -5.99999999999999937e104 or 2.95000000000000015e26 < y

    1. Initial program 69.9%

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

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

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

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

    if -5.99999999999999937e104 < y < -2.1500000000000001e-40 or 1.14999999999999992e-160 < y < 9.1999999999999995e-43

    1. Initial program 98.0%

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

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

    if -2.1500000000000001e-40 < y < -5.7999999999999997e-69

    1. Initial program 99.8%

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

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

    if -5.7999999999999997e-69 < y < 1.14999999999999992e-160 or 9.1999999999999995e-43 < y < 2.95000000000000015e26

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6 \cdot 10^{+104}:\\ \;\;\;\;-z\\ \mathbf{elif}\;y \leq -2.15 \cdot 10^{-40}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;y \leq -5.8 \cdot 10^{-69}:\\ \;\;\;\;\frac{y}{1 - \frac{y}{z}}\\ \mathbf{elif}\;y \leq 1.15 \cdot 10^{-160}:\\ \;\;\;\;\frac{x}{1 - \frac{y}{z}}\\ \mathbf{elif}\;y \leq 9.2 \cdot 10^{-43}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;y \leq 2.95 \cdot 10^{+26}:\\ \;\;\;\;\frac{x}{1 - \frac{y}{z}}\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \]

Alternative 7: 67.1% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x}{1 - \frac{y}{z}}\\ \mathbf{if}\;y \leq -2.4 \cdot 10^{+104}:\\ \;\;\;\;-z\\ \mathbf{elif}\;y \leq -1.6 \cdot 10^{-205}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{-161}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 8 \cdot 10^{-40}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;y \leq 7.2 \cdot 10^{+22}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y \leq 5.7 \cdot 10^{+72}:\\ \;\;\;\;-z\\ \mathbf{elif}\;y \leq 1.95 \cdot 10^{+120}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (/ x (- 1.0 (/ y z)))))
   (if (<= y -2.4e+104)
     (- z)
     (if (<= y -1.6e-205)
       (+ x y)
       (if (<= y 4.2e-161)
         t_0
         (if (<= y 8e-40)
           (+ x y)
           (if (<= y 7.2e+22)
             t_0
             (if (<= y 5.7e+72)
               (- z)
               (if (<= y 1.95e+120) (+ x y) (- z))))))))))
double code(double x, double y, double z) {
	double t_0 = x / (1.0 - (y / z));
	double tmp;
	if (y <= -2.4e+104) {
		tmp = -z;
	} else if (y <= -1.6e-205) {
		tmp = x + y;
	} else if (y <= 4.2e-161) {
		tmp = t_0;
	} else if (y <= 8e-40) {
		tmp = x + y;
	} else if (y <= 7.2e+22) {
		tmp = t_0;
	} else if (y <= 5.7e+72) {
		tmp = -z;
	} else if (y <= 1.95e+120) {
		tmp = x + y;
	} else {
		tmp = -z;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = x / (1.0d0 - (y / z))
    if (y <= (-2.4d+104)) then
        tmp = -z
    else if (y <= (-1.6d-205)) then
        tmp = x + y
    else if (y <= 4.2d-161) then
        tmp = t_0
    else if (y <= 8d-40) then
        tmp = x + y
    else if (y <= 7.2d+22) then
        tmp = t_0
    else if (y <= 5.7d+72) then
        tmp = -z
    else if (y <= 1.95d+120) then
        tmp = x + y
    else
        tmp = -z
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = x / (1.0 - (y / z));
	double tmp;
	if (y <= -2.4e+104) {
		tmp = -z;
	} else if (y <= -1.6e-205) {
		tmp = x + y;
	} else if (y <= 4.2e-161) {
		tmp = t_0;
	} else if (y <= 8e-40) {
		tmp = x + y;
	} else if (y <= 7.2e+22) {
		tmp = t_0;
	} else if (y <= 5.7e+72) {
		tmp = -z;
	} else if (y <= 1.95e+120) {
		tmp = x + y;
	} else {
		tmp = -z;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = x / (1.0 - (y / z))
	tmp = 0
	if y <= -2.4e+104:
		tmp = -z
	elif y <= -1.6e-205:
		tmp = x + y
	elif y <= 4.2e-161:
		tmp = t_0
	elif y <= 8e-40:
		tmp = x + y
	elif y <= 7.2e+22:
		tmp = t_0
	elif y <= 5.7e+72:
		tmp = -z
	elif y <= 1.95e+120:
		tmp = x + y
	else:
		tmp = -z
	return tmp
function code(x, y, z)
	t_0 = Float64(x / Float64(1.0 - Float64(y / z)))
	tmp = 0.0
	if (y <= -2.4e+104)
		tmp = Float64(-z);
	elseif (y <= -1.6e-205)
		tmp = Float64(x + y);
	elseif (y <= 4.2e-161)
		tmp = t_0;
	elseif (y <= 8e-40)
		tmp = Float64(x + y);
	elseif (y <= 7.2e+22)
		tmp = t_0;
	elseif (y <= 5.7e+72)
		tmp = Float64(-z);
	elseif (y <= 1.95e+120)
		tmp = Float64(x + y);
	else
		tmp = Float64(-z);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = x / (1.0 - (y / z));
	tmp = 0.0;
	if (y <= -2.4e+104)
		tmp = -z;
	elseif (y <= -1.6e-205)
		tmp = x + y;
	elseif (y <= 4.2e-161)
		tmp = t_0;
	elseif (y <= 8e-40)
		tmp = x + y;
	elseif (y <= 7.2e+22)
		tmp = t_0;
	elseif (y <= 5.7e+72)
		tmp = -z;
	elseif (y <= 1.95e+120)
		tmp = x + y;
	else
		tmp = -z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(x / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.4e+104], (-z), If[LessEqual[y, -1.6e-205], N[(x + y), $MachinePrecision], If[LessEqual[y, 4.2e-161], t$95$0, If[LessEqual[y, 8e-40], N[(x + y), $MachinePrecision], If[LessEqual[y, 7.2e+22], t$95$0, If[LessEqual[y, 5.7e+72], (-z), If[LessEqual[y, 1.95e+120], N[(x + y), $MachinePrecision], (-z)]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -1.6 \cdot 10^{-205}:\\
\;\;\;\;x + y\\

\mathbf{elif}\;y \leq 4.2 \cdot 10^{-161}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y \leq 8 \cdot 10^{-40}:\\
\;\;\;\;x + y\\

\mathbf{elif}\;y \leq 7.2 \cdot 10^{+22}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y \leq 5.7 \cdot 10^{+72}:\\
\;\;\;\;-z\\

\mathbf{elif}\;y \leq 1.95 \cdot 10^{+120}:\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.4e104 or 7.2e22 < y < 5.6999999999999997e72 or 1.9499999999999999e120 < y

    1. Initial program 67.2%

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

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

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

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

    if -2.4e104 < y < -1.60000000000000005e-205 or 4.2000000000000001e-161 < y < 7.9999999999999994e-40 or 5.6999999999999997e72 < y < 1.9499999999999999e120

    1. Initial program 98.9%

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

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

    if -1.60000000000000005e-205 < y < 4.2000000000000001e-161 or 7.9999999999999994e-40 < y < 7.2e22

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.4 \cdot 10^{+104}:\\ \;\;\;\;-z\\ \mathbf{elif}\;y \leq -1.6 \cdot 10^{-205}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{-161}:\\ \;\;\;\;\frac{x}{1 - \frac{y}{z}}\\ \mathbf{elif}\;y \leq 8 \cdot 10^{-40}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;y \leq 7.2 \cdot 10^{+22}:\\ \;\;\;\;\frac{x}{1 - \frac{y}{z}}\\ \mathbf{elif}\;y \leq 5.7 \cdot 10^{+72}:\\ \;\;\;\;-z\\ \mathbf{elif}\;y \leq 1.95 \cdot 10^{+120}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \]

Alternative 8: 67.1% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;y \leq 2 \cdot 10^{+23} \lor \neg \left(y \leq 3.9 \cdot 10^{+70}\right) \land y \leq 2 \cdot 10^{+138}:\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -7.0000000000000003e104 or 1.9999999999999998e23 < y < 3.89999999999999975e70 or 2.0000000000000001e138 < y

    1. Initial program 67.2%

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

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

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

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

    if -7.0000000000000003e104 < y < 1.9999999999999998e23 or 3.89999999999999975e70 < y < 2.0000000000000001e138

    1. Initial program 99.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7 \cdot 10^{+104}:\\ \;\;\;\;-z\\ \mathbf{elif}\;y \leq 2 \cdot 10^{+23} \lor \neg \left(y \leq 3.9 \cdot 10^{+70}\right) \land y \leq 2 \cdot 10^{+138}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \]

Alternative 9: 58.9% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;y \leq 7.3 \cdot 10^{-62}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -8.4999999999999996e45 or 7.2999999999999998e-62 < y

    1. Initial program 75.4%

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

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

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

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

    if -8.4999999999999996e45 < y < 7.2999999999999998e-62

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8.5 \cdot 10^{+45}:\\ \;\;\;\;-z\\ \mathbf{elif}\;y \leq 7.3 \cdot 10^{-62}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \]

Alternative 10: 38.0% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.2 \cdot 10^{-79}:\\
\;\;\;\;y\\

\mathbf{elif}\;y \leq 2.5 \cdot 10^{-69}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.1999999999999999e-79 or 2.50000000000000017e-69 < y

    1. Initial program 80.0%

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

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

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

    if -2.1999999999999999e-79 < y < 2.50000000000000017e-69

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.2 \cdot 10^{-79}:\\ \;\;\;\;y\\ \mathbf{elif}\;y \leq 2.5 \cdot 10^{-69}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \]

Alternative 11: 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 88.2%

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

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

    \[\leadsto x \]

Developer target: 94.1% 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 2023200 
(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))))