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

Percentage Accurate: 88.3% → 99.4%
Time: 11.5s
Alternatives: 8
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 8 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.3% 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.4% 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^{-246}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_0 \leq 0:\\ \;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (/ (+ x y) (- 1.0 (/ y z)))))
   (if (<= t_0 -2e-246) t_0 (if (<= t_0 0.0) (* z (- -1.0 (/ x y))) t_0))))
double code(double x, double y, double z) {
	double t_0 = (x + y) / (1.0 - (y / z));
	double tmp;
	if (t_0 <= -2e-246) {
		tmp = t_0;
	} else if (t_0 <= 0.0) {
		tmp = z * (-1.0 - (x / y));
	} 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 = (x + y) / (1.0d0 - (y / z))
    if (t_0 <= (-2d-246)) then
        tmp = t_0
    else if (t_0 <= 0.0d0) then
        tmp = z * ((-1.0d0) - (x / y))
    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 tmp;
	if (t_0 <= -2e-246) {
		tmp = t_0;
	} else if (t_0 <= 0.0) {
		tmp = z * (-1.0 - (x / y));
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = (x + y) / (1.0 - (y / z))
	tmp = 0
	if t_0 <= -2e-246:
		tmp = t_0
	elif t_0 <= 0.0:
		tmp = z * (-1.0 - (x / y))
	else:
		tmp = t_0
	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-246)
		tmp = t_0;
	elseif (t_0 <= 0.0)
		tmp = Float64(z * Float64(-1.0 - Float64(x / y)));
	else
		tmp = t_0;
	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-246)
		tmp = t_0;
	elseif (t_0 <= 0.0)
		tmp = z * (-1.0 - (x / y));
	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]}, If[LessEqual[t$95$0, -2e-246], t$95$0, If[LessEqual[t$95$0, 0.0], N[(z * N[(-1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_0 \leq 0:\\
\;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (+.f64 x y) (-.f64 #s(literal 1 binary64) (/.f64 y z))) < -1.99999999999999991e-246 or -0.0 < (/.f64 (+.f64 x y) (-.f64 #s(literal 1 binary64) (/.f64 y z)))

    1. Initial program 99.8%

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

    if -1.99999999999999991e-246 < (/.f64 (+.f64 x y) (-.f64 #s(literal 1 binary64) (/.f64 y z))) < -0.0

    1. Initial program 8.6%

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

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

        \[\leadsto \mathsf{neg}\left(\frac{z \cdot \left(x + y\right)}{y}\right) \]
      2. associate-/l*N/A

        \[\leadsto \mathsf{neg}\left(z \cdot \frac{x + y}{y}\right) \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto z \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{x + y}{y}\right)\right)} \]
      4. mul-1-negN/A

        \[\leadsto z \cdot \left(-1 \cdot \color{blue}{\frac{x + y}{y}}\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(z, \color{blue}{\left(-1 \cdot \frac{x + y}{y}\right)}\right) \]
      6. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\frac{-1 \cdot \left(x + y\right)}{\color{blue}{y}}\right)\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\frac{-1 \cdot \left(y + x\right)}{y}\right)\right) \]
      8. distribute-lft-inN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\frac{-1 \cdot y + -1 \cdot x}{y}\right)\right) \]
      9. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\frac{-1 \cdot y + \left(\mathsf{neg}\left(x\right)\right)}{y}\right)\right) \]
      10. unsub-negN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\frac{-1 \cdot y - x}{y}\right)\right) \]
      11. div-subN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\frac{-1 \cdot y}{y} - \color{blue}{\frac{x}{y}}\right)\right) \]
      12. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\frac{-1}{y} \cdot y - \frac{\color{blue}{x}}{y}\right)\right) \]
      13. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\frac{\mathsf{neg}\left(1\right)}{y} \cdot y - \frac{x}{y}\right)\right) \]
      14. distribute-neg-fracN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\left(\mathsf{neg}\left(\frac{1}{y}\right)\right) \cdot y - \frac{x}{y}\right)\right) \]
      15. distribute-lft-neg-outN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\left(\mathsf{neg}\left(\frac{1}{y} \cdot y\right)\right) - \frac{\color{blue}{x}}{y}\right)\right) \]
      16. lft-mult-inverseN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\left(\mathsf{neg}\left(1\right)\right) - \frac{x}{y}\right)\right) \]
      17. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(-1 - \frac{\color{blue}{x}}{y}\right)\right) \]
      18. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(z, \mathsf{\_.f64}\left(-1, \color{blue}{\left(\frac{x}{y}\right)}\right)\right) \]
      19. /-lowering-/.f64100.0%

        \[\leadsto \mathsf{*.f64}\left(z, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(x, \color{blue}{y}\right)\right)\right) \]
    5. Simplified100.0%

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

