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

Percentage Accurate: 88.0% → 99.8%
Time: 3.5s
Alternatives: 8
Speedup: 0.7×

Specification

?
\[\frac{x + y}{1 - \frac{y}{z}} \]
(FPCore (x y z)
  :precision binary64
  :pre TRUE
  (/ (+ 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)
use fmin_fmax_functions
    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]
f(x, y, z):
	x in [-inf, +inf],
	y in [-inf, +inf],
	z in [-inf, +inf]
code: THEORY
BEGIN
f(x, y, z: real): real =
	(x + y) / ((1) - (y / z))
END code
\frac{x + y}{1 - \frac{y}{z}}

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.0% accurate, 1.0× speedup?

\[\frac{x + y}{1 - \frac{y}{z}} \]
(FPCore (x y z)
  :precision binary64
  :pre TRUE
  (/ (+ 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)
use fmin_fmax_functions
    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]
f(x, y, z):
	x in [-inf, +inf],
	y in [-inf, +inf],
	z in [-inf, +inf]
code: THEORY
BEGIN
f(x, y, z: real): real =
	(x + y) / ((1) - (y / z))
END code
\frac{x + y}{1 - \frac{y}{z}}

Alternative 1: 99.8% accurate, 0.6× speedup?

\[\begin{array}{l} \mathbf{if}\;y \leq -3.782608026078261 \cdot 10^{+52}:\\ \;\;\;\;\frac{z}{\frac{z - y}{y + x}}\\ \mathbf{elif}\;y \leq 2.782787727800268 \cdot 10^{+40}:\\ \;\;\;\;\frac{x + y}{1 - \frac{y}{z}}\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{y + x}{z - y}\\ \end{array} \]
(FPCore (x y z)
  :precision binary64
  :pre TRUE
  (if (<= y -3.782608026078261e+52)
  (/ z (/ (- z y) (+ y x)))
  (if (<= y 2.782787727800268e+40)
    (/ (+ x y) (- 1.0 (/ y z)))
    (* z (/ (+ y x) (- z y))))))
double code(double x, double y, double z) {
	double tmp;
	if (y <= -3.782608026078261e+52) {
		tmp = z / ((z - y) / (y + x));
	} else if (y <= 2.782787727800268e+40) {
		tmp = (x + y) / (1.0 - (y / z));
	} else {
		tmp = z * ((y + x) / (z - y));
	}
	return tmp;
}
real(8) function code(x, y, z)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if (y <= (-3.782608026078261d+52)) then
        tmp = z / ((z - y) / (y + x))
    else if (y <= 2.782787727800268d+40) then
        tmp = (x + y) / (1.0d0 - (y / z))
    else
        tmp = z * ((y + x) / (z - y))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if (y <= -3.782608026078261e+52) {
		tmp = z / ((z - y) / (y + x));
	} else if (y <= 2.782787727800268e+40) {
		tmp = (x + y) / (1.0 - (y / z));
	} else {
		tmp = z * ((y + x) / (z - y));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if y <= -3.782608026078261e+52:
		tmp = z / ((z - y) / (y + x))
	elif y <= 2.782787727800268e+40:
		tmp = (x + y) / (1.0 - (y / z))
	else:
		tmp = z * ((y + x) / (z - y))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if (y <= -3.782608026078261e+52)
		tmp = Float64(z / Float64(Float64(z - y) / Float64(y + x)));
	elseif (y <= 2.782787727800268e+40)
		tmp = Float64(Float64(x + y) / Float64(1.0 - Float64(y / z)));
	else
		tmp = Float64(z * Float64(Float64(y + x) / Float64(z - y)));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if (y <= -3.782608026078261e+52)
		tmp = z / ((z - y) / (y + x));
	elseif (y <= 2.782787727800268e+40)
		tmp = (x + y) / (1.0 - (y / z));
	else
		tmp = z * ((y + x) / (z - y));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[LessEqual[y, -3.782608026078261e+52], N[(z / N[(N[(z - y), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.782787727800268e+40], N[(N[(x + y), $MachinePrecision] / N[(1.0 - N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(y + x), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
f(x, y, z):
	x in [-inf, +inf],
	y in [-inf, +inf],
	z in [-inf, +inf]
code: THEORY
BEGIN
f(x, y, z: real): real =
	LET tmp_1 = IF (y <= (27827877278002678491622181790330216513536)) THEN ((x + y) / ((1) - (y / z))) ELSE (z * ((y + x) / (z - y))) ENDIF IN
	LET tmp = IF (y <= (-37826080260782611780427230706470323719289090349203456)) THEN (z / ((z - y) / (y + x))) ELSE tmp_1 ENDIF IN
	tmp
END code
\begin{array}{l}
\mathbf{if}\;y \leq -3.782608026078261 \cdot 10^{+52}:\\
\;\;\;\;\frac{z}{\frac{z - y}{y + x}}\\

\mathbf{elif}\;y \leq 2.782787727800268 \cdot 10^{+40}:\\
\;\;\;\;\frac{x + y}{1 - \frac{y}{z}}\\

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


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.7826080260782612e52

    1. Initial program 88.0%

      \[\frac{x + y}{1 - \frac{y}{z}} \]
    2. Step-by-step derivation
      1. Applied rewrites88.8%

        \[\leadsto \left(y + x\right) \cdot \frac{z}{z - y} \]
      2. Step-by-step derivation
        1. Applied rewrites92.4%

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

        if -3.7826080260782612e52 < y < 2.7827877278002678e40

        1. Initial program 88.0%

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

        if 2.7827877278002678e40 < y

        1. Initial program 88.0%

          \[\frac{x + y}{1 - \frac{y}{z}} \]
        2. Step-by-step derivation
          1. Applied rewrites92.3%

            \[\leadsto z \cdot \frac{y + x}{z - y} \]
        3. Recombined 3 regimes into one program.
        4. Add Preprocessing

        Alternative 2: 99.8% accurate, 0.7× speedup?

        \[\begin{array}{l} \mathbf{if}\;y \leq -4.779069952465816 \cdot 10^{+41}:\\ \;\;\;\;\frac{z}{\frac{z - y}{y + x}}\\ \mathbf{elif}\;y \leq 2.782787727800268 \cdot 10^{+40}:\\ \;\;\;\;\left(y + x\right) \cdot \frac{z}{z - y}\\ \mathbf{else}:\\ \;\;\;\;z \cdot \frac{y + x}{z - y}\\ \end{array} \]
        (FPCore (x y z)
          :precision binary64
          :pre TRUE
          (if (<= y -4.779069952465816e+41)
          (/ z (/ (- z y) (+ y x)))
          (if (<= y 2.782787727800268e+40)
            (* (+ y x) (/ z (- z y)))
            (* z (/ (+ y x) (- z y))))))
        double code(double x, double y, double z) {
        	double tmp;
        	if (y <= -4.779069952465816e+41) {
        		tmp = z / ((z - y) / (y + x));
        	} else if (y <= 2.782787727800268e+40) {
        		tmp = (y + x) * (z / (z - y));
        	} else {
        		tmp = z * ((y + x) / (z - y));
        	}
        	return tmp;
        }
        
        real(8) function code(x, y, z)
        use fmin_fmax_functions
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            real(8), intent (in) :: z
            real(8) :: tmp
            if (y <= (-4.779069952465816d+41)) then
                tmp = z / ((z - y) / (y + x))
            else if (y <= 2.782787727800268d+40) then
                tmp = (y + x) * (z / (z - y))
            else
                tmp = z * ((y + x) / (z - y))
            end if
            code = tmp
        end function
        
        public static double code(double x, double y, double z) {
        	double tmp;
        	if (y <= -4.779069952465816e+41) {
        		tmp = z / ((z - y) / (y + x));
        	} else if (y <= 2.782787727800268e+40) {
        		tmp = (y + x) * (z / (z - y));
        	} else {
        		tmp = z * ((y + x) / (z - y));
        	}
        	return tmp;
        }
        
        def code(x, y, z):
        	tmp = 0
        	if y <= -4.779069952465816e+41:
        		tmp = z / ((z - y) / (y + x))
        	elif y <= 2.782787727800268e+40:
        		tmp = (y + x) * (z / (z - y))
        	else:
        		tmp = z * ((y + x) / (z - y))
        	return tmp
        
        function code(x, y, z)
        	tmp = 0.0
        	if (y <= -4.779069952465816e+41)
        		tmp = Float64(z / Float64(Float64(z - y) / Float64(y + x)));
        	elseif (y <= 2.782787727800268e+40)
        		tmp = Float64(Float64(y + x) * Float64(z / Float64(z - y)));
        	else
        		tmp = Float64(z * Float64(Float64(y + x) / Float64(z - y)));
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y, z)
        	tmp = 0.0;
        	if (y <= -4.779069952465816e+41)
        		tmp = z / ((z - y) / (y + x));
        	elseif (y <= 2.782787727800268e+40)
        		tmp = (y + x) * (z / (z - y));
        	else
        		tmp = z * ((y + x) / (z - y));
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_, z_] := If[LessEqual[y, -4.779069952465816e+41], N[(z / N[(N[(z - y), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.782787727800268e+40], N[(N[(y + x), $MachinePrecision] * N[(z / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(y + x), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
        
        f(x, y, z):
        	x in [-inf, +inf],
        	y in [-inf, +inf],
        	z in [-inf, +inf]
        code: THEORY
        BEGIN
        f(x, y, z: real): real =
        	LET tmp_1 = IF (y <= (27827877278002678491622181790330216513536)) THEN ((y + x) * (z / (z - y))) ELSE (z * ((y + x) / (z - y))) ENDIF IN
        	LET tmp = IF (y <= (-477906995246581564721202183051219172327424)) THEN (z / ((z - y) / (y + x))) ELSE tmp_1 ENDIF IN
        	tmp
        END code
        \begin{array}{l}
        \mathbf{if}\;y \leq -4.779069952465816 \cdot 10^{+41}:\\
        \;\;\;\;\frac{z}{\frac{z - y}{y + x}}\\
        
        \mathbf{elif}\;y \leq 2.782787727800268 \cdot 10^{+40}:\\
        \;\;\;\;\left(y + x\right) \cdot \frac{z}{z - y}\\
        
        \mathbf{else}:\\
        \;\;\;\;z \cdot \frac{y + x}{z - y}\\
        
        
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if y < -4.7790699524658156e41

          1. Initial program 88.0%

            \[\frac{x + y}{1 - \frac{y}{z}} \]
          2. Step-by-step derivation
            1. Applied rewrites88.8%

              \[\leadsto \left(y + x\right) \cdot \frac{z}{z - y} \]
            2. Step-by-step derivation
              1. Applied rewrites92.4%

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

              if -4.7790699524658156e41 < y < 2.7827877278002678e40

              1. Initial program 88.0%

                \[\frac{x + y}{1 - \frac{y}{z}} \]
              2. Step-by-step derivation
                1. Applied rewrites88.8%

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

                if 2.7827877278002678e40 < y

                1. Initial program 88.0%

                  \[\frac{x + y}{1 - \frac{y}{z}} \]
                2. Step-by-step derivation
                  1. Applied rewrites92.3%

                    \[\leadsto z \cdot \frac{y + x}{z - y} \]
                3. Recombined 3 regimes into one program.
                4. Add Preprocessing

                Alternative 3: 99.6% accurate, 0.7× speedup?

                \[\begin{array}{l} t_0 := z \cdot \frac{y + x}{z - y}\\ \mathbf{if}\;y \leq -2.349987207420596 \cdot 10^{+38}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq 2.782787727800268 \cdot 10^{+40}:\\ \;\;\;\;\left(y + x\right) \cdot \frac{z}{z - y}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \]
                (FPCore (x y z)
                  :precision binary64
                  :pre TRUE
                  (let* ((t_0 (* z (/ (+ y x) (- z y)))))
                  (if (<= y -2.349987207420596e+38)
                    t_0
                    (if (<= y 2.782787727800268e+40) (* (+ y x) (/ z (- z y))) t_0))))
                double code(double x, double y, double z) {
                	double t_0 = z * ((y + x) / (z - y));
                	double tmp;
                	if (y <= -2.349987207420596e+38) {
                		tmp = t_0;
                	} else if (y <= 2.782787727800268e+40) {
                		tmp = (y + x) * (z / (z - y));
                	} else {
                		tmp = t_0;
                	}
                	return tmp;
                }
                
                real(8) function code(x, y, z)
                use fmin_fmax_functions
                    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 * ((y + x) / (z - y))
                    if (y <= (-2.349987207420596d+38)) then
                        tmp = t_0
                    else if (y <= 2.782787727800268d+40) then
                        tmp = (y + 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 * ((y + x) / (z - y));
                	double tmp;
                	if (y <= -2.349987207420596e+38) {
                		tmp = t_0;
                	} else if (y <= 2.782787727800268e+40) {
                		tmp = (y + x) * (z / (z - y));
                	} else {
                		tmp = t_0;
                	}
                	return tmp;
                }
                
                def code(x, y, z):
                	t_0 = z * ((y + x) / (z - y))
                	tmp = 0
                	if y <= -2.349987207420596e+38:
                		tmp = t_0
                	elif y <= 2.782787727800268e+40:
                		tmp = (y + x) * (z / (z - y))
                	else:
                		tmp = t_0
                	return tmp
                
                function code(x, y, z)
                	t_0 = Float64(z * Float64(Float64(y + x) / Float64(z - y)))
                	tmp = 0.0
                	if (y <= -2.349987207420596e+38)
                		tmp = t_0;
                	elseif (y <= 2.782787727800268e+40)
                		tmp = Float64(Float64(y + x) * Float64(z / Float64(z - y)));
                	else
                		tmp = t_0;
                	end
                	return tmp
                end
                
                function tmp_2 = code(x, y, z)
                	t_0 = z * ((y + x) / (z - y));
                	tmp = 0.0;
                	if (y <= -2.349987207420596e+38)
                		tmp = t_0;
                	elseif (y <= 2.782787727800268e+40)
                		tmp = (y + x) * (z / (z - y));
                	else
                		tmp = t_0;
                	end
                	tmp_2 = tmp;
                end
                
                code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(N[(y + x), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.349987207420596e+38], t$95$0, If[LessEqual[y, 2.782787727800268e+40], N[(N[(y + x), $MachinePrecision] * N[(z / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
                
                f(x, y, z):
                	x in [-inf, +inf],
                	y in [-inf, +inf],
                	z in [-inf, +inf]
                code: THEORY
                BEGIN
                f(x, y, z: real): real =
                	LET t_0 = (z * ((y + x) / (z - y))) IN
                		LET tmp_1 = IF (y <= (27827877278002678491622181790330216513536)) THEN ((y + x) * (z / (z - y))) ELSE t_0 ENDIF IN
                		LET tmp = IF (y <= (-234998720742059599760376513388584370176)) THEN t_0 ELSE tmp_1 ENDIF IN
                	tmp
                END code
                \begin{array}{l}
                t_0 := z \cdot \frac{y + x}{z - y}\\
                \mathbf{if}\;y \leq -2.349987207420596 \cdot 10^{+38}:\\
                \;\;\;\;t\_0\\
                
                \mathbf{elif}\;y \leq 2.782787727800268 \cdot 10^{+40}:\\
                \;\;\;\;\left(y + x\right) \cdot \frac{z}{z - y}\\
                
                \mathbf{else}:\\
                \;\;\;\;t\_0\\
                
                
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if y < -2.349987207420596e38 or 2.7827877278002678e40 < y

                  1. Initial program 88.0%

                    \[\frac{x + y}{1 - \frac{y}{z}} \]
                  2. Step-by-step derivation
                    1. Applied rewrites92.3%

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

                    if -2.349987207420596e38 < y < 2.7827877278002678e40

                    1. Initial program 88.0%

                      \[\frac{x + y}{1 - \frac{y}{z}} \]
                    2. Step-by-step derivation
                      1. Applied rewrites88.8%

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

                    Alternative 4: 94.0% accurate, 0.7× speedup?

                    \[\begin{array}{l} t_0 := z \cdot \frac{y + x}{z - y}\\ \mathbf{if}\;y \leq -1.393380278335505 \cdot 10^{-132}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq 1.2590884414245868 \cdot 10^{-121}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \]
                    (FPCore (x y z)
                      :precision binary64
                      :pre TRUE
                      (let* ((t_0 (* z (/ (+ y x) (- z y)))))
                      (if (<= y -1.393380278335505e-132)
                        t_0
                        (if (<= y 1.2590884414245868e-121) (+ x y) t_0))))
                    double code(double x, double y, double z) {
                    	double t_0 = z * ((y + x) / (z - y));
                    	double tmp;
                    	if (y <= -1.393380278335505e-132) {
                    		tmp = t_0;
                    	} else if (y <= 1.2590884414245868e-121) {
                    		tmp = x + y;
                    	} else {
                    		tmp = t_0;
                    	}
                    	return tmp;
                    }
                    
                    real(8) function code(x, y, z)
                    use fmin_fmax_functions
                        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 * ((y + x) / (z - y))
                        if (y <= (-1.393380278335505d-132)) then
                            tmp = t_0
                        else if (y <= 1.2590884414245868d-121) 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 * ((y + x) / (z - y));
                    	double tmp;
                    	if (y <= -1.393380278335505e-132) {
                    		tmp = t_0;
                    	} else if (y <= 1.2590884414245868e-121) {
                    		tmp = x + y;
                    	} else {
                    		tmp = t_0;
                    	}
                    	return tmp;
                    }
                    
                    def code(x, y, z):
                    	t_0 = z * ((y + x) / (z - y))
                    	tmp = 0
                    	if y <= -1.393380278335505e-132:
                    		tmp = t_0
                    	elif y <= 1.2590884414245868e-121:
                    		tmp = x + y
                    	else:
                    		tmp = t_0
                    	return tmp
                    
                    function code(x, y, z)
                    	t_0 = Float64(z * Float64(Float64(y + x) / Float64(z - y)))
                    	tmp = 0.0
                    	if (y <= -1.393380278335505e-132)
                    		tmp = t_0;
                    	elseif (y <= 1.2590884414245868e-121)
                    		tmp = Float64(x + y);
                    	else
                    		tmp = t_0;
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(x, y, z)
                    	t_0 = z * ((y + x) / (z - y));
                    	tmp = 0.0;
                    	if (y <= -1.393380278335505e-132)
                    		tmp = t_0;
                    	elseif (y <= 1.2590884414245868e-121)
                    		tmp = x + y;
                    	else
                    		tmp = t_0;
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[(N[(y + x), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.393380278335505e-132], t$95$0, If[LessEqual[y, 1.2590884414245868e-121], N[(x + y), $MachinePrecision], t$95$0]]]
                    
                    f(x, y, z):
                    	x in [-inf, +inf],
                    	y in [-inf, +inf],
                    	z in [-inf, +inf]
                    code: THEORY
                    BEGIN
                    f(x, y, z: real): real =
                    	LET t_0 = (z * ((y + x) / (z - y))) IN
                    		LET tmp_1 = IF (y <= (12590884414245867916964251781670553425417828492279866593888021910993250080090161244863213897198858140141885910576060382130240866304915151059412932972558710258646141320215692889407817085927726543953633644674597646893887990114242500969246794803344558933696047747674296307472368679095407872762547862866000514259212650358676910400390625e-452)) THEN (x + y) ELSE t_0 ENDIF IN
                    		LET tmp = IF (y <= (-139338027833550495421609237833855785807980735895209602394223859933222193787226464124841903037081523468805133003768223682553246453031977759931545536458730632658134641763278300327297454251337311798227706847060284131383382562262257891156626774541822376601076696158484243728964800060628392342937379722448231107140534479706985016012055211831466294825077056884765625e-491)) THEN t_0 ELSE tmp_1 ENDIF IN
                    	tmp
                    END code
                    \begin{array}{l}
                    t_0 := z \cdot \frac{y + x}{z - y}\\
                    \mathbf{if}\;y \leq -1.393380278335505 \cdot 10^{-132}:\\
                    \;\;\;\;t\_0\\
                    
                    \mathbf{elif}\;y \leq 1.2590884414245868 \cdot 10^{-121}:\\
                    \;\;\;\;x + y\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;t\_0\\
                    
                    
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if y < -1.393380278335505e-132 or 1.2590884414245868e-121 < y

                      1. Initial program 88.0%

                        \[\frac{x + y}{1 - \frac{y}{z}} \]
                      2. Step-by-step derivation
                        1. Applied rewrites92.3%

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

                        if -1.393380278335505e-132 < y < 1.2590884414245868e-121

                        1. Initial program 88.0%

                          \[\frac{x + y}{1 - \frac{y}{z}} \]
                        2. Step-by-step derivation
                          1. Applied rewrites88.8%

                            \[\leadsto \left(y + x\right) \cdot \frac{z}{z - y} \]
                          2. Step-by-step derivation
                            1. Applied rewrites92.4%

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

                              \[\leadsto \frac{z}{\frac{z - y}{x}} \]
                            3. Step-by-step derivation
                              1. Applied rewrites45.0%

                                \[\leadsto \frac{z}{\frac{z - y}{x}} \]
                              2. Taylor expanded in z around inf

                                \[\leadsto x + y \]
                              3. Step-by-step derivation
                                1. Applied rewrites50.6%

                                  \[\leadsto x + y \]
                              4. Recombined 2 regimes into one program.
                              5. Add Preprocessing

                              Alternative 5: 75.2% accurate, 0.6× speedup?

                              \[\begin{array}{l} t_0 := \frac{y}{z - y} \cdot z\\ \mathbf{if}\;y \leq -3.2190743546567084 \cdot 10^{-42}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq -4.73466363203287 \cdot 10^{-181}:\\ \;\;\;\;x \cdot \frac{z}{z - y}\\ \mathbf{elif}\;y \leq 1.218357395521096 \cdot 10^{-7}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \]
                              (FPCore (x y z)
                                :precision binary64
                                :pre TRUE
                                (let* ((t_0 (* (/ y (- z y)) z)))
                                (if (<= y -3.2190743546567084e-42)
                                  t_0
                                  (if (<= y -4.73466363203287e-181)
                                    (* x (/ z (- z y)))
                                    (if (<= y 1.218357395521096e-7) (+ x y) t_0)))))
                              double code(double x, double y, double z) {
                              	double t_0 = (y / (z - y)) * z;
                              	double tmp;
                              	if (y <= -3.2190743546567084e-42) {
                              		tmp = t_0;
                              	} else if (y <= -4.73466363203287e-181) {
                              		tmp = x * (z / (z - y));
                              	} else if (y <= 1.218357395521096e-7) {
                              		tmp = x + y;
                              	} else {
                              		tmp = t_0;
                              	}
                              	return tmp;
                              }
                              
                              real(8) function code(x, y, z)
                              use fmin_fmax_functions
                                  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 / (z - y)) * z
                                  if (y <= (-3.2190743546567084d-42)) then
                                      tmp = t_0
                                  else if (y <= (-4.73466363203287d-181)) then
                                      tmp = x * (z / (z - y))
                                  else if (y <= 1.218357395521096d-7) 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 = (y / (z - y)) * z;
                              	double tmp;
                              	if (y <= -3.2190743546567084e-42) {
                              		tmp = t_0;
                              	} else if (y <= -4.73466363203287e-181) {
                              		tmp = x * (z / (z - y));
                              	} else if (y <= 1.218357395521096e-7) {
                              		tmp = x + y;
                              	} else {
                              		tmp = t_0;
                              	}
                              	return tmp;
                              }
                              
                              def code(x, y, z):
                              	t_0 = (y / (z - y)) * z
                              	tmp = 0
                              	if y <= -3.2190743546567084e-42:
                              		tmp = t_0
                              	elif y <= -4.73466363203287e-181:
                              		tmp = x * (z / (z - y))
                              	elif y <= 1.218357395521096e-7:
                              		tmp = x + y
                              	else:
                              		tmp = t_0
                              	return tmp
                              
                              function code(x, y, z)
                              	t_0 = Float64(Float64(y / Float64(z - y)) * z)
                              	tmp = 0.0
                              	if (y <= -3.2190743546567084e-42)
                              		tmp = t_0;
                              	elseif (y <= -4.73466363203287e-181)
                              		tmp = Float64(x * Float64(z / Float64(z - y)));
                              	elseif (y <= 1.218357395521096e-7)
                              		tmp = Float64(x + y);
                              	else
                              		tmp = t_0;
                              	end
                              	return tmp
                              end
                              
                              function tmp_2 = code(x, y, z)
                              	t_0 = (y / (z - y)) * z;
                              	tmp = 0.0;
                              	if (y <= -3.2190743546567084e-42)
                              		tmp = t_0;
                              	elseif (y <= -4.73466363203287e-181)
                              		tmp = x * (z / (z - y));
                              	elseif (y <= 1.218357395521096e-7)
                              		tmp = x + y;
                              	else
                              		tmp = t_0;
                              	end
                              	tmp_2 = tmp;
                              end
                              
                              code[x_, y_, z_] := Block[{t$95$0 = N[(N[(y / N[(z - y), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[y, -3.2190743546567084e-42], t$95$0, If[LessEqual[y, -4.73466363203287e-181], N[(x * N[(z / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.218357395521096e-7], N[(x + y), $MachinePrecision], t$95$0]]]]
                              
                              f(x, y, z):
                              	x in [-inf, +inf],
                              	y in [-inf, +inf],
                              	z in [-inf, +inf]
                              code: THEORY
                              BEGIN
                              f(x, y, z: real): real =
                              	LET t_0 = ((y / (z - y)) * z) IN
                              		LET tmp_2 = IF (y <= (121835739552109587254476760591337392014565921272151172161102294921875e-75)) THEN (x + y) ELSE t_0 ENDIF IN
                              		LET tmp_1 = IF (y <= (-4734663632032869917938737926775996076304363301531924046625645605168081914623443707539272548654688762786328737096233062537483599475836292175195387950595192747046857263437979868700255469409554212834747288476811883514543915831968463510360557257527096592511330425377670450249512797864810003927783307768410582167096042022980766605779449371542008021586849605881386176575670165330092589403825487986570776211361618841752453989202417675347979442168622199460514821112155914306640625e-652)) THEN (x * (z / (z - y))) ELSE tmp_2 ENDIF IN
                              		LET tmp = IF (y <= (-321907435465670843865925379648631418932056154541407274247954021849173747255142939905268844251927711768855762397567588095625978894531726837158203125e-188)) THEN t_0 ELSE tmp_1 ENDIF IN
                              	tmp
                              END code
                              \begin{array}{l}
                              t_0 := \frac{y}{z - y} \cdot z\\
                              \mathbf{if}\;y \leq -3.2190743546567084 \cdot 10^{-42}:\\
                              \;\;\;\;t\_0\\
                              
                              \mathbf{elif}\;y \leq -4.73466363203287 \cdot 10^{-181}:\\
                              \;\;\;\;x \cdot \frac{z}{z - y}\\
                              
                              \mathbf{elif}\;y \leq 1.218357395521096 \cdot 10^{-7}:\\
                              \;\;\;\;x + y\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;t\_0\\
                              
                              
                              \end{array}
                              
                              Derivation
                              1. Split input into 3 regimes
                              2. if y < -3.2190743546567084e-42 or 1.2183573955210959e-7 < y

                                1. Initial program 88.0%

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

                                  \[\leadsto \frac{y}{1 - \frac{y}{z}} \]
                                3. Step-by-step derivation
                                  1. Applied rewrites42.0%

                                    \[\leadsto \frac{y}{1 - \frac{y}{z}} \]
                                  2. Step-by-step derivation
                                    1. Applied rewrites49.8%

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

                                    if -3.2190743546567084e-42 < y < -4.7346636320328699e-181

                                    1. Initial program 88.0%

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

                                      \[\leadsto \frac{x}{1 - \frac{y}{z}} \]
                                    3. Step-by-step derivation
                                      1. Applied rewrites48.3%

                                        \[\leadsto \frac{x}{1 - \frac{y}{z}} \]
                                      2. Step-by-step derivation
                                        1. Applied rewrites48.5%

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

                                        if -4.7346636320328699e-181 < y < 1.2183573955210959e-7

                                        1. Initial program 88.0%

                                          \[\frac{x + y}{1 - \frac{y}{z}} \]
                                        2. Step-by-step derivation
                                          1. Applied rewrites88.8%

                                            \[\leadsto \left(y + x\right) \cdot \frac{z}{z - y} \]
                                          2. Step-by-step derivation
                                            1. Applied rewrites92.4%

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

                                              \[\leadsto \frac{z}{\frac{z - y}{x}} \]
                                            3. Step-by-step derivation
                                              1. Applied rewrites45.0%

                                                \[\leadsto \frac{z}{\frac{z - y}{x}} \]
                                              2. Taylor expanded in z around inf

                                                \[\leadsto x + y \]
                                              3. Step-by-step derivation
                                                1. Applied rewrites50.6%

                                                  \[\leadsto x + y \]
                                              4. Recombined 3 regimes into one program.
                                              5. Add Preprocessing

                                              Alternative 6: 69.0% accurate, 0.6× speedup?

                                              \[\begin{array}{l} t_0 := \frac{z}{z - y}\\ \mathbf{if}\;y \leq -8.03123504347913 \cdot 10^{+206}:\\ \;\;\;\;-z\\ \mathbf{elif}\;y \leq -3.2190743546567084 \cdot 10^{-42}:\\ \;\;\;\;y \cdot t\_0\\ \mathbf{elif}\;y \leq -4.73466363203287 \cdot 10^{-181}:\\ \;\;\;\;x \cdot t\_0\\ \mathbf{elif}\;y \leq 4.681666818528092 \cdot 10^{+63}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \]
                                              (FPCore (x y z)
                                                :precision binary64
                                                :pre TRUE
                                                (let* ((t_0 (/ z (- z y))))
                                                (if (<= y -8.03123504347913e+206)
                                                  (- z)
                                                  (if (<= y -3.2190743546567084e-42)
                                                    (* y t_0)
                                                    (if (<= y -4.73466363203287e-181)
                                                      (* x t_0)
                                                      (if (<= y 4.681666818528092e+63) (+ x y) (- z)))))))
                                              double code(double x, double y, double z) {
                                              	double t_0 = z / (z - y);
                                              	double tmp;
                                              	if (y <= -8.03123504347913e+206) {
                                              		tmp = -z;
                                              	} else if (y <= -3.2190743546567084e-42) {
                                              		tmp = y * t_0;
                                              	} else if (y <= -4.73466363203287e-181) {
                                              		tmp = x * t_0;
                                              	} else if (y <= 4.681666818528092e+63) {
                                              		tmp = x + y;
                                              	} else {
                                              		tmp = -z;
                                              	}
                                              	return tmp;
                                              }
                                              
                                              real(8) function code(x, y, z)
                                              use fmin_fmax_functions
                                                  real(8), intent (in) :: x
                                                  real(8), intent (in) :: y
                                                  real(8), intent (in) :: z
                                                  real(8) :: t_0
                                                  real(8) :: tmp
                                                  t_0 = z / (z - y)
                                                  if (y <= (-8.03123504347913d+206)) then
                                                      tmp = -z
                                                  else if (y <= (-3.2190743546567084d-42)) then
                                                      tmp = y * t_0
                                                  else if (y <= (-4.73466363203287d-181)) then
                                                      tmp = x * t_0
                                                  else if (y <= 4.681666818528092d+63) then
                                                      tmp = x + y
                                                  else
                                                      tmp = -z
                                                  end if
                                                  code = tmp
                                              end function
                                              
                                              public static double code(double x, double y, double z) {
                                              	double t_0 = z / (z - y);
                                              	double tmp;
                                              	if (y <= -8.03123504347913e+206) {
                                              		tmp = -z;
                                              	} else if (y <= -3.2190743546567084e-42) {
                                              		tmp = y * t_0;
                                              	} else if (y <= -4.73466363203287e-181) {
                                              		tmp = x * t_0;
                                              	} else if (y <= 4.681666818528092e+63) {
                                              		tmp = x + y;
                                              	} else {
                                              		tmp = -z;
                                              	}
                                              	return tmp;
                                              }
                                              
                                              def code(x, y, z):
                                              	t_0 = z / (z - y)
                                              	tmp = 0
                                              	if y <= -8.03123504347913e+206:
                                              		tmp = -z
                                              	elif y <= -3.2190743546567084e-42:
                                              		tmp = y * t_0
                                              	elif y <= -4.73466363203287e-181:
                                              		tmp = x * t_0
                                              	elif y <= 4.681666818528092e+63:
                                              		tmp = x + y
                                              	else:
                                              		tmp = -z
                                              	return tmp
                                              
                                              function code(x, y, z)
                                              	t_0 = Float64(z / Float64(z - y))
                                              	tmp = 0.0
                                              	if (y <= -8.03123504347913e+206)
                                              		tmp = Float64(-z);
                                              	elseif (y <= -3.2190743546567084e-42)
                                              		tmp = Float64(y * t_0);
                                              	elseif (y <= -4.73466363203287e-181)
                                              		tmp = Float64(x * t_0);
                                              	elseif (y <= 4.681666818528092e+63)
                                              		tmp = Float64(x + y);
                                              	else
                                              		tmp = Float64(-z);
                                              	end
                                              	return tmp
                                              end
                                              
                                              function tmp_2 = code(x, y, z)
                                              	t_0 = z / (z - y);
                                              	tmp = 0.0;
                                              	if (y <= -8.03123504347913e+206)
                                              		tmp = -z;
                                              	elseif (y <= -3.2190743546567084e-42)
                                              		tmp = y * t_0;
                                              	elseif (y <= -4.73466363203287e-181)
                                              		tmp = x * t_0;
                                              	elseif (y <= 4.681666818528092e+63)
                                              		tmp = x + y;
                                              	else
                                              		tmp = -z;
                                              	end
                                              	tmp_2 = tmp;
                                              end
                                              
                                              code[x_, y_, z_] := Block[{t$95$0 = N[(z / N[(z - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -8.03123504347913e+206], (-z), If[LessEqual[y, -3.2190743546567084e-42], N[(y * t$95$0), $MachinePrecision], If[LessEqual[y, -4.73466363203287e-181], N[(x * t$95$0), $MachinePrecision], If[LessEqual[y, 4.681666818528092e+63], N[(x + y), $MachinePrecision], (-z)]]]]]
                                              
                                              f(x, y, z):
                                              	x in [-inf, +inf],
                                              	y in [-inf, +inf],
                                              	z in [-inf, +inf]
                                              code: THEORY
                                              BEGIN
                                              f(x, y, z: real): real =
                                              	LET t_0 = (z / (z - y)) IN
                                              		LET tmp_3 = IF (y <= (4681666818528092203036118676955019348905995956188990931967410176)) THEN (x + y) ELSE (- z) ENDIF IN
                                              		LET tmp_2 = IF (y <= (-4734663632032869917938737926775996076304363301531924046625645605168081914623443707539272548654688762786328737096233062537483599475836292175195387950595192747046857263437979868700255469409554212834747288476811883514543915831968463510360557257527096592511330425377670450249512797864810003927783307768410582167096042022980766605779449371542008021586849605881386176575670165330092589403825487986570776211361618841752453989202417675347979442168622199460514821112155914306640625e-652)) THEN (x * t_0) ELSE tmp_3 ENDIF IN
                                              		LET tmp_1 = IF (y <= (-321907435465670843865925379648631418932056154541407274247954021849173747255142939905268844251927711768855762397567588095625978894531726837158203125e-188)) THEN (y * t_0) ELSE tmp_2 ENDIF IN
                                              		LET tmp = IF (y <= (-803123504347913009913273388224513530471665723338522923978604741586461544313617260628683085621740752238018556851792543899478292393703587484937124172655362631178881111759137227320373164508270778886514532155392)) THEN (- z) ELSE tmp_1 ENDIF IN
                                              	tmp
                                              END code
                                              \begin{array}{l}
                                              t_0 := \frac{z}{z - y}\\
                                              \mathbf{if}\;y \leq -8.03123504347913 \cdot 10^{+206}:\\
                                              \;\;\;\;-z\\
                                              
                                              \mathbf{elif}\;y \leq -3.2190743546567084 \cdot 10^{-42}:\\
                                              \;\;\;\;y \cdot t\_0\\
                                              
                                              \mathbf{elif}\;y \leq -4.73466363203287 \cdot 10^{-181}:\\
                                              \;\;\;\;x \cdot t\_0\\
                                              
                                              \mathbf{elif}\;y \leq 4.681666818528092 \cdot 10^{+63}:\\
                                              \;\;\;\;x + y\\
                                              
                                              \mathbf{else}:\\
                                              \;\;\;\;-z\\
                                              
                                              
                                              \end{array}
                                              
                                              Derivation
                                              1. Split input into 4 regimes
                                              2. if y < -8.0312350434791301e206 or 4.6816668185280922e63 < y

                                                1. Initial program 88.0%

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

                                                  \[\leadsto -1 \cdot z \]
                                                3. Step-by-step derivation
                                                  1. Applied rewrites34.9%

                                                    \[\leadsto -1 \cdot z \]
                                                  2. Step-by-step derivation
                                                    1. Applied rewrites34.9%

                                                      \[\leadsto -z \]

                                                    if -8.0312350434791301e206 < y < -3.2190743546567084e-42

                                                    1. Initial program 88.0%

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

                                                      \[\leadsto \frac{y}{1 - \frac{y}{z}} \]
                                                    3. Step-by-step derivation
                                                      1. Applied rewrites42.0%

                                                        \[\leadsto \frac{y}{1 - \frac{y}{z}} \]
                                                      2. Step-by-step derivation
                                                        1. Applied rewrites42.6%

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

                                                        if -3.2190743546567084e-42 < y < -4.7346636320328699e-181

                                                        1. Initial program 88.0%

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

                                                          \[\leadsto \frac{x}{1 - \frac{y}{z}} \]
                                                        3. Step-by-step derivation
                                                          1. Applied rewrites48.3%

                                                            \[\leadsto \frac{x}{1 - \frac{y}{z}} \]
                                                          2. Step-by-step derivation
                                                            1. Applied rewrites48.5%

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

                                                            if -4.7346636320328699e-181 < y < 4.6816668185280922e63

                                                            1. Initial program 88.0%

                                                              \[\frac{x + y}{1 - \frac{y}{z}} \]
                                                            2. Step-by-step derivation
                                                              1. Applied rewrites88.8%

                                                                \[\leadsto \left(y + x\right) \cdot \frac{z}{z - y} \]
                                                              2. Step-by-step derivation
                                                                1. Applied rewrites92.4%

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

                                                                  \[\leadsto \frac{z}{\frac{z - y}{x}} \]
                                                                3. Step-by-step derivation
                                                                  1. Applied rewrites45.0%

                                                                    \[\leadsto \frac{z}{\frac{z - y}{x}} \]
                                                                  2. Taylor expanded in z around inf

                                                                    \[\leadsto x + y \]
                                                                  3. Step-by-step derivation
                                                                    1. Applied rewrites50.6%

                                                                      \[\leadsto x + y \]
                                                                  4. Recombined 4 regimes into one program.
                                                                  5. Add Preprocessing

                                                                  Alternative 7: 68.1% accurate, 1.2× speedup?

                                                                  \[\begin{array}{l} \mathbf{if}\;y \leq -6.632586809221022 \cdot 10^{+115}:\\ \;\;\;\;-z\\ \mathbf{elif}\;y \leq 4.681666818528092 \cdot 10^{+63}:\\ \;\;\;\;x + y\\ \mathbf{else}:\\ \;\;\;\;-z\\ \end{array} \]
                                                                  (FPCore (x y z)
                                                                    :precision binary64
                                                                    :pre TRUE
                                                                    (if (<= y -6.632586809221022e+115)
                                                                    (- z)
                                                                    (if (<= y 4.681666818528092e+63) (+ x y) (- z))))
                                                                  double code(double x, double y, double z) {
                                                                  	double tmp;
                                                                  	if (y <= -6.632586809221022e+115) {
                                                                  		tmp = -z;
                                                                  	} else if (y <= 4.681666818528092e+63) {
                                                                  		tmp = x + y;
                                                                  	} else {
                                                                  		tmp = -z;
                                                                  	}
                                                                  	return tmp;
                                                                  }
                                                                  
                                                                  real(8) function code(x, y, z)
                                                                  use fmin_fmax_functions
                                                                      real(8), intent (in) :: x
                                                                      real(8), intent (in) :: y
                                                                      real(8), intent (in) :: z
                                                                      real(8) :: tmp
                                                                      if (y <= (-6.632586809221022d+115)) then
                                                                          tmp = -z
                                                                      else if (y <= 4.681666818528092d+63) 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 <= -6.632586809221022e+115) {
                                                                  		tmp = -z;
                                                                  	} else if (y <= 4.681666818528092e+63) {
                                                                  		tmp = x + y;
                                                                  	} else {
                                                                  		tmp = -z;
                                                                  	}
                                                                  	return tmp;
                                                                  }
                                                                  
                                                                  def code(x, y, z):
                                                                  	tmp = 0
                                                                  	if y <= -6.632586809221022e+115:
                                                                  		tmp = -z
                                                                  	elif y <= 4.681666818528092e+63:
                                                                  		tmp = x + y
                                                                  	else:
                                                                  		tmp = -z
                                                                  	return tmp
                                                                  
                                                                  function code(x, y, z)
                                                                  	tmp = 0.0
                                                                  	if (y <= -6.632586809221022e+115)
                                                                  		tmp = Float64(-z);
                                                                  	elseif (y <= 4.681666818528092e+63)
                                                                  		tmp = Float64(x + y);
                                                                  	else
                                                                  		tmp = Float64(-z);
                                                                  	end
                                                                  	return tmp
                                                                  end
                                                                  
                                                                  function tmp_2 = code(x, y, z)
                                                                  	tmp = 0.0;
                                                                  	if (y <= -6.632586809221022e+115)
                                                                  		tmp = -z;
                                                                  	elseif (y <= 4.681666818528092e+63)
                                                                  		tmp = x + y;
                                                                  	else
                                                                  		tmp = -z;
                                                                  	end
                                                                  	tmp_2 = tmp;
                                                                  end
                                                                  
                                                                  code[x_, y_, z_] := If[LessEqual[y, -6.632586809221022e+115], (-z), If[LessEqual[y, 4.681666818528092e+63], N[(x + y), $MachinePrecision], (-z)]]
                                                                  
                                                                  f(x, y, z):
                                                                  	x in [-inf, +inf],
                                                                  	y in [-inf, +inf],
                                                                  	z in [-inf, +inf]
                                                                  code: THEORY
                                                                  BEGIN
                                                                  f(x, y, z: real): real =
                                                                  	LET tmp_1 = IF (y <= (4681666818528092203036118676955019348905995956188990931967410176)) THEN (x + y) ELSE (- z) ENDIF IN
                                                                  	LET tmp = IF (y <= (-66325868092210219984679563846771621306077676758794470155515335874769546430828771989845968860035693982987589091590144)) THEN (- z) ELSE tmp_1 ENDIF IN
                                                                  	tmp
                                                                  END code
                                                                  \begin{array}{l}
                                                                  \mathbf{if}\;y \leq -6.632586809221022 \cdot 10^{+115}:\\
                                                                  \;\;\;\;-z\\
                                                                  
                                                                  \mathbf{elif}\;y \leq 4.681666818528092 \cdot 10^{+63}:\\
                                                                  \;\;\;\;x + y\\
                                                                  
                                                                  \mathbf{else}:\\
                                                                  \;\;\;\;-z\\
                                                                  
                                                                  
                                                                  \end{array}
                                                                  
                                                                  Derivation
                                                                  1. Split input into 2 regimes
                                                                  2. if y < -6.632586809221022e115 or 4.6816668185280922e63 < y

                                                                    1. Initial program 88.0%

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

                                                                      \[\leadsto -1 \cdot z \]
                                                                    3. Step-by-step derivation
                                                                      1. Applied rewrites34.9%

                                                                        \[\leadsto -1 \cdot z \]
                                                                      2. Step-by-step derivation
                                                                        1. Applied rewrites34.9%

                                                                          \[\leadsto -z \]

                                                                        if -6.632586809221022e115 < y < 4.6816668185280922e63

                                                                        1. Initial program 88.0%

                                                                          \[\frac{x + y}{1 - \frac{y}{z}} \]
                                                                        2. Step-by-step derivation
                                                                          1. Applied rewrites88.8%

                                                                            \[\leadsto \left(y + x\right) \cdot \frac{z}{z - y} \]
                                                                          2. Step-by-step derivation
                                                                            1. Applied rewrites92.4%

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

                                                                              \[\leadsto \frac{z}{\frac{z - y}{x}} \]
                                                                            3. Step-by-step derivation
                                                                              1. Applied rewrites45.0%

                                                                                \[\leadsto \frac{z}{\frac{z - y}{x}} \]
                                                                              2. Taylor expanded in z around inf

                                                                                \[\leadsto x + y \]
                                                                              3. Step-by-step derivation
                                                                                1. Applied rewrites50.6%

                                                                                  \[\leadsto x + y \]
                                                                              4. Recombined 2 regimes into one program.
                                                                              5. Add Preprocessing

                                                                              Alternative 8: 34.9% accurate, 6.9× speedup?

                                                                              \[-z \]
                                                                              (FPCore (x y z)
                                                                                :precision binary64
                                                                                :pre TRUE
                                                                                (- z))
                                                                              double code(double x, double y, double z) {
                                                                              	return -z;
                                                                              }
                                                                              
                                                                              real(8) function code(x, y, z)
                                                                              use fmin_fmax_functions
                                                                                  real(8), intent (in) :: x
                                                                                  real(8), intent (in) :: y
                                                                                  real(8), intent (in) :: z
                                                                                  code = -z
                                                                              end function
                                                                              
                                                                              public static double code(double x, double y, double z) {
                                                                              	return -z;
                                                                              }
                                                                              
                                                                              def code(x, y, z):
                                                                              	return -z
                                                                              
                                                                              function code(x, y, z)
                                                                              	return Float64(-z)
                                                                              end
                                                                              
                                                                              function tmp = code(x, y, z)
                                                                              	tmp = -z;
                                                                              end
                                                                              
                                                                              code[x_, y_, z_] := (-z)
                                                                              
                                                                              f(x, y, z):
                                                                              	x in [-inf, +inf],
                                                                              	y in [-inf, +inf],
                                                                              	z in [-inf, +inf]
                                                                              code: THEORY
                                                                              BEGIN
                                                                              f(x, y, z: real): real =
                                                                              	- z
                                                                              END code
                                                                              -z
                                                                              
                                                                              Derivation
                                                                              1. Initial program 88.0%

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

                                                                                \[\leadsto -1 \cdot z \]
                                                                              3. Step-by-step derivation
                                                                                1. Applied rewrites34.9%

                                                                                  \[\leadsto -1 \cdot z \]
                                                                                2. Step-by-step derivation
                                                                                  1. Applied rewrites34.9%

                                                                                    \[\leadsto -z \]
                                                                                  2. Add Preprocessing

                                                                                  Reproduce

                                                                                  ?
                                                                                  herbie shell --seed 2026092 
                                                                                  (FPCore (x y z)
                                                                                    :name "Graphics.Rendering.Chart.Backend.Diagrams:calcFontMetrics from Chart-diagrams-1.5.1, A"
                                                                                    :precision binary64
                                                                                    (/ (+ x y) (- 1.0 (/ y z))))