Graphics.Rasterific.Svg.PathConverter:segmentToBezier from rasterific-svg-0.2.3.1, C

Percentage Accurate: 99.9% → 99.9%
Time: 10.8s
Alternatives: 13
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ \left(x + \sin y\right) + z \cdot \cos y \end{array} \]
(FPCore (x y z) :precision binary64 (+ (+ x (sin y)) (* z (cos y))))
double code(double x, double y, double z) {
	return (x + sin(y)) + (z * cos(y));
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = (x + sin(y)) + (z * cos(y))
end function
public static double code(double x, double y, double z) {
	return (x + Math.sin(y)) + (z * Math.cos(y));
}
def code(x, y, z):
	return (x + math.sin(y)) + (z * math.cos(y))
function code(x, y, z)
	return Float64(Float64(x + sin(y)) + Float64(z * cos(y)))
end
function tmp = code(x, y, z)
	tmp = (x + sin(y)) + (z * cos(y));
end
code[x_, y_, z_] := N[(N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision] + N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(x + \sin y\right) + z \cdot \cos y
\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 13 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: 99.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(x + \sin y\right) + z \cdot \cos y \end{array} \]
(FPCore (x y z) :precision binary64 (+ (+ x (sin y)) (* z (cos y))))
double code(double x, double y, double z) {
	return (x + sin(y)) + (z * cos(y));
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = (x + sin(y)) + (z * cos(y))
end function
public static double code(double x, double y, double z) {
	return (x + Math.sin(y)) + (z * Math.cos(y));
}
def code(x, y, z):
	return (x + math.sin(y)) + (z * math.cos(y))
function code(x, y, z)
	return Float64(Float64(x + sin(y)) + Float64(z * cos(y)))
end
function tmp = code(x, y, z)
	tmp = (x + sin(y)) + (z * cos(y));
end
code[x_, y_, z_] := N[(N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision] + N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(x + \sin y\right) + z \cdot \cos y
\end{array}

Alternative 1: 99.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ z \cdot \cos y + \left(x + \sin y\right) \end{array} \]
(FPCore (x y z) :precision binary64 (+ (* z (cos y)) (+ x (sin y))))
double code(double x, double y, double z) {
	return (z * cos(y)) + (x + sin(y));
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = (z * cos(y)) + (x + sin(y))
end function
public static double code(double x, double y, double z) {
	return (z * Math.cos(y)) + (x + Math.sin(y));
}
def code(x, y, z):
	return (z * math.cos(y)) + (x + math.sin(y))
function code(x, y, z)
	return Float64(Float64(z * cos(y)) + Float64(x + sin(y)))
end
function tmp = code(x, y, z)
	tmp = (z * cos(y)) + (x + sin(y));
end
code[x_, y_, z_] := N[(N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision] + N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
z \cdot \cos y + \left(x + \sin y\right)
\end{array}
Derivation
  1. Initial program 99.9%

    \[\left(x + \sin y\right) + z \cdot \cos y \]
  2. Add Preprocessing
  3. Final simplification99.9%

    \[\leadsto z \cdot \cos y + \left(x + \sin y\right) \]
  4. Add Preprocessing

Alternative 2: 95.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := z \cdot \cos y\\ t_1 := x + t\_0\\ \mathbf{if}\;x \leq -3.65 \cdot 10^{-59}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 1.75 \cdot 10^{-15}:\\ \;\;\;\;\sin y + t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* z (cos y))) (t_1 (+ x t_0)))
   (if (<= x -3.65e-59) t_1 (if (<= x 1.75e-15) (+ (sin y) t_0) t_1))))