Alternative 2: 73.0% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := z \cdot \left(-1 - \frac{x}{y}\right)\\ \mathbf{if}\;y \leq -2.05 \cdot 10^{+61}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq -1.25 \cdot 10^{-68}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;y \leq 6 \cdot 10^{+21}:\\ \;\;\;\;x \cdot \frac{z}{z - y}\\ \mathbf{elif}\;y \leq 8.5 \cdot 10^{+171}:\\ \;\;\;\;\frac{y}{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 -2.05e+61)
     t_0
     (if (<= y -1.25e-68)
       (+ x y)
       (if (<= y 6e+21)
         (* x (/ z (- z y)))
         (if (<= y 8.5e+171) (/ y (- 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 <= -2.05e+61) {
		tmp = t_0;
	} else if (y <= -1.25e-68) {
		tmp = x + y;
	} else if (y <= 6e+21) {
		tmp = x * (z / (z - y));
	} else if (y <= 8.5e+171) {
		tmp = 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 = z * ((-1.0d0) - (x / y))
    if (y <= (-2.05d+61)) then
        tmp = t_0
    else if (y <= (-1.25d-68)) then
        tmp = x + y
    else if (y <= 6d+21) then
        tmp = x * (z / (z - y))
    else if (y <= 8.5d+171) then
        tmp = 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 = z * (-1.0 - (x / y));
	double tmp;
	if (y <= -2.05e+61) {
		tmp = t_0;
	} else if (y <= -1.25e-68) {
		tmp = x + y;
	} else if (y <= 6e+21) {
		tmp = x * (z / (z - y));
	} else if (y <= 8.5e+171) {
		tmp = y / (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 <= -2.05e+61:
		tmp = t_0
	elif y <= -1.25e-68:
		tmp = x + y
	elif y <= 6e+21:
		tmp = x * (z / (z - y))
	elif y <= 8.5e+171:
		tmp = y / (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 <= -2.05e+61)
		tmp = t_0;
	elseif (y <= -1.25e-68)
		tmp = Float64(x + y);
	elseif (y <= 6e+21)
		tmp = Float64(x * Float64(z / Float64(z - y)));
	elseif (y <= 8.5e+171)
		tmp = Float64(y / 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 <= -2.05e+61)
		tmp = t_0;
	elseif (y <= -1.25e-68)
		tmp = x + y;
	elseif (y <= 6e+21)
		tmp = x * (z / (z - y));
	elseif (y <= 8.5e+171)
		tmp = y / (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, -2.05e+61], t$95$0, If[LessEqual[y, -1.25e-68], N[(x + y), $MachinePrecision], If[LessEqual[y, 6e+21], N[(x * N[(z / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.5e+171], N[(y / 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 -2.05 \cdot 10^{+61}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;y \leq -1.25 \cdot 10^{-68}:\\
\;\;\;\;x + y\\

\mathbf{elif}\;y \leq 6 \cdot 10^{+21}:\\
\;\;\;\;x \cdot \frac{z}{z - y}\\

\mathbf{elif}\;y \leq 8.5 \cdot 10^{+171}:\\
\;\;\;\;\frac{y}{1 - \frac{y}{z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -2.04999999999999986e61 or 8.4999999999999995e171 < y

    1. Initial program 63.3%

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

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

        \[\leadsto \mathsf{neg}\left(\frac{z \cdot \left(x + y\right)}{y}\right) \]
      2. associate-/l*N/A

        \[\leadsto \mathsf{neg}\left(z \cdot \frac{x + y}{y}\right) \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto z \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{x + y}{y}\right)\right)} \]
      4. mul-1-negN/A

        \[\leadsto z \cdot \left(-1 \cdot \color{blue}{\frac{x + y}{y}}\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(z, \color{blue}{\left(-1 \cdot \frac{x + y}{y}\right)}\right) \]
      6. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\frac{-1 \cdot \left(x + y\right)}{\color{blue}{y}}\right)\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\frac{-1 \cdot \left(y + x\right)}{y}\right)\right) \]
      8. distribute-lft-inN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\frac{-1 \cdot y + -1 \cdot x}{y}\right)\right) \]
      9. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\frac{-1 \cdot y + \left(\mathsf{neg}\left(x\right)\right)}{y}\right)\right) \]
      10. unsub-negN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\frac{-1 \cdot y - x}{y}\right)\right) \]
      11. div-subN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\frac{-1 \cdot y}{y} - \color{blue}{\frac{x}{y}}\right)\right) \]
      12. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\frac{-1}{y} \cdot y - \frac{\color{blue}{x}}{y}\right)\right) \]
      13. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\frac{\mathsf{neg}\left(1\right)}{y} \cdot y - \frac{x}{y}\right)\right) \]
      14. distribute-neg-fracN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\left(\mathsf{neg}\left(\frac{1}{y}\right)\right) \cdot y - \frac{x}{y}\right)\right) \]
      15. distribute-lft-neg-outN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\left(\mathsf{neg}\left(\frac{1}{y} \cdot y\right)\right) - \frac{\color{blue}{x}}{y}\right)\right) \]
      16. lft-mult-inverseN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\left(\mathsf{neg}\left(1\right)\right) - \frac{x}{y}\right)\right) \]
      17. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(-1 - \frac{\color{blue}{x}}{y}\right)\right) \]
      18. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(z, \mathsf{\_.f64}\left(-1, \color{blue}{\left(\frac{x}{y}\right)}\right)\right) \]
      19. /-lowering-/.f6488.0%

        \[\leadsto \mathsf{*.f64}\left(z, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(x, \color{blue}{y}\right)\right)\right) \]
    5. Simplified88.0%

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

    if -2.04999999999999986e61 < y < -1.24999999999999993e-68

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{x + y} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto y + \color{blue}{x} \]
      2. +-lowering-+.f6464.8%

        \[\leadsto \mathsf{+.f64}\left(y, \color{blue}{x}\right) \]
    5. Simplified64.8%

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

    if -1.24999999999999993e-68 < y < 6e21

    1. Initial program 99.8%

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

      \[\leadsto \color{blue}{\frac{x}{1 - \frac{y}{z}}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{\left(1 - \frac{y}{z}\right)}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(x, \mathsf{\_.f64}\left(1, \color{blue}{\left(\frac{y}{z}\right)}\right)\right) \]
      3. /-lowering-/.f6487.8%

        \[\leadsto \mathsf{/.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(y, \color{blue}{z}\right)\right)\right) \]
    5. Simplified87.8%

      \[\leadsto \color{blue}{\frac{x}{1 - \frac{y}{z}}} \]
    6. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \frac{1}{\color{blue}{\frac{1 - \frac{y}{z}}{x}}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{1 - \frac{y}{z}}{x}\right)}\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(1 - \frac{y}{z}\right), \color{blue}{x}\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \left(\frac{y}{z}\right)\right), x\right)\right) \]
      5. /-lowering-/.f6487.7%

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(y, z\right)\right), x\right)\right) \]
    7. Applied egg-rr87.7%

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

      \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{-1 \cdot \frac{y}{x} + \frac{z}{x}}{z}\right)}\right) \]
    9. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(-1 \cdot \frac{y}{x} + \frac{z}{x}\right), \color{blue}{z}\right)\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{z}{x} + -1 \cdot \frac{y}{x}\right), z\right)\right) \]
      3. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{z}{x} + \left(\mathsf{neg}\left(\frac{y}{x}\right)\right)\right), z\right)\right) \]
      4. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{z}{x} - \frac{y}{x}\right), z\right)\right) \]
      5. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\frac{z}{x}\right), \left(\frac{y}{x}\right)\right), z\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(z, x\right), \left(\frac{y}{x}\right)\right), z\right)\right) \]
      7. /-lowering-/.f6471.3%

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(z, x\right), \mathsf{/.f64}\left(y, x\right)\right), z\right)\right) \]
    10. Simplified71.3%

      \[\leadsto \frac{1}{\color{blue}{\frac{\frac{z}{x} - \frac{y}{x}}{z}}} \]
    11. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \frac{z}{\color{blue}{\frac{z}{x} - \frac{y}{x}}} \]
      2. sub-divN/A

        \[\leadsto \frac{z}{\frac{z - y}{\color{blue}{x}}} \]
      3. associate-/r/N/A

        \[\leadsto \frac{z}{z - y} \cdot \color{blue}{x} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{z}{z - y}\right), \color{blue}{x}\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(z, \left(z - y\right)\right), x\right) \]
      6. --lowering--.f6488.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(z, \mathsf{\_.f64}\left(z, y\right)\right), x\right) \]
    12. Applied egg-rr88.0%

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

    if 6e21 < y < 8.4999999999999995e171

    1. Initial program 87.6%

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

      \[\leadsto \color{blue}{\frac{y}{1 - \frac{y}{z}}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \color{blue}{\left(1 - \frac{y}{z}\right)}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{\_.f64}\left(1, \color{blue}{\left(\frac{y}{z}\right)}\right)\right) \]
      3. /-lowering-/.f6481.2%

        \[\leadsto \mathsf{/.f64}\left(y, \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(y, \color{blue}{z}\right)\right)\right) \]
    5. Simplified81.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.05 \cdot 10^{+61}:\\ \;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\ \mathbf{elif}\;y \leq -1.25 \cdot 10^{-68}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;y \leq 6 \cdot 10^{+21}:\\ \;\;\;\;x \cdot \frac{z}{z - y}\\ \mathbf{elif}\;y \leq 8.5 \cdot 10^{+171}:\\ \;\;\;\;\frac{y}{1 - \frac{y}{z}}\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 74.4% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := z \cdot \left(-1 - \frac{x}{y}\right)\\ \mathbf{if}\;y \leq -2.9 \cdot 10^{+60}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq -1.02 \cdot 10^{-67}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;y \leq 580000:\\ \;\;\;\;x \cdot \frac{z}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* z (- -1.0 (/ x y)))))
   (if (<= y -2.9e+60)
     t_0
     (if (<= y -1.02e-67)
       (+ x y)
       (if (<= y 580000.0) (* x (/ z (- z y))) t_0)))))
double code(double x, double y, double z) {
	double t_0 = z * (-1.0 - (x / y));
	double tmp;
	if (y <= -2.9e+60) {
		tmp = t_0;
	} else if (y <= -1.02e-67) {
		tmp = x + y;
	} else if (y <= 580000.0) {
		tmp = x * (z / (z - y));
	} 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 <= (-2.9d+60)) then
        tmp = t_0
    else if (y <= (-1.02d-67)) then
        tmp = x + y
    else if (y <= 580000.0d0) then
        tmp = x * (z / (z - y))
    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 <= -2.9e+60) {
		tmp = t_0;
	} else if (y <= -1.02e-67) {
		tmp = x + y;
	} else if (y <= 580000.0) {
		tmp = x * (z / (z - y));
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = z * (-1.0 - (x / y))
	tmp = 0
	if y <= -2.9e+60:
		tmp = t_0
	elif y <= -1.02e-67:
		tmp = x + y
	elif y <= 580000.0:
		tmp = x * (z / (z - y))
	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 <= -2.9e+60)
		tmp = t_0;
	elseif (y <= -1.02e-67)
		tmp = Float64(x + y);
	elseif (y <= 580000.0)
		tmp = Float64(x * Float64(z / Float64(z - y)));
	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 <= -2.9e+60)
		tmp = t_0;
	elseif (y <= -1.02e-67)
		tmp = x + y;
	elseif (y <= 580000.0)
		tmp = x * (z / (z - y));
	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, -2.9e+60], t$95$0, If[LessEqual[y, -1.02e-67], N[(x + y), $MachinePrecision], If[LessEqual[y, 580000.0], N[(x * N[(z / N[(z - y), $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 -2.9 \cdot 10^{+60}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;y \leq -1.02 \cdot 10^{-67}:\\
\;\;\;\;x + y\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.9e60 or 5.8e5 < y

    1. Initial program 69.9%

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

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

        \[\leadsto \mathsf{neg}\left(\frac{z \cdot \left(x + y\right)}{y}\right) \]
      2. associate-/l*N/A

        \[\leadsto \mathsf{neg}\left(z \cdot \frac{x + y}{y}\right) \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto z \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{x + y}{y}\right)\right)} \]
      4. mul-1-negN/A

        \[\leadsto z \cdot \left(-1 \cdot \color{blue}{\frac{x + y}{y}}\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(z, \color{blue}{\left(-1 \cdot \frac{x + y}{y}\right)}\right) \]
      6. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\frac{-1 \cdot \left(x + y\right)}{\color{blue}{y}}\right)\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\frac{-1 \cdot \left(y + x\right)}{y}\right)\right) \]
      8. distribute-lft-inN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\frac{-1 \cdot y + -1 \cdot x}{y}\right)\right) \]
      9. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\frac{-1 \cdot y + \left(\mathsf{neg}\left(x\right)\right)}{y}\right)\right) \]
      10. unsub-negN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\frac{-1 \cdot y - x}{y}\right)\right) \]
      11. div-subN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\frac{-1 \cdot y}{y} - \color{blue}{\frac{x}{y}}\right)\right) \]
      12. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\frac{-1}{y} \cdot y - \frac{\color{blue}{x}}{y}\right)\right) \]
      13. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\frac{\mathsf{neg}\left(1\right)}{y} \cdot y - \frac{x}{y}\right)\right) \]
      14. distribute-neg-fracN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\left(\mathsf{neg}\left(\frac{1}{y}\right)\right) \cdot y - \frac{x}{y}\right)\right) \]
      15. distribute-lft-neg-outN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\left(\mathsf{neg}\left(\frac{1}{y} \cdot y\right)\right) - \frac{\color{blue}{x}}{y}\right)\right) \]
      16. lft-mult-inverseN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\left(\mathsf{neg}\left(1\right)\right) - \frac{x}{y}\right)\right) \]
      17. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(-1 - \frac{\color{blue}{x}}{y}\right)\right) \]
      18. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(z, \mathsf{\_.f64}\left(-1, \color{blue}{\left(\frac{x}{y}\right)}\right)\right) \]
      19. /-lowering-/.f6482.3%

        \[\leadsto \mathsf{*.f64}\left(z, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(x, \color{blue}{y}\right)\right)\right) \]
    5. Simplified82.3%

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

    if -2.9e60 < y < -1.01999999999999993e-67

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{x + y} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto y + \color{blue}{x} \]
      2. +-lowering-+.f6464.8%

        \[\leadsto \mathsf{+.f64}\left(y, \color{blue}{x}\right) \]
    5. Simplified64.8%

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

    if -1.01999999999999993e-67 < y < 5.8e5

    1. Initial program 99.8%

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

      \[\leadsto \color{blue}{\frac{x}{1 - \frac{y}{z}}} \]
    4. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(x, \color{blue}{\left(1 - \frac{y}{z}\right)}\right) \]
      2. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(x, \mathsf{\_.f64}\left(1, \color{blue}{\left(\frac{y}{z}\right)}\right)\right) \]
      3. /-lowering-/.f6487.8%

        \[\leadsto \mathsf{/.f64}\left(x, \mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(y, \color{blue}{z}\right)\right)\right) \]
    5. Simplified87.8%

      \[\leadsto \color{blue}{\frac{x}{1 - \frac{y}{z}}} \]
    6. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \frac{1}{\color{blue}{\frac{1 - \frac{y}{z}}{x}}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{1 - \frac{y}{z}}{x}\right)}\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(1 - \frac{y}{z}\right), \color{blue}{x}\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \left(\frac{y}{z}\right)\right), x\right)\right) \]
      5. /-lowering-/.f6487.6%

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(y, z\right)\right), x\right)\right) \]
    7. Applied egg-rr87.6%

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

      \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{-1 \cdot \frac{y}{x} + \frac{z}{x}}{z}\right)}\right) \]
    9. Step-by-step derivation
      1. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(-1 \cdot \frac{y}{x} + \frac{z}{x}\right), \color{blue}{z}\right)\right) \]
      2. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{z}{x} + -1 \cdot \frac{y}{x}\right), z\right)\right) \]
      3. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{z}{x} + \left(\mathsf{neg}\left(\frac{y}{x}\right)\right)\right), z\right)\right) \]
      4. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{z}{x} - \frac{y}{x}\right), z\right)\right) \]
      5. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\frac{z}{x}\right), \left(\frac{y}{x}\right)\right), z\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(z, x\right), \left(\frac{y}{x}\right)\right), z\right)\right) \]
      7. /-lowering-/.f6471.0%

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(z, x\right), \mathsf{/.f64}\left(y, x\right)\right), z\right)\right) \]
    10. Simplified71.0%

      \[\leadsto \frac{1}{\color{blue}{\frac{\frac{z}{x} - \frac{y}{x}}{z}}} \]
    11. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \frac{z}{\color{blue}{\frac{z}{x} - \frac{y}{x}}} \]
      2. sub-divN/A

        \[\leadsto \frac{z}{\frac{z - y}{\color{blue}{x}}} \]
      3. associate-/r/N/A

        \[\leadsto \frac{z}{z - y} \cdot \color{blue}{x} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{z}{z - y}\right), \color{blue}{x}\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(z, \left(z - y\right)\right), x\right) \]
      6. --lowering--.f6487.9%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(z, \mathsf{\_.f64}\left(z, y\right)\right), x\right) \]
    12. Applied egg-rr87.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.9 \cdot 10^{+60}:\\ \;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\ \mathbf{elif}\;y \leq -1.02 \cdot 10^{-67}:\\ \;\;\;\;x + y\\ \mathbf{elif}\;y \leq 580000:\\ \;\;\;\;x \cdot \frac{z}{z - y}\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 74.0% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := z \cdot \left(-1 - \frac{x}{y}\right)\\ \mathbf{if}\;y \leq -3 \cdot 10^{+60}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq 7.2 \cdot 10^{-50}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* z (- -1.0 (/ x y)))))
   (if (<= y -3e+60) t_0 (if (<= y 7.2e-50) (+ x y) t_0))))
