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

Percentage Accurate: 87.6% → 98.9%
Time: 8.1s
Alternatives: 10
Speedup: 0.5×

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 10 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: 87.6% 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: 98.9% 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^{-243}:\\ \;\;\;\;\frac{z}{z - y} \cdot \left(x + y\right)\\ \mathbf{elif}\;t\_0 \leq 2 \cdot 10^{-190}:\\ \;\;\;\;z \cdot \frac{x + y}{z - y}\\ \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-243)
     (* (/ z (- z y)) (+ x y))
     (if (<= t_0 2e-190) (* z (/ (+ x y) (- z 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-243) {
		tmp = (z / (z - y)) * (x + y);
	} else if (t_0 <= 2e-190) {
		tmp = z * ((x + y) / (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 = (x + y) / (1.0d0 - (y / z))
    if (t_0 <= (-2d-243)) then
        tmp = (z / (z - y)) * (x + y)
    else if (t_0 <= 2d-190) then
        tmp = z * ((x + y) / (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 = (x + y) / (1.0 - (y / z));
	double tmp;
	if (t_0 <= -2e-243) {
		tmp = (z / (z - y)) * (x + y);
	} else if (t_0 <= 2e-190) {
		tmp = z * ((x + y) / (z - 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-243:
		tmp = (z / (z - y)) * (x + y)
	elif t_0 <= 2e-190:
		tmp = z * ((x + y) / (z - 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-243)
		tmp = Float64(Float64(z / Float64(z - y)) * Float64(x + y));
	elseif (t_0 <= 2e-190)
		tmp = Float64(z * Float64(Float64(x + y) / Float64(z - 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-243)
		tmp = (z / (z - y)) * (x + y);
	elseif (t_0 <= 2e-190)
		tmp = z * ((x + y) / (z - 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-243], N[(N[(z / N[(z - y), $MachinePrecision]), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e-190], N[(z * N[(N[(x + y), $MachinePrecision] / N[(z - 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^{-243}:\\
\;\;\;\;\frac{z}{z - y} \cdot \left(x + y\right)\\

\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{-190}:\\
\;\;\;\;z \cdot \frac{x + y}{z - y}\\

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


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

    1. Initial program 99.9%

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

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

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

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

        \[\leadsto x \cdot \frac{z}{z - y} + \color{blue}{y \cdot \frac{z}{z - y}} \]
      3. distribute-rgt-in99.9%

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

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

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

    if -1.99999999999999999e-243 < (/.f64 (+.f64 x y) (-.f64 #s(literal 1 binary64) (/.f64 y z))) < 2e-190

    1. Initial program 33.2%

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

      \[\leadsto \frac{x + y}{\color{blue}{\frac{z - y}{z}}} \]
    4. Step-by-step derivation
      1. associate-/r/99.9%

        \[\leadsto \color{blue}{\frac{x + y}{z - y} \cdot z} \]
    5. Applied egg-rr99.9%

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

    if 2e-190 < (/.f64 (+.f64 x y) (-.f64 #s(literal 1 binary64) (/.f64 y z)))

    1. Initial program 99.9%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Add Preprocessing
  3. Recombined 3 regimes into one program.
  4. Final simplification99.9%

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

Alternative 2: 99.3% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{+63} \lor \neg \left(y \leq 4.8 \cdot 10^{-71}\right):\\
\;\;\;\;z \cdot \frac{x + y}{z - y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.00000000000000006e63 or 4.8e-71 < y

    1. Initial program 76.6%

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

      \[\leadsto \frac{x + y}{\color{blue}{\frac{z - y}{z}}} \]
    4. Step-by-step derivation
      1. associate-/r/99.8%

        \[\leadsto \color{blue}{\frac{x + y}{z - y} \cdot z} \]
    5. Applied egg-rr99.8%

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

    if -1.00000000000000006e63 < y < 4.8e-71

    1. Initial program 99.9%

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

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

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

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

        \[\leadsto x \cdot \frac{z}{z - y} + \color{blue}{y \cdot \frac{z}{z - y}} \]
      3. distribute-rgt-in99.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1 \cdot 10^{+63} \lor \neg \left(y \leq 4.8 \cdot 10^{-71}\right):\\ \;\;\;\;z \cdot \frac{x + y}{z - y}\\ \mathbf{else}:\\ \;\;\;\;\frac{z}{z - y} \cdot \left(x + y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 92.4% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{+66} \lor \neg \left(y \leq 2.9 \cdot 10^{+182}\right):\\
\;\;\;\;z \cdot \frac{y}{z - y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.99999999999999991e66 or 2.8999999999999998e182 < y

    1. Initial program 66.1%

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

      \[\leadsto \frac{x + y}{\color{blue}{\frac{z - y}{z}}} \]
    4. Step-by-step derivation
      1. associate-/r/99.9%

        \[\leadsto \color{blue}{\frac{x + y}{z - y} \cdot z} \]
    5. Applied egg-rr99.9%

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

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

    if -4.99999999999999991e66 < y < 2.8999999999999998e182

    1. Initial program 97.3%

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

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

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

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

        \[\leadsto x \cdot \frac{z}{z - y} + \color{blue}{y \cdot \frac{z}{z - y}} \]
      3. distribute-rgt-in98.1%

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

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

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

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

Alternative 4: 68.4% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -3.2 \cdot 10^{+85}:\\ \;\;\;\;-z\\ \mathbf{elif}\;y \leq -3 \cdot 10^{-71}:\\ \;\;\;\;y \cdot \frac{z}{z - y}\\ \mathbf{elif}\;y \leq 3.6 \cdot 10^{+91}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (<= y -3.2e+85)
   (- z)
   (if (<= y -3e-71) (* y (/ z (- z y))) (if (<= y 3.6e+91) (+ x y) (- z)))))
double code(double x, double y, double z) {
	double tmp;
	if (y <= -3.2e+85) {
		tmp = -z;
	} else if (y <= -3e-71) {
		tmp = y * (z / (z - y));
	} else if (y <= 3.6e+91) {
		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 <= (-3.2d+85)) then
        tmp = -z
    else if (y <= (-3d-71)) then
        tmp = y * (z / (z - y))
    else if (y <= 3.6d+91) 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 <= -3.2e+85) {
		tmp = -z;
	} else if (y <= -3e-71) {
		tmp = y * (z / (z - y));
	} else if (y <= 3.6e+91) {
		tmp = x + y;
	} else {
		tmp = -z;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if y <= -3.2e+85:
		tmp = -z
	elif y <= -3e-71:
		tmp = y * (z / (z - y))
	elif y <= 3.6e+91:
		tmp = x + y
	else:
		tmp = -z
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (y <= -3.2e+85)
		tmp = Float64(-z);
	elseif (y <= -3e-71)
		tmp = Float64(y * Float64(z / Float64(z - y)));
	elseif (y <= 3.6e+91)
		tmp = Float64(x + y);
	else
		tmp = Float64(-z);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (y <= -3.2e+85)
		tmp = -z;
	elseif (y <= -3e-71)
		tmp = y * (z / (z - y));
	elseif (y <= 3.6e+91)
		tmp = x + y;
	else
		tmp = -z;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[y, -3.2e+85], (-z), If[LessEqual[y, -3e-71], N[(y * N[(z / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.6e+91], N[(x + y), $MachinePrecision], (-z)]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -3 \cdot 10^{-71}:\\
\;\;\;\;y \cdot \frac{z}{z - y}\\

\mathbf{elif}\;y \leq 3.6 \cdot 10^{+91}:\\
\;\;\;\;x + y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.20000000000000018e85 or 3.6e91 < y

    1. Initial program 72.1%

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

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

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

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

    if -3.20000000000000018e85 < y < -3.0000000000000001e-71

    1. Initial program 93.3%

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

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

      \[\leadsto \color{blue}{\frac{y \cdot z}{z - y}} \]
    5. Step-by-step derivation
      1. associate-/l*53.4%

        \[\leadsto \color{blue}{y \cdot \frac{z}{z - y}} \]
    6. Simplified53.4%

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

    if -3.0000000000000001e-71 < y < 3.6e91

    1. Initial program 98.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.2 \cdot 10^{+85}:\\ \;\;\;\;-z\\ \mathbf{elif}\;y \leq -3 \cdot 10^{-71}:\\ \;\;\;\;y \cdot \frac{z}{z - y}\\ \mathbf{elif}\;y \leq 3.6 \cdot 10^{+91}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 69.5% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.1 \cdot 10^{+109} \lor \neg \left(x \leq 2.3 \cdot 10^{-18}\right):\\
\;\;\;\;\frac{x}{1 - \frac{y}{z}}\\

\mathbf{else}:\\
\;\;\;\;z \cdot \frac{y}{z - y}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.1000000000000001e109 or 2.3000000000000001e-18 < x

    1. Initial program 94.7%

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

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

    if -2.1000000000000001e109 < x < 2.3000000000000001e-18

    1. Initial program 82.7%

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

      \[\leadsto \frac{x + y}{\color{blue}{\frac{z - y}{z}}} \]
    4. Step-by-step derivation
      1. associate-/r/95.5%

        \[\leadsto \color{blue}{\frac{x + y}{z - y} \cdot z} \]
    5. Applied egg-rr95.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.1 \cdot 10^{+109} \lor \neg \left(x \leq 2.3 \cdot 10^{-18}\right):\\ \;\;\;\;\frac{x}{1 - \frac{y}{z}}\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{y}{z - y}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 73.7% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.8 \cdot 10^{-71} \lor \neg \left(y \leq 8.8 \cdot 10^{+88}\right):\\
\;\;\;\;z \cdot \frac{y}{z - y}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.79999999999999992e-71 or 8.80000000000000035e88 < y

    1. Initial program 78.5%

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

      \[\leadsto \frac{x + y}{\color{blue}{\frac{z - y}{z}}} \]
    4. Step-by-step derivation
      1. associate-/r/99.9%

        \[\leadsto \color{blue}{\frac{x + y}{z - y} \cdot z} \]
    5. Applied egg-rr99.9%

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

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

    if -3.79999999999999992e-71 < y < 8.80000000000000035e88

    1. Initial program 98.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.8 \cdot 10^{-71} \lor \neg \left(y \leq 8.8 \cdot 10^{+88}\right):\\ \;\;\;\;z \cdot \frac{y}{z - y}\\ \mathbf{else}:\\ \;\;\;\;x + y\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 68.0% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.65 \cdot 10^{+49} \lor \neg \left(y \leq 2.35 \cdot 10^{+89}\right):\\
\;\;\;\;-z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.6499999999999999e49 or 2.35000000000000011e89 < y

    1. Initial program 72.9%

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

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

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

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

    if -1.6499999999999999e49 < y < 2.35000000000000011e89

    1. Initial program 98.7%

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

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

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

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

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

Alternative 8: 58.3% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.46 \cdot 10^{-40} \lor \neg \left(y \leq 9.2 \cdot 10^{+88}\right):\\
\;\;\;\;-z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.46000000000000005e-40 or 9.2000000000000007e88 < y

    1. Initial program 77.8%

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

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

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

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

    if -1.46000000000000005e-40 < y < 9.2000000000000007e88

    1. Initial program 98.4%

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

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

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

Alternative 9: 40.0% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;x \leq 2.4 \cdot 10^{-201}:\\
\;\;\;\;y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.3500000000000001e-121 or 2.40000000000000009e-201 < x

    1. Initial program 89.2%

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

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

    if -1.3500000000000001e-121 < x < 2.40000000000000009e-201

    1. Initial program 83.9%

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

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

      \[\leadsto \color{blue}{y} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 10: 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 87.9%

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

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

Developer Target 1: 93.3% 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 2024116 
(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))))