double code(double x, double y, double z) {
	double t_0 = z * cos(y);
	double t_1 = x + t_0;
	double tmp;
	if (x <= -3.65e-59) {
		tmp = t_1;
	} else if (x <= 1.75e-15) {
		tmp = sin(y) + t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = z * cos(y)
    t_1 = x + t_0
    if (x <= (-3.65d-59)) then
        tmp = t_1
    else if (x <= 1.75d-15) then
        tmp = sin(y) + t_0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = z * Math.cos(y);
	double t_1 = x + t_0;
	double tmp;
	if (x <= -3.65e-59) {
		tmp = t_1;
	} else if (x <= 1.75e-15) {
		tmp = Math.sin(y) + t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = z * math.cos(y)
	t_1 = x + t_0
	tmp = 0
	if x <= -3.65e-59:
		tmp = t_1
	elif x <= 1.75e-15:
		tmp = math.sin(y) + t_0
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(z * cos(y))
	t_1 = Float64(x + t_0)
	tmp = 0.0
	if (x <= -3.65e-59)
		tmp = t_1;
	elseif (x <= 1.75e-15)
		tmp = Float64(sin(y) + t_0);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = z * cos(y);
	t_1 = x + t_0;
	tmp = 0.0;
	if (x <= -3.65e-59)
		tmp = t_1;
	elseif (x <= 1.75e-15)
		tmp = sin(y) + t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x + t$95$0), $MachinePrecision]}, If[LessEqual[x, -3.65e-59], t$95$1, If[LessEqual[x, 1.75e-15], N[(N[Sin[y], $MachinePrecision] + t$95$0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := z \cdot \cos y\\
t_1 := x + t\_0\\
\mathbf{if}\;x \leq -3.65 \cdot 10^{-59}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 1.75 \cdot 10^{-15}:\\
\;\;\;\;\sin y + t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.6500000000000002e-59 or 1.75e-15 < x

    1. Initial program 100.0%

      \[\left(x + \sin y\right) + z \cdot \cos y \]
    2. Add Preprocessing
    3. Taylor expanded in x around inf

      \[\leadsto \mathsf{+.f64}\left(\color{blue}{x}, \mathsf{*.f64}\left(z, \mathsf{cos.f64}\left(y\right)\right)\right) \]
    4. Step-by-step derivation
      1. Simplified98.1%

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

      if -3.6500000000000002e-59 < x < 1.75e-15

      1. Initial program 99.9%

        \[\left(x + \sin y\right) + z \cdot \cos y \]
      2. Add Preprocessing
      3. Taylor expanded in x around 0

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

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

          \[\leadsto \mathsf{+.f64}\left(\mathsf{sin.f64}\left(y\right), \left(\color{blue}{z} \cdot \cos y\right)\right) \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{sin.f64}\left(y\right), \mathsf{*.f64}\left(z, \color{blue}{\cos y}\right)\right) \]
        4. cos-lowering-cos.f6497.5%

          \[\leadsto \mathsf{+.f64}\left(\mathsf{sin.f64}\left(y\right), \mathsf{*.f64}\left(z, \mathsf{cos.f64}\left(y\right)\right)\right) \]
      5. Simplified97.5%

        \[\leadsto \color{blue}{\sin y + z \cdot \cos y} \]
    5. Recombined 2 regimes into one program.
    6. Add Preprocessing

    Alternative 3: 84.0% accurate, 1.8× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := z \cdot \cos y\\ \mathbf{if}\;z \leq -36000000000000:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 9.8 \cdot 10^{-23}:\\ \;\;\;\;x + \sin y\\ \mathbf{elif}\;z \leq 3.95 \cdot 10^{+102}:\\ \;\;\;\;x + z\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
    (FPCore (x y z)
     :precision binary64
     (let* ((t_0 (* z (cos y))))
       (if (<= z -36000000000000.0)
         t_0
         (if (<= z 9.8e-23) (+ x (sin y)) (if (<= z 3.95e+102) (+ x z) t_0)))))
    double code(double x, double y, double z) {
    	double t_0 = z * cos(y);
    	double tmp;
    	if (z <= -36000000000000.0) {
    		tmp = t_0;
    	} else if (z <= 9.8e-23) {
    		tmp = x + sin(y);
    	} else if (z <= 3.95e+102) {
    		tmp = x + z;
    	} else {
    		tmp = t_0;
    	}
    	return tmp;
    }
    
    real(8) function code(x, y, z)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8) :: t_0
        real(8) :: tmp
        t_0 = z * cos(y)
        if (z <= (-36000000000000.0d0)) then
            tmp = t_0
        else if (z <= 9.8d-23) then
            tmp = x + sin(y)
        else if (z <= 3.95d+102) then
            tmp = x + z
        else
            tmp = t_0
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z) {
    	double t_0 = z * Math.cos(y);
    	double tmp;
    	if (z <= -36000000000000.0) {
    		tmp = t_0;
    	} else if (z <= 9.8e-23) {
    		tmp = x + Math.sin(y);
    	} else if (z <= 3.95e+102) {
    		tmp = x + z;
    	} else {
    		tmp = t_0;
    	}
    	return tmp;
    }
    
    def code(x, y, z):
    	t_0 = z * math.cos(y)
    	tmp = 0
    	if z <= -36000000000000.0:
    		tmp = t_0
    	elif z <= 9.8e-23:
    		tmp = x + math.sin(y)
    	elif z <= 3.95e+102:
    		tmp = x + z
    	else:
    		tmp = t_0
    	return tmp
    
    function code(x, y, z)
    	t_0 = Float64(z * cos(y))
    	tmp = 0.0
    	if (z <= -36000000000000.0)
    		tmp = t_0;
    	elseif (z <= 9.8e-23)
    		tmp = Float64(x + sin(y));
    	elseif (z <= 3.95e+102)
    		tmp = Float64(x + z);
    	else
    		tmp = t_0;
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z)
    	t_0 = z * cos(y);
    	tmp = 0.0;
    	if (z <= -36000000000000.0)
    		tmp = t_0;
    	elseif (z <= 9.8e-23)
    		tmp = x + sin(y);
    	elseif (z <= 3.95e+102)
    		tmp = x + z;
    	else
    		tmp = t_0;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -36000000000000.0], t$95$0, If[LessEqual[z, 9.8e-23], N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.95e+102], N[(x + z), $MachinePrecision], t$95$0]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := z \cdot \cos y\\
    \mathbf{if}\;z \leq -36000000000000:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;z \leq 9.8 \cdot 10^{-23}:\\
    \;\;\;\;x + \sin y\\
    
    \mathbf{elif}\;z \leq 3.95 \cdot 10^{+102}:\\
    \;\;\;\;x + z\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if z < -3.6e13 or 3.9500000000000001e102 < z

      1. Initial program 99.9%

        \[\left(x + \sin y\right) + z \cdot \cos y \]
      2. Add Preprocessing
      3. Taylor expanded in z around inf

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

          \[\leadsto \mathsf{*.f64}\left(z, \color{blue}{\cos y}\right) \]
        2. cos-lowering-cos.f6482.5%

          \[\leadsto \mathsf{*.f64}\left(z, \mathsf{cos.f64}\left(y\right)\right) \]
      5. Simplified82.5%

        \[\leadsto \color{blue}{z \cdot \cos y} \]

      if -3.6e13 < z < 9.7999999999999996e-23

      1. Initial program 100.0%

        \[\left(x + \sin y\right) + z \cdot \cos y \]
      2. Add Preprocessing
      3. Taylor expanded in z around 0

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

          \[\leadsto \sin y + \color{blue}{x} \]
        2. +-lowering-+.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\sin y, \color{blue}{x}\right) \]
        3. sin-lowering-sin.f6492.4%

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

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

      if 9.7999999999999996e-23 < z < 3.9500000000000001e102

      1. Initial program 99.9%

        \[\left(x + \sin y\right) + z \cdot \cos y \]
      2. Add Preprocessing
      3. Taylor expanded in y around 0

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

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -36000000000000:\\ \;\;\;\;z \cdot \cos y\\ \mathbf{elif}\;z \leq 9.8 \cdot 10^{-23}:\\ \;\;\;\;x + \sin y\\ \mathbf{elif}\;z \leq 3.95 \cdot 10^{+102}:\\ \;\;\;\;x + z\\ \mathbf{else}:\\ \;\;\;\;z \cdot \cos y\\ \end{array} \]
    5. Add Preprocessing

    Alternative 4: 95.1% accurate, 1.8× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := x + z \cdot \cos y\\ \mathbf{if}\;z \leq -4.8 \cdot 10^{-49}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 8 \cdot 10^{-19}:\\ \;\;\;\;x + \sin y\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
    (FPCore (x y z)
     :precision binary64
     (let* ((t_0 (+ x (* z (cos y)))))
       (if (<= z -4.8e-49) t_0 (if (<= z 8e-19) (+ x (sin y)) t_0))))
    double code(double x, double y, double z) {
    	double t_0 = x + (z * cos(y));
    	double tmp;
    	if (z <= -4.8e-49) {
    		tmp = t_0;
    	} else if (z <= 8e-19) {
    		tmp = x + sin(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 + (z * cos(y))
        if (z <= (-4.8d-49)) then
            tmp = t_0
        else if (z <= 8d-19) then
            tmp = x + sin(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 + (z * Math.cos(y));
    	double tmp;
    	if (z <= -4.8e-49) {
    		tmp = t_0;
    	} else if (z <= 8e-19) {
    		tmp = x + Math.sin(y);
    	} else {
    		tmp = t_0;
    	}
    	return tmp;
    }
    
    def code(x, y, z):
    	t_0 = x + (z * math.cos(y))
    	tmp = 0
    	if z <= -4.8e-49:
    		tmp = t_0
    	elif z <= 8e-19:
    		tmp = x + math.sin(y)
    	else:
    		tmp = t_0
    	return tmp
    
    function code(x, y, z)
    	t_0 = Float64(x + Float64(z * cos(y)))
    	tmp = 0.0
    	if (z <= -4.8e-49)
    		tmp = t_0;
    	elseif (z <= 8e-19)
    		tmp = Float64(x + sin(y));
    	else
    		tmp = t_0;
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z)
    	t_0 = x + (z * cos(y));
    	tmp = 0.0;
    	if (z <= -4.8e-49)
    		tmp = t_0;
    	elseif (z <= 8e-19)
    		tmp = x + sin(y);
    	else
    		tmp = t_0;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.8e-49], t$95$0, If[LessEqual[z, 8e-19], N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision], t$95$0]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := x + z \cdot \cos y\\
    \mathbf{if}\;z \leq -4.8 \cdot 10^{-49}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;z \leq 8 \cdot 10^{-19}:\\
    \;\;\;\;x + \sin y\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if z < -4.79999999999999985e-49 or 7.9999999999999998e-19 < z

      1. Initial program 99.9%

        \[\left(x + \sin y\right) + z \cdot \cos y \]
      2. Add Preprocessing
      3. Taylor expanded in x around inf

        \[\leadsto \mathsf{+.f64}\left(\color{blue}{x}, \mathsf{*.f64}\left(z, \mathsf{cos.f64}\left(y\right)\right)\right) \]
      4. Step-by-step derivation
        1. Simplified99.3%

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

        if -4.79999999999999985e-49 < z < 7.9999999999999998e-19

        1. Initial program 100.0%

          \[\left(x + \sin y\right) + z \cdot \cos y \]
        2. Add Preprocessing
        3. Taylor expanded in z around 0

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

            \[\leadsto \sin y + \color{blue}{x} \]
          2. +-lowering-+.f64N/A

            \[\leadsto \mathsf{+.f64}\left(\sin y, \color{blue}{x}\right) \]
          3. sin-lowering-sin.f6495.1%

            \[\leadsto \mathsf{+.f64}\left(\mathsf{sin.f64}\left(y\right), x\right) \]
        5. Simplified95.1%

          \[\leadsto \color{blue}{\sin y + x} \]
      5. Recombined 2 regimes into one program.
      6. Final simplification97.6%

        \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.8 \cdot 10^{-49}:\\ \;\;\;\;x + z \cdot \cos y\\ \mathbf{elif}\;z \leq 8 \cdot 10^{-19}:\\ \;\;\;\;x + \sin y\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot \cos y\\ \end{array} \]
      7. Add Preprocessing

      Alternative 5: 73.0% accurate, 1.8× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -7600000:\\ \;\;\;\;x + z\\ \mathbf{elif}\;x \leq 5 \cdot 10^{-16}:\\ \;\;\;\;z \cdot \cos y\\ \mathbf{else}:\\ \;\;\;\;x + z\\ \end{array} \end{array} \]
      (FPCore (x y z)
       :precision binary64
       (if (<= x -7600000.0) (+ x z) (if (<= x 5e-16) (* z (cos y)) (+ x z))))
      double code(double x, double y, double z) {
      	double tmp;
      	if (x <= -7600000.0) {
      		tmp = x + z;
      	} else if (x <= 5e-16) {
      		tmp = z * cos(y);
      	} else {
      		tmp = x + 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 (x <= (-7600000.0d0)) then
              tmp = x + z
          else if (x <= 5d-16) then
              tmp = z * cos(y)
          else
              tmp = x + z
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z) {
      	double tmp;
      	if (x <= -7600000.0) {
      		tmp = x + z;
      	} else if (x <= 5e-16) {
      		tmp = z * Math.cos(y);
      	} else {
      		tmp = x + z;
      	}
      	return tmp;
      }
      
      def code(x, y, z):
      	tmp = 0
      	if x <= -7600000.0:
      		tmp = x + z
      	elif x <= 5e-16:
      		tmp = z * math.cos(y)
      	else:
      		tmp = x + z
      	return tmp
      
      function code(x, y, z)
      	tmp = 0.0
      	if (x <= -7600000.0)
      		tmp = Float64(x + z);
      	elseif (x <= 5e-16)
      		tmp = Float64(z * cos(y));
      	else
      		tmp = Float64(x + z);
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z)
      	tmp = 0.0;
      	if (x <= -7600000.0)
      		tmp = x + z;
      	elseif (x <= 5e-16)
      		tmp = z * cos(y);
      	else
      		tmp = x + z;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_] := If[LessEqual[x, -7600000.0], N[(x + z), $MachinePrecision], If[LessEqual[x, 5e-16], N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision], N[(x + z), $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;x \leq -7600000:\\
      \;\;\;\;x + z\\
      
      \mathbf{elif}\;x \leq 5 \cdot 10^{-16}:\\
      \;\;\;\;z \cdot \cos y\\
      
      \mathbf{else}:\\
      \;\;\;\;x + z\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if x < -7.6e6 or 5.0000000000000004e-16 < x

        1. Initial program 100.0%

          \[\left(x + \sin y\right) + z \cdot \cos y \]
        2. Add Preprocessing
        3. Taylor expanded in y around 0

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

            \[\leadsto z + \color{blue}{x} \]
          2. +-lowering-+.f6487.2%

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

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

        if -7.6e6 < x < 5.0000000000000004e-16

        1. Initial program 99.9%

          \[\left(x + \sin y\right) + z \cdot \cos y \]
        2. Add Preprocessing
        3. Taylor expanded in z around inf

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

            \[\leadsto \mathsf{*.f64}\left(z, \color{blue}{\cos y}\right) \]
          2. cos-lowering-cos.f6464.8%

            \[\leadsto \mathsf{*.f64}\left(z, \mathsf{cos.f64}\left(y\right)\right) \]
        5. Simplified64.8%

          \[\leadsto \color{blue}{z \cdot \cos y} \]
      3. Recombined 2 regimes into one program.
      4. Final simplification75.6%

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

      Alternative 6: 69.1% accurate, 1.9× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2.4 \cdot 10^{+73}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;y \leq -3.1:\\ \;\;\;\;\sin y\\ \mathbf{elif}\;y \leq 2.8 \cdot 10^{-7}:\\ \;\;\;\;y + \left(x + z \cdot \left(1 + -0.5 \cdot \left(y \cdot y\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x + z\\ \end{array} \end{array} \]
      (FPCore (x y z)
       :precision binary64
       (if (<= y -2.4e+73)
         (+ x z)
         (if (<= y -3.1)
           (sin y)
           (if (<= y 2.8e-7) (+ y (+ x (* z (+ 1.0 (* -0.5 (* y y)))))) (+ x z)))))
      double code(double x, double y, double z) {
      	double tmp;
      	if (y <= -2.4e+73) {
      		tmp = x + z;
      	} else if (y <= -3.1) {
      		tmp = sin(y);
      	} else if (y <= 2.8e-7) {
      		tmp = y + (x + (z * (1.0 + (-0.5 * (y * y)))));
      	} else {
      		tmp = x + z;
      	}
      	return tmp;
      }
      
      real(8) function code(x, y, z)
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8) :: tmp
          if (y <= (-2.4d+73)) then
              tmp = x + z
          else if (y <= (-3.1d0)) then
              tmp = sin(y)
          else if (y <= 2.8d-7) then
              tmp = y + (x + (z * (1.0d0 + ((-0.5d0) * (y * y)))))
          else
              tmp = x + z
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z) {
      	double tmp;
      	if (y <= -2.4e+73) {
      		tmp = x + z;
      	} else if (y <= -3.1) {
      		tmp = Math.sin(y);
      	} else if (y <= 2.8e-7) {
      		tmp = y + (x + (z * (1.0 + (-0.5 * (y * y)))));
      	} else {
      		tmp = x + z;
      	}
      	return tmp;
      }
      
      def code(x, y, z):
      	tmp = 0
      	if y <= -2.4e+73:
      		tmp = x + z
      	elif y <= -3.1:
      		tmp = math.sin(y)
      	elif y <= 2.8e-7:
      		tmp = y + (x + (z * (1.0 + (-0.5 * (y * y)))))
      	else:
      		tmp = x + z
      	return tmp
      
      function code(x, y, z)
      	tmp = 0.0
      	if (y <= -2.4e+73)
      		tmp = Float64(x + z);
      	elseif (y <= -3.1)
      		tmp = sin(y);
      	elseif (y <= 2.8e-7)
      		tmp = Float64(y + Float64(x + Float64(z * Float64(1.0 + Float64(-0.5 * Float64(y * y))))));
      	else
      		tmp = Float64(x + z);
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z)
      	tmp = 0.0;
      	if (y <= -2.4e+73)
      		tmp = x + z;
      	elseif (y <= -3.1)
      		tmp = sin(y);
      	elseif (y <= 2.8e-7)
      		tmp = y + (x + (z * (1.0 + (-0.5 * (y * y)))));
      	else
      		tmp = x + z;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_] := If[LessEqual[y, -2.4e+73], N[(x + z), $MachinePrecision], If[LessEqual[y, -3.1], N[Sin[y], $MachinePrecision], If[LessEqual[y, 2.8e-7], N[(y + N[(x + N[(z * N[(1.0 + N[(-0.5 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + z), $MachinePrecision]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;y \leq -2.4 \cdot 10^{+73}:\\
      \;\;\;\;x + z\\
      
      \mathbf{elif}\;y \leq -3.1:\\
      \;\;\;\;\sin y\\
      
      \mathbf{elif}\;y \leq 2.8 \cdot 10^{-7}:\\
      \;\;\;\;y + \left(x + z \cdot \left(1 + -0.5 \cdot \left(y \cdot y\right)\right)\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;x + z\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if y < -2.40000000000000002e73 or 2.80000000000000019e-7 < y

        1. Initial program 99.9%

          \[\left(x + \sin y\right) + z \cdot \cos y \]
        2. Add Preprocessing
        3. Taylor expanded in y around 0

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

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

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

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

        if -2.40000000000000002e73 < y < -3.10000000000000009

        1. Initial program 100.0%

          \[\left(x + \sin y\right) + z \cdot \cos y \]
        2. Add Preprocessing
        3. Taylor expanded in z around 0

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

            \[\leadsto \sin y + \color{blue}{x} \]
          2. +-lowering-+.f64N/A

            \[\leadsto \mathsf{+.f64}\left(\sin y, \color{blue}{x}\right) \]
          3. sin-lowering-sin.f6462.3%

            \[\leadsto \mathsf{+.f64}\left(\mathsf{sin.f64}\left(y\right), x\right) \]
        5. Simplified62.3%

          \[\leadsto \color{blue}{\sin y + x} \]
        6. Taylor expanded in x around 0

          \[\leadsto \color{blue}{\sin y} \]
        7. Step-by-step derivation
          1. sin-lowering-sin.f6452.2%

            \[\leadsto \mathsf{sin.f64}\left(y\right) \]
        8. Simplified52.2%

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

        if -3.10000000000000009 < y < 2.80000000000000019e-7

        1. Initial program 100.0%

          \[\left(x + \sin y\right) + z \cdot \cos y \]
        2. Add Preprocessing
        3. Taylor expanded in y around 0

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

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

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

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

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

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

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

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

            \[\leadsto x + \left(\left(y + z\right) + \color{blue}{\left(\frac{-1}{2} \cdot z\right)} \cdot {y}^{2}\right) \]
          9. associate-+r+N/A

            \[\leadsto x + \left(y + \color{blue}{\left(z + \left(\frac{-1}{2} \cdot z\right) \cdot {y}^{2}\right)}\right) \]
          10. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(y, x\right), \mathsf{*.f64}\left(z, \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{-1}{2} \cdot {y}^{2}\right)}\right)\right)\right) \]
        5. Simplified100.0%

          \[\leadsto \color{blue}{\left(y + x\right) + z \cdot \left(1 + -0.5 \cdot \left(y \cdot y\right)\right)} \]
        6. Step-by-step derivation
          1. associate-+l+N/A

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

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

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

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

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

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

            \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(x, \mathsf{*.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \left(y \cdot y\right)\right)\right)\right)\right), y\right) \]
          8. *-lowering-*.f64100.0%

            \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(x, \mathsf{*.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(y, y\right)\right)\right)\right)\right), y\right) \]
        7. Applied egg-rr100.0%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.4 \cdot 10^{+73}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;y \leq -3.1:\\ \;\;\;\;\sin y\\ \mathbf{elif}\;y \leq 2.8 \cdot 10^{-7}:\\ \;\;\;\;y + \left(x + z \cdot \left(1 + -0.5 \cdot \left(y \cdot y\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x + z\\ \end{array} \]
      5. Add Preprocessing

      Alternative 7: 69.8% accurate, 7.7× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -105000000:\\ \;\;\;\;x + z\\ \mathbf{elif}\;y \leq 2.8 \cdot 10^{-7}:\\ \;\;\;\;\left(x + z\right) + y \cdot \left(1 + y \cdot \left(z \cdot -0.5 + y \cdot -0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x + z\\ \end{array} \end{array} \]
      (FPCore (x y z)
       :precision binary64
       (if (<= y -105000000.0)
         (+ x z)
         (if (<= y 2.8e-7)
           (+ (+ x z) (* y (+ 1.0 (* y (+ (* z -0.5) (* y -0.16666666666666666))))))
           (+ x z))))
      double code(double x, double y, double z) {
      	double tmp;
      	if (y <= -105000000.0) {
      		tmp = x + z;
      	} else if (y <= 2.8e-7) {
      		tmp = (x + z) + (y * (1.0 + (y * ((z * -0.5) + (y * -0.16666666666666666)))));
      	} else {
      		tmp = x + 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 <= (-105000000.0d0)) then
              tmp = x + z
          else if (y <= 2.8d-7) then
              tmp = (x + z) + (y * (1.0d0 + (y * ((z * (-0.5d0)) + (y * (-0.16666666666666666d0))))))
          else
              tmp = x + z
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z) {
      	double tmp;
      	if (y <= -105000000.0) {
      		tmp = x + z;
      	} else if (y <= 2.8e-7) {
      		tmp = (x + z) + (y * (1.0 + (y * ((z * -0.5) + (y * -0.16666666666666666)))));
      	} else {
      		tmp = x + z;
      	}
      	return tmp;
      }
      
      def code(x, y, z):
      	tmp = 0
      	if y <= -105000000.0:
      		tmp = x + z
      	elif y <= 2.8e-7:
      		tmp = (x + z) + (y * (1.0 + (y * ((z * -0.5) + (y * -0.16666666666666666)))))
      	else:
      		tmp = x + z
      	return tmp
      
      function code(x, y, z)
      	tmp = 0.0
      	if (y <= -105000000.0)
      		tmp = Float64(x + z);
      	elseif (y <= 2.8e-7)
      		tmp = Float64(Float64(x + z) + Float64(y * Float64(1.0 + Float64(y * Float64(Float64(z * -0.5) + Float64(y * -0.16666666666666666))))));
      	else
      		tmp = Float64(x + z);
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z)
      	tmp = 0.0;
      	if (y <= -105000000.0)
      		tmp = x + z;
      	elseif (y <= 2.8e-7)
      		tmp = (x + z) + (y * (1.0 + (y * ((z * -0.5) + (y * -0.16666666666666666)))));
      	else
      		tmp = x + z;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_] := If[LessEqual[y, -105000000.0], N[(x + z), $MachinePrecision], If[LessEqual[y, 2.8e-7], N[(N[(x + z), $MachinePrecision] + N[(y * N[(1.0 + N[(y * N[(N[(z * -0.5), $MachinePrecision] + N[(y * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + z), $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;y \leq -105000000:\\
      \;\;\;\;x + z\\
      
      \mathbf{elif}\;y \leq 2.8 \cdot 10^{-7}:\\
      \;\;\;\;\left(x + z\right) + y \cdot \left(1 + y \cdot \left(z \cdot -0.5 + y \cdot -0.16666666666666666\right)\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;x + z\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if y < -1.05e8 or 2.80000000000000019e-7 < y

        1. Initial program 99.9%

          \[\left(x + \sin y\right) + z \cdot \cos y \]
        2. Add Preprocessing
        3. Taylor expanded in y around 0

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

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

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

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

        if -1.05e8 < y < 2.80000000000000019e-7

        1. Initial program 100.0%

          \[\left(x + \sin y\right) + z \cdot \cos y \]
        2. Add Preprocessing
        3. Taylor expanded in y around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -105000000:\\ \;\;\;\;x + z\\ \mathbf{elif}\;y \leq 2.8 \cdot 10^{-7}:\\ \;\;\;\;\left(x + z\right) + y \cdot \left(1 + y \cdot \left(z \cdot -0.5 + y \cdot -0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x + z\\ \end{array} \]
      5. Add Preprocessing

      Alternative 8: 69.7% accurate, 9.0× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -110000000:\\ \;\;\;\;x + z\\ \mathbf{elif}\;y \leq 2.8 \cdot 10^{-7}:\\ \;\;\;\;y + \left(x + z \cdot \left(1 + -0.5 \cdot \left(y \cdot y\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x + z\\ \end{array} \end{array} \]
      (FPCore (x y z)
       :precision binary64
       (if (<= y -110000000.0)
         (+ x z)
         (if (<= y 2.8e-7) (+ y (+ x (* z (+ 1.0 (* -0.5 (* y y)))))) (+ x z))))
      double code(double x, double y, double z) {
      	double tmp;
      	if (y <= -110000000.0) {
      		tmp = x + z;
      	} else if (y <= 2.8e-7) {
      		tmp = y + (x + (z * (1.0 + (-0.5 * (y * y)))));
      	} else {
      		tmp = x + 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 <= (-110000000.0d0)) then
              tmp = x + z
          else if (y <= 2.8d-7) then
              tmp = y + (x + (z * (1.0d0 + ((-0.5d0) * (y * y)))))
          else
              tmp = x + z
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z) {
      	double tmp;
      	if (y <= -110000000.0) {
      		tmp = x + z;
      	} else if (y <= 2.8e-7) {
      		tmp = y + (x + (z * (1.0 + (-0.5 * (y * y)))));
      	} else {
      		tmp = x + z;
      	}
      	return tmp;
      }
      
      def code(x, y, z):
      	tmp = 0
      	if y <= -110000000.0:
      		tmp = x + z
      	elif y <= 2.8e-7:
      		tmp = y + (x + (z * (1.0 + (-0.5 * (y * y)))))
      	else:
      		tmp = x + z
      	return tmp
      
      function code(x, y, z)
      	tmp = 0.0
      	if (y <= -110000000.0)
      		tmp = Float64(x + z);
      	elseif (y <= 2.8e-7)
      		tmp = Float64(y + Float64(x + Float64(z * Float64(1.0 + Float64(-0.5 * Float64(y * y))))));
      	else
      		tmp = Float64(x + z);
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z)
      	tmp = 0.0;
      	if (y <= -110000000.0)
      		tmp = x + z;
      	elseif (y <= 2.8e-7)
      		tmp = y + (x + (z * (1.0 + (-0.5 * (y * y)))));
      	else
      		tmp = x + z;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_] := If[LessEqual[y, -110000000.0], N[(x + z), $MachinePrecision], If[LessEqual[y, 2.8e-7], N[(y + N[(x + N[(z * N[(1.0 + N[(-0.5 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + z), $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;y \leq -110000000:\\
      \;\;\;\;x + z\\
      
      \mathbf{elif}\;y \leq 2.8 \cdot 10^{-7}:\\
      \;\;\;\;y + \left(x + z \cdot \left(1 + -0.5 \cdot \left(y \cdot y\right)\right)\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;x + z\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if y < -1.1e8 or 2.80000000000000019e-7 < y

        1. Initial program 99.9%

          \[\left(x + \sin y\right) + z \cdot \cos y \]
        2. Add Preprocessing
        3. Taylor expanded in y around 0

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

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

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

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

        if -1.1e8 < y < 2.80000000000000019e-7

        1. Initial program 100.0%

          \[\left(x + \sin y\right) + z \cdot \cos y \]
        2. Add Preprocessing
        3. Taylor expanded in y around 0

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

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

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

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

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

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

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

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

            \[\leadsto x + \left(\left(y + z\right) + \color{blue}{\left(\frac{-1}{2} \cdot z\right)} \cdot {y}^{2}\right) \]
          9. associate-+r+N/A

            \[\leadsto x + \left(y + \color{blue}{\left(z + \left(\frac{-1}{2} \cdot z\right) \cdot {y}^{2}\right)}\right) \]
          10. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(y, x\right), \mathsf{*.f64}\left(z, \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{-1}{2} \cdot {y}^{2}\right)}\right)\right)\right) \]
        5. Simplified98.5%

          \[\leadsto \color{blue}{\left(y + x\right) + z \cdot \left(1 + -0.5 \cdot \left(y \cdot y\right)\right)} \]
        6. Step-by-step derivation
          1. associate-+l+N/A

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

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

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

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

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

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

            \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(x, \mathsf{*.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \left(y \cdot y\right)\right)\right)\right)\right), y\right) \]
          8. *-lowering-*.f6498.6%

            \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(x, \mathsf{*.f64}\left(z, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(y, y\right)\right)\right)\right)\right), y\right) \]
        7. Applied egg-rr98.6%

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

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

      Alternative 9: 69.6% accurate, 13.8× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -4.8 \cdot 10^{+51}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;y \leq 2.65 \cdot 10^{-11}:\\ \;\;\;\;x + \left(y + z\right)\\ \mathbf{else}:\\ \;\;\;\;x + z\\ \end{array} \end{array} \]
      (FPCore (x y z)
       :precision binary64
       (if (<= y -4.8e+51) (+ x z) (if (<= y 2.65e-11) (+ x (+ y z)) (+ x z))))
      double code(double x, double y, double z) {
      	double tmp;
      	if (y <= -4.8e+51) {
      		tmp = x + z;
      	} else if (y <= 2.65e-11) {
      		tmp = x + (y + z);
      	} else {
      		tmp = x + 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 <= (-4.8d+51)) then
              tmp = x + z
          else if (y <= 2.65d-11) then
              tmp = x + (y + z)
          else
              tmp = x + z
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z) {
      	double tmp;
      	if (y <= -4.8e+51) {
      		tmp = x + z;
      	} else if (y <= 2.65e-11) {
      		tmp = x + (y + z);
      	} else {
      		tmp = x + z;
      	}
      	return tmp;
      }
      
      def code(x, y, z):
      	tmp = 0
      	if y <= -4.8e+51:
      		tmp = x + z
      	elif y <= 2.65e-11:
      		tmp = x + (y + z)
      	else:
      		tmp = x + z
      	return tmp
      
      function code(x, y, z)
      	tmp = 0.0
      	if (y <= -4.8e+51)
      		tmp = Float64(x + z);
      	elseif (y <= 2.65e-11)
      		tmp = Float64(x + Float64(y + z));
      	else
      		tmp = Float64(x + z);
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z)
      	tmp = 0.0;
      	if (y <= -4.8e+51)
      		tmp = x + z;
      	elseif (y <= 2.65e-11)
      		tmp = x + (y + z);
      	else
      		tmp = x + z;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_] := If[LessEqual[y, -4.8e+51], N[(x + z), $MachinePrecision], If[LessEqual[y, 2.65e-11], N[(x + N[(y + z), $MachinePrecision]), $MachinePrecision], N[(x + z), $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;y \leq -4.8 \cdot 10^{+51}:\\
      \;\;\;\;x + z\\
      
      \mathbf{elif}\;y \leq 2.65 \cdot 10^{-11}:\\
      \;\;\;\;x + \left(y + z\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;x + z\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if y < -4.7999999999999997e51 or 2.6499999999999999e-11 < y

        1. Initial program 99.9%

          \[\left(x + \sin y\right) + z \cdot \cos y \]
        2. Add Preprocessing
        3. Taylor expanded in y around 0

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

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

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

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

        if -4.7999999999999997e51 < y < 2.6499999999999999e-11

        1. Initial program 100.0%

          \[\left(x + \sin y\right) + z \cdot \cos y \]
        2. Add Preprocessing
        3. Taylor expanded in y around 0

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

            \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(y + z\right)}\right) \]
          2. +-lowering-+.f6491.0%

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.8 \cdot 10^{+51}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;y \leq 2.65 \cdot 10^{-11}:\\ \;\;\;\;x + \left(y + z\right)\\ \mathbf{else}:\\ \;\;\;\;x + z\\ \end{array} \]
      5. Add Preprocessing

      Alternative 10: 55.2% accurate, 18.8× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -54000:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 350000000000:\\ \;\;\;\;z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
      (FPCore (x y z)
       :precision binary64
       (if (<= x -54000.0) x (if (<= x 350000000000.0) z x)))
      double code(double x, double y, double z) {
      	double tmp;
      	if (x <= -54000.0) {
      		tmp = x;
      	} else if (x <= 350000000000.0) {
      		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 (x <= (-54000.0d0)) then
              tmp = x
          else if (x <= 350000000000.0d0) 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 (x <= -54000.0) {
      		tmp = x;
      	} else if (x <= 350000000000.0) {
      		tmp = z;
      	} else {
      		tmp = x;
      	}
      	return tmp;
      }
      
      def code(x, y, z):
      	tmp = 0
      	if x <= -54000.0:
      		tmp = x
      	elif x <= 350000000000.0:
      		tmp = z
      	else:
      		tmp = x
      	return tmp
      
      function code(x, y, z)
      	tmp = 0.0
      	if (x <= -54000.0)
      		tmp = x;
      	elseif (x <= 350000000000.0)
      		tmp = z;
      	else
      		tmp = x;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z)
      	tmp = 0.0;
      	if (x <= -54000.0)
      		tmp = x;
      	elseif (x <= 350000000000.0)
      		tmp = z;
      	else
      		tmp = x;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_] := If[LessEqual[x, -54000.0], x, If[LessEqual[x, 350000000000.0], z, x]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;x \leq -54000:\\
      \;\;\;\;x\\
      
      \mathbf{elif}\;x \leq 350000000000:\\
      \;\;\;\;z\\
      
      \mathbf{else}:\\
      \;\;\;\;x\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if x < -54000 or 3.5e11 < x

        1. Initial program 100.0%

          \[\left(x + \sin y\right) + z \cdot \cos y \]
        2. Add Preprocessing
        3. Taylor expanded in x around inf

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

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

          if -54000 < x < 3.5e11

          1. Initial program 99.9%

            \[\left(x + \sin y\right) + z \cdot \cos y \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. flip-+N/A

              \[\leadsto \frac{\left(x + \sin y\right) \cdot \left(x + \sin y\right) - \left(z \cdot \cos y\right) \cdot \left(z \cdot \cos y\right)}{\color{blue}{\left(x + \sin y\right) - z \cdot \cos y}} \]
            2. clear-numN/A

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

              \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{\left(x + \sin y\right) - z \cdot \cos y}{\left(x + \sin y\right) \cdot \left(x + \sin y\right) - \left(z \cdot \cos y\right) \cdot \left(z \cdot \cos y\right)}\right)}\right) \]
            4. clear-numN/A

              \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{1}{\color{blue}{\frac{\left(x + \sin y\right) \cdot \left(x + \sin y\right) - \left(z \cdot \cos y\right) \cdot \left(z \cdot \cos y\right)}{\left(x + \sin y\right) - z \cdot \cos y}}}\right)\right) \]
            5. flip-+N/A

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

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

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(1, \left(\left(\sin y + x\right) + \color{blue}{z} \cdot \cos y\right)\right)\right) \]
            8. associate-+l+N/A

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

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

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

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

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{sin.f64}\left(y\right), \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(z, \color{blue}{\cos y}\right)\right)\right)\right)\right) \]
            13. cos-lowering-cos.f6499.6%

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(\mathsf{sin.f64}\left(y\right), \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(z, \mathsf{cos.f64}\left(y\right)\right)\right)\right)\right)\right) \]
          4. Applied egg-rr99.6%

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(x, z\right)\right), \mathsf{/.f64}\left(y, \color{blue}{\left({\left(x + z\right)}^{2}\right)}\right)\right)\right) \]
            8. unpow2N/A

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

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

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

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

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

            \[\leadsto \color{blue}{z} \]
          9. Step-by-step derivation
            1. Simplified38.7%

              \[\leadsto \color{blue}{z} \]
          10. Recombined 2 regimes into one program.
          11. Add Preprocessing

          Alternative 11: 44.3% accurate, 18.8× speedup?

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

            1. Initial program 100.0%

              \[\left(x + \sin y\right) + z \cdot \cos y \]
            2. Add Preprocessing
            3. Taylor expanded in x around inf

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

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

              if -3.39999999999999989e-101 < x < 3.29999999999999995e-52

              1. Initial program 99.9%

                \[\left(x + \sin y\right) + z \cdot \cos y \]
              2. Add Preprocessing
              3. Taylor expanded in z around 0

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

                  \[\leadsto \sin y + \color{blue}{x} \]
                2. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(\sin y, \color{blue}{x}\right) \]
                3. sin-lowering-sin.f6438.3%

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{sin.f64}\left(y\right), x\right) \]
              5. Simplified38.3%

                \[\leadsto \color{blue}{\sin y + x} \]
              6. Taylor expanded in y around 0

                \[\leadsto \mathsf{+.f64}\left(\color{blue}{y}, x\right) \]
              7. Step-by-step derivation
                1. Simplified16.2%

                  \[\leadsto \color{blue}{y} + x \]
                2. Taylor expanded in y around inf

                  \[\leadsto \color{blue}{y} \]
                3. Step-by-step derivation
                  1. Simplified15.2%

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

                Alternative 12: 65.8% accurate, 69.0× speedup?

                \[\begin{array}{l} \\ x + z \end{array} \]
                (FPCore (x y z) :precision binary64 (+ x z))
                double code(double x, double y, double z) {
                	return x + 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 + z
                end function
                
                public static double code(double x, double y, double z) {
                	return x + z;
                }
                
                def code(x, y, z):
                	return x + z
                
                function code(x, y, z)
                	return Float64(x + z)
                end
                
                function tmp = code(x, y, z)
                	tmp = x + z;
                end
                
                code[x_, y_, z_] := N[(x + z), $MachinePrecision]
                
                \begin{array}{l}
                
                \\
                x + z
                \end{array}
                
                Derivation
                1. Initial program 99.9%

                  \[\left(x + \sin y\right) + z \cdot \cos y \]
                2. Add Preprocessing
                3. Taylor expanded in y around 0

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

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

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

                  \[\leadsto \color{blue}{z + x} \]
                6. Final simplification64.6%

                  \[\leadsto x + z \]
                7. Add Preprocessing

                Alternative 13: 42.4% accurate, 207.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 99.9%

                  \[\left(x + \sin y\right) + z \cdot \cos y \]
                2. Add Preprocessing
                3. Taylor expanded in x around inf

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

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

                  Reproduce

                  ?
                  herbie shell --seed 2024161 
                  (FPCore (x y z)
                    :name "Graphics.Rasterific.Svg.PathConverter:segmentToBezier from rasterific-svg-0.2.3.1, C"
                    :precision binary64
                    (+ (+ x (sin y)) (* z (cos y))))