double code(double x, double y, double z) {
	double t_0 = z * (-1.0 - (x / y));
	double tmp;
	if (y <= -3e+60) {
		tmp = t_0;
	} else if (y <= 7.2e-50) {
		tmp = x + y;
	} 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 <= (-3d+60)) then
        tmp = t_0
    else if (y <= 7.2d-50) then
        tmp = x + y
    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 <= -3e+60) {
		tmp = t_0;
	} else if (y <= 7.2e-50) {
		tmp = x + y;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = z * (-1.0 - (x / y))
	tmp = 0
	if y <= -3e+60:
		tmp = t_0
	elif y <= 7.2e-50:
		tmp = x + y
	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 <= -3e+60)
		tmp = t_0;
	elseif (y <= 7.2e-50)
		tmp = Float64(x + y);
	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 <= -3e+60)
		tmp = t_0;
	elseif (y <= 7.2e-50)
		tmp = x + y;
	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, -3e+60], t$95$0, If[LessEqual[y, 7.2e-50], N[(x + y), $MachinePrecision], t$95$0]]]
\begin{array}{l}

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.9999999999999998e60 or 7.19999999999999958e-50 < y

    1. Initial program 71.8%

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

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

        \[\leadsto \mathsf{neg}\left(\frac{z \cdot \left(x + y\right)}{y}\right) \]
      2. associate-/l*N/A

        \[\leadsto \mathsf{neg}\left(z \cdot \frac{x + y}{y}\right) \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto z \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{x + y}{y}\right)\right)} \]
      4. mul-1-negN/A

        \[\leadsto z \cdot \left(-1 \cdot \color{blue}{\frac{x + y}{y}}\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(z, \color{blue}{\left(-1 \cdot \frac{x + y}{y}\right)}\right) \]
      6. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\frac{-1 \cdot \left(x + y\right)}{\color{blue}{y}}\right)\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\frac{-1 \cdot \left(y + x\right)}{y}\right)\right) \]
      8. distribute-lft-inN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\frac{-1 \cdot y + -1 \cdot x}{y}\right)\right) \]
      9. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\frac{-1 \cdot y + \left(\mathsf{neg}\left(x\right)\right)}{y}\right)\right) \]
      10. unsub-negN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\frac{-1 \cdot y - x}{y}\right)\right) \]
      11. div-subN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\frac{-1 \cdot y}{y} - \color{blue}{\frac{x}{y}}\right)\right) \]
      12. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\frac{-1}{y} \cdot y - \frac{\color{blue}{x}}{y}\right)\right) \]
      13. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\frac{\mathsf{neg}\left(1\right)}{y} \cdot y - \frac{x}{y}\right)\right) \]
      14. distribute-neg-fracN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\left(\mathsf{neg}\left(\frac{1}{y}\right)\right) \cdot y - \frac{x}{y}\right)\right) \]
      15. distribute-lft-neg-outN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\left(\mathsf{neg}\left(\frac{1}{y} \cdot y\right)\right) - \frac{\color{blue}{x}}{y}\right)\right) \]
      16. lft-mult-inverseN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\left(\mathsf{neg}\left(1\right)\right) - \frac{x}{y}\right)\right) \]
      17. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(-1 - \frac{\color{blue}{x}}{y}\right)\right) \]
      18. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(z, \mathsf{\_.f64}\left(-1, \color{blue}{\left(\frac{x}{y}\right)}\right)\right) \]
      19. /-lowering-/.f6481.1%

        \[\leadsto \mathsf{*.f64}\left(z, \mathsf{\_.f64}\left(-1, \mathsf{/.f64}\left(x, \color{blue}{y}\right)\right)\right) \]
    5. Simplified81.1%

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

    if -2.9999999999999998e60 < y < 7.19999999999999958e-50

    1. Initial program 99.9%

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

      \[\leadsto \color{blue}{x + y} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto y + \color{blue}{x} \]
      2. +-lowering-+.f6476.5%

        \[\leadsto \mathsf{+.f64}\left(y, \color{blue}{x}\right) \]
    5. Simplified76.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3 \cdot 10^{+60}:\\ \;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\ \mathbf{elif}\;y \leq 7.2 \cdot 10^{-50}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(-1 - \frac{x}{y}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 67.6% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.05 \cdot 10^{+61}:\\
\;\;\;\;0 - z\\

\mathbf{elif}\;y \leq 8500:\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.04999999999999986e61 or 8500 < y

    1. Initial program 69.9%

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

      \[\leadsto \color{blue}{-1 \cdot z} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(z\right) \]
      2. neg-sub0N/A

        \[\leadsto 0 - \color{blue}{z} \]
      3. --lowering--.f6469.5%

        \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{z}\right) \]
    5. Simplified69.5%

      \[\leadsto \color{blue}{0 - z} \]
    6. Step-by-step derivation
      1. sub0-negN/A

        \[\leadsto \mathsf{neg}\left(z\right) \]
      2. neg-lowering-neg.f6469.5%

        \[\leadsto \mathsf{neg.f64}\left(z\right) \]
    7. Applied egg-rr69.5%

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

    if -2.04999999999999986e61 < y < 8500

    1. Initial program 99.8%

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

      \[\leadsto \color{blue}{x + y} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto y + \color{blue}{x} \]
      2. +-lowering-+.f6474.4%

        \[\leadsto \mathsf{+.f64}\left(y, \color{blue}{x}\right) \]
    5. Simplified74.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.05 \cdot 10^{+61}:\\ \;\;\;\;0 - z\\ \mathbf{elif}\;y \leq 8500:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;0 - z\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 58.5% accurate, 0.7× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.6000000000000001e-26 or 46 < y

    1. Initial program 73.7%

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

      \[\leadsto \color{blue}{-1 \cdot z} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(z\right) \]
      2. neg-sub0N/A

        \[\leadsto 0 - \color{blue}{z} \]
      3. --lowering--.f6464.7%

        \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{z}\right) \]
    5. Simplified64.7%

      \[\leadsto \color{blue}{0 - z} \]
    6. Step-by-step derivation
      1. sub0-negN/A

        \[\leadsto \mathsf{neg}\left(z\right) \]
      2. neg-lowering-neg.f6464.7%

        \[\leadsto \mathsf{neg.f64}\left(z\right) \]
    7. Applied egg-rr64.7%

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

    if -1.6000000000000001e-26 < y < 46

    1. Initial program 99.8%

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

      \[\leadsto \color{blue}{x} \]
    4. Step-by-step derivation
      1. Simplified67.4%

        \[\leadsto \color{blue}{x} \]
    5. Recombined 2 regimes into one program.
    6. Final simplification66.0%

      \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.6 \cdot 10^{-26}:\\ \;\;\;\;0 - z\\ \mathbf{elif}\;y \leq 46:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;0 - z\\ \end{array} \]
    7. Add Preprocessing

    Alternative 7: 38.5% accurate, 0.8× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1200000000:\\ \;\;\;\;y\\ \mathbf{elif}\;y \leq 4 \cdot 10^{+46}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y\\ \end{array} \end{array} \]
    (FPCore (x y z)
     :precision binary64
     (if (<= y -1200000000.0) y (if (<= y 4e+46) x y)))
    double code(double x, double y, double z) {
    	double tmp;
    	if (y <= -1200000000.0) {
    		tmp = y;
    	} else if (y <= 4e+46) {
    		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 <= (-1200000000.0d0)) then
            tmp = y
        else if (y <= 4d+46) 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 <= -1200000000.0) {
    		tmp = y;
    	} else if (y <= 4e+46) {
    		tmp = x;
    	} else {
    		tmp = y;
    	}
    	return tmp;
    }
    
    def code(x, y, z):
    	tmp = 0
    	if y <= -1200000000.0:
    		tmp = y
    	elif y <= 4e+46:
    		tmp = x
    	else:
    		tmp = y
    	return tmp
    
    function code(x, y, z)
    	tmp = 0.0
    	if (y <= -1200000000.0)
    		tmp = y;
    	elseif (y <= 4e+46)
    		tmp = x;
    	else
    		tmp = y;
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z)
    	tmp = 0.0;
    	if (y <= -1200000000.0)
    		tmp = y;
    	elseif (y <= 4e+46)
    		tmp = x;
    	else
    		tmp = y;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_] := If[LessEqual[y, -1200000000.0], y, If[LessEqual[y, 4e+46], x, y]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;y \leq -1200000000:\\
    \;\;\;\;y\\
    
    \mathbf{elif}\;y \leq 4 \cdot 10^{+46}:\\
    \;\;\;\;x\\
    
    \mathbf{else}:\\
    \;\;\;\;y\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if y < -1.2e9 or 4e46 < y

      1. Initial program 71.8%

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

        \[\leadsto \color{blue}{x + y \cdot \left(1 - -1 \cdot \frac{x}{z}\right)} \]
      4. Step-by-step derivation
        1. +-lowering-+.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(y \cdot \left(1 - -1 \cdot \frac{x}{z}\right)\right)}\right) \]
        2. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(y, \color{blue}{\left(1 - -1 \cdot \frac{x}{z}\right)}\right)\right) \]
        3. sub-negN/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(y, \left(1 + \color{blue}{\left(\mathsf{neg}\left(-1 \cdot \frac{x}{z}\right)\right)}\right)\right)\right) \]
        4. +-lowering-+.f64N/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(1, \color{blue}{\left(\mathsf{neg}\left(-1 \cdot \frac{x}{z}\right)\right)}\right)\right)\right) \]
        5. mul-1-negN/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(1, \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\frac{x}{z}\right)\right)\right)\right)\right)\right)\right) \]
        6. remove-double-negN/A

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(1, \left(\frac{x}{\color{blue}{z}}\right)\right)\right)\right) \]
        7. /-lowering-/.f6422.2%

          \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(x, \color{blue}{z}\right)\right)\right)\right) \]
      5. Simplified22.2%

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

        \[\leadsto \color{blue}{y} \]
      7. Step-by-step derivation
        1. Simplified19.8%

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

        if -1.2e9 < y < 4e46

        1. Initial program 99.8%

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

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

            \[\leadsto \color{blue}{x} \]
        5. Recombined 2 regimes into one program.
        6. Add Preprocessing

        Alternative 8: 34.7% 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 86.3%

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

          \[\leadsto \color{blue}{x} \]
        4. Step-by-step derivation
          1. Simplified36.1%

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

          Developer Target 1: 93.6% accurate, 0.5× speedup?

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

          Reproduce

          ?
          herbie shell --seed 2024192 
          (FPCore (x y z)
            :name "Graphics.Rendering.Chart.Backend.Diagrams:calcFontMetrics from Chart-diagrams-1.5.1, A"
            :precision binary64
          
            :alt
            (! :herbie-platform default (if (< y -3742931076268985600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (* (/ (+ y x) (- y)) z) (if (< y 3553466245608673400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ (+ x y) (- 1 (/ y z))) (* (/ (+ y x) (- y)) z))))
          
            (/ (+ x y) (- 1.0 (/ y z))))