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

Percentage Accurate: 99.9% → 99.9%
Time: 11.9s
Alternatives: 14
Speedup: 1.0×

Specification

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

\\
\left(x + \cos y\right) - z \cdot \sin 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 14 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 + \cos y\right) - z \cdot \sin y \end{array} \]
(FPCore (x y z) :precision binary64 (- (+ x (cos y)) (* z (sin y))))
double code(double x, double y, double z) {
	return (x + cos(y)) - (z * 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 = (x + cos(y)) - (z * sin(y))
end function
public static double code(double x, double y, double z) {
	return (x + Math.cos(y)) - (z * Math.sin(y));
}
def code(x, y, z):
	return (x + math.cos(y)) - (z * math.sin(y))
function code(x, y, z)
	return Float64(Float64(x + cos(y)) - Float64(z * sin(y)))
end
function tmp = code(x, y, z)
	tmp = (x + cos(y)) - (z * sin(y));
end
code[x_, y_, z_] := N[(N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision] - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 99.9% accurate, 1.0× speedup?

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

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

    \[\left(x + \cos y\right) - z \cdot \sin y \]
  2. Add Preprocessing
  3. Add Preprocessing

Alternative 2: 98.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := z \cdot \sin y\\ t_1 := x - t\_0\\ \mathbf{if}\;x \leq -0.98:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 0.84:\\ \;\;\;\;\cos y - t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* z (sin y))) (t_1 (- x t_0)))
   (if (<= x -0.98) t_1 (if (<= x 0.84) (- (cos y) t_0) t_1))))
double code(double x, double y, double z) {
	double t_0 = z * sin(y);
	double t_1 = x - t_0;
	double tmp;
	if (x <= -0.98) {
		tmp = t_1;
	} else if (x <= 0.84) {
		tmp = cos(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 * sin(y)
    t_1 = x - t_0
    if (x <= (-0.98d0)) then
        tmp = t_1
    else if (x <= 0.84d0) then
        tmp = cos(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.sin(y);
	double t_1 = x - t_0;
	double tmp;
	if (x <= -0.98) {
		tmp = t_1;
	} else if (x <= 0.84) {
		tmp = Math.cos(y) - t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = z * math.sin(y)
	t_1 = x - t_0
	tmp = 0
	if x <= -0.98:
		tmp = t_1
	elif x <= 0.84:
		tmp = math.cos(y) - t_0
	else:
		tmp = t_1
	return tmp
function code(x, y, z)
	t_0 = Float64(z * sin(y))
	t_1 = Float64(x - t_0)
	tmp = 0.0
	if (x <= -0.98)
		tmp = t_1;
	elseif (x <= 0.84)
		tmp = Float64(cos(y) - t_0);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = z * sin(y);
	t_1 = x - t_0;
	tmp = 0.0;
	if (x <= -0.98)
		tmp = t_1;
	elseif (x <= 0.84)
		tmp = cos(y) - t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x - t$95$0), $MachinePrecision]}, If[LessEqual[x, -0.98], t$95$1, If[LessEqual[x, 0.84], N[(N[Cos[y], $MachinePrecision] - t$95$0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := z \cdot \sin y\\
t_1 := x - t\_0\\
\mathbf{if}\;x \leq -0.98:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 0.84:\\
\;\;\;\;\cos y - t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -0.97999999999999998 or 0.839999999999999969 < x

    1. Initial program 99.9%

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

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

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

      if -0.97999999999999998 < x < 0.839999999999999969

      1. Initial program 99.8%

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

        \[\leadsto \mathsf{\_.f64}\left(\color{blue}{\cos y}, \mathsf{*.f64}\left(z, \mathsf{sin.f64}\left(y\right)\right)\right) \]
      4. Step-by-step derivation
        1. cos-lowering-cos.f6499.0%

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{cos.f64}\left(y\right), \mathsf{*.f64}\left(\color{blue}{z}, \mathsf{sin.f64}\left(y\right)\right)\right) \]
      5. Simplified99.0%

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

    Alternative 3: 93.1% accurate, 1.8× speedup?

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

      1. Initial program 99.8%

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

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

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

        if -4.5000000000000003e25 < z < 2.05000000000000006e36

        1. Initial program 100.0%

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

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

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

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

            \[\leadsto \mathsf{+.f64}\left(\mathsf{cos.f64}\left(y\right), x\right) \]
        5. Simplified98.6%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{+25}:\\ \;\;\;\;x - z \cdot \sin y\\ \mathbf{elif}\;z \leq 2.05 \cdot 10^{+36}:\\ \;\;\;\;x + \cos y\\ \mathbf{else}:\\ \;\;\;\;x - z \cdot \sin y\\ \end{array} \]
      7. Add Preprocessing

      Alternative 4: 82.2% accurate, 1.8× speedup?

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

        1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(-1, \mathsf{*.f64}\left(z, \color{blue}{\sin y}\right)\right)\right) \]
          3. sin-lowering-sin.f6466.0%

            \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(-1, \mathsf{*.f64}\left(z, \mathsf{sin.f64}\left(y\right)\right)\right)\right) \]
        7. Simplified66.0%

          \[\leadsto \frac{1}{\color{blue}{\frac{-1}{z \cdot \sin y}}} \]
        8. Step-by-step derivation
          1. associate-/r/N/A

            \[\leadsto \frac{1}{-1} \cdot \color{blue}{\left(z \cdot \sin y\right)} \]
          2. metadata-evalN/A

            \[\leadsto -1 \cdot \left(\color{blue}{z} \cdot \sin y\right) \]
          3. neg-mul-1N/A

            \[\leadsto \mathsf{neg}\left(z \cdot \sin y\right) \]
          4. *-commutativeN/A

            \[\leadsto \mathsf{neg}\left(\sin y \cdot z\right) \]
          5. distribute-lft-neg-inN/A

            \[\leadsto \left(\mathsf{neg}\left(\sin y\right)\right) \cdot \color{blue}{z} \]
          6. *-lowering-*.f64N/A

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{neg.f64}\left(\sin y\right), z\right) \]
          8. sin-lowering-sin.f6466.1%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{neg.f64}\left(\mathsf{sin.f64}\left(y\right)\right), z\right) \]
        9. Applied egg-rr66.1%

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

        if -1.3e132 < z < 1.5e52

        1. Initial program 99.9%

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

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

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

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

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.3 \cdot 10^{+132}:\\ \;\;\;\;z \cdot \left(0 - \sin y\right)\\ \mathbf{elif}\;z \leq 1.5 \cdot 10^{+52}:\\ \;\;\;\;x + \cos y\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(0 - \sin y\right)\\ \end{array} \]
      5. Add Preprocessing

      Alternative 5: 81.5% accurate, 1.8× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := x + \cos y\\ \mathbf{if}\;y \leq -80000:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq 0.75:\\ \;\;\;\;1 + \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(z, y \cdot 0.16666666666666666, -0.5\right), 0\right) - z, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
      (FPCore (x y z)
       :precision binary64
       (let* ((t_0 (+ x (cos y))))
         (if (<= y -80000.0)
           t_0
           (if (<= y 0.75)
             (+
              1.0
              (fma y (- (fma y (fma z (* y 0.16666666666666666) -0.5) 0.0) z) x))
             t_0))))
      double code(double x, double y, double z) {
      	double t_0 = x + cos(y);
      	double tmp;
      	if (y <= -80000.0) {
      		tmp = t_0;
      	} else if (y <= 0.75) {
      		tmp = 1.0 + fma(y, (fma(y, fma(z, (y * 0.16666666666666666), -0.5), 0.0) - z), x);
      	} else {
      		tmp = t_0;
      	}
      	return tmp;
      }
      
      function code(x, y, z)
      	t_0 = Float64(x + cos(y))
      	tmp = 0.0
      	if (y <= -80000.0)
      		tmp = t_0;
      	elseif (y <= 0.75)
      		tmp = Float64(1.0 + fma(y, Float64(fma(y, fma(z, Float64(y * 0.16666666666666666), -0.5), 0.0) - z), x));
      	else
      		tmp = t_0;
      	end
      	return tmp
      end
      
      code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -80000.0], t$95$0, If[LessEqual[y, 0.75], N[(1.0 + N[(y * N[(N[(y * N[(z * N[(y * 0.16666666666666666), $MachinePrecision] + -0.5), $MachinePrecision] + 0.0), $MachinePrecision] - z), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], t$95$0]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := x + \cos y\\
      \mathbf{if}\;y \leq -80000:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;y \leq 0.75:\\
      \;\;\;\;1 + \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(z, y \cdot 0.16666666666666666, -0.5\right), 0\right) - z, x\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if y < -8e4 or 0.75 < y

        1. Initial program 99.8%

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

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

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

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

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

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

        if -8e4 < y < 0.75

        1. Initial program 100.0%

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

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

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

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

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

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

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

            \[\leadsto \mathsf{+.f64}\left(1, \mathsf{fma.f64}\left(y, \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(y, \left(\frac{1}{6} \cdot \left(y \cdot z\right) - \frac{1}{2}\right), 0\right), z\right), x\right)\right) \]
          7. sub-negN/A

            \[\leadsto \mathsf{+.f64}\left(1, \mathsf{fma.f64}\left(y, \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(y, \left(\frac{1}{6} \cdot \left(y \cdot z\right) + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)\right), 0\right), z\right), x\right)\right) \]
          8. associate-*r*N/A

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

            \[\leadsto \mathsf{+.f64}\left(1, \mathsf{fma.f64}\left(y, \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(y, \left(z \cdot \left(\frac{1}{6} \cdot y\right) + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)\right), 0\right), z\right), x\right)\right) \]
          10. metadata-evalN/A

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

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

            \[\leadsto \mathsf{+.f64}\left(1, \mathsf{fma.f64}\left(y, \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(y, \mathsf{fma.f64}\left(z, \left(y \cdot \frac{1}{6}\right), \frac{-1}{2}\right), 0\right), z\right), x\right)\right) \]
          13. *-lowering-*.f6499.3%

            \[\leadsto \mathsf{+.f64}\left(1, \mathsf{fma.f64}\left(y, \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(y, \mathsf{fma.f64}\left(z, \mathsf{*.f64}\left(y, \frac{1}{6}\right), \frac{-1}{2}\right), 0\right), z\right), x\right)\right) \]
        5. Simplified99.3%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -80000:\\ \;\;\;\;x + \cos y\\ \mathbf{elif}\;y \leq 0.75:\\ \;\;\;\;1 + \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(z, y \cdot 0.16666666666666666, -0.5\right), 0\right) - z, x\right)\\ \mathbf{else}:\\ \;\;\;\;x + \cos y\\ \end{array} \]
      5. Add Preprocessing

      Alternative 6: 72.4% accurate, 1.9× speedup?

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

        1. Initial program 99.9%

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

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

            \[\leadsto x + \color{blue}{1} \]
          2. +-lowering-+.f6481.9%

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

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

        if -9.49999999999999951e-11 < x < 5.4000000000000004e-22

        1. Initial program 99.8%

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

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

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

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

            \[\leadsto \mathsf{+.f64}\left(\mathsf{cos.f64}\left(y\right), x\right) \]
        5. Simplified60.7%

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

          \[\leadsto \color{blue}{\cos y} \]
        7. Step-by-step derivation
          1. cos-lowering-cos.f6460.7%

            \[\leadsto \mathsf{cos.f64}\left(y\right) \]
        8. Simplified60.7%

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

      Alternative 7: 70.3% accurate, 5.0× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -85000000:\\ \;\;\;\;x + 1\\ \mathbf{elif}\;y \leq 98000:\\ \;\;\;\;1 + \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(z, y \cdot 0.16666666666666666, -0.5\right), 0\right) - z, x\right)\\ \mathbf{else}:\\ \;\;\;\;x + 1\\ \end{array} \end{array} \]
      (FPCore (x y z)
       :precision binary64
       (if (<= y -85000000.0)
         (+ x 1.0)
         (if (<= y 98000.0)
           (+ 1.0 (fma y (- (fma y (fma z (* y 0.16666666666666666) -0.5) 0.0) z) x))
           (+ x 1.0))))
      double code(double x, double y, double z) {
      	double tmp;
      	if (y <= -85000000.0) {
      		tmp = x + 1.0;
      	} else if (y <= 98000.0) {
      		tmp = 1.0 + fma(y, (fma(y, fma(z, (y * 0.16666666666666666), -0.5), 0.0) - z), x);
      	} else {
      		tmp = x + 1.0;
      	}
      	return tmp;
      }
      
      function code(x, y, z)
      	tmp = 0.0
      	if (y <= -85000000.0)
      		tmp = Float64(x + 1.0);
      	elseif (y <= 98000.0)
      		tmp = Float64(1.0 + fma(y, Float64(fma(y, fma(z, Float64(y * 0.16666666666666666), -0.5), 0.0) - z), x));
      	else
      		tmp = Float64(x + 1.0);
      	end
      	return tmp
      end
      
      code[x_, y_, z_] := If[LessEqual[y, -85000000.0], N[(x + 1.0), $MachinePrecision], If[LessEqual[y, 98000.0], N[(1.0 + N[(y * N[(N[(y * N[(z * N[(y * 0.16666666666666666), $MachinePrecision] + -0.5), $MachinePrecision] + 0.0), $MachinePrecision] - z), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(x + 1.0), $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;y \leq -85000000:\\
      \;\;\;\;x + 1\\
      
      \mathbf{elif}\;y \leq 98000:\\
      \;\;\;\;1 + \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(z, y \cdot 0.16666666666666666, -0.5\right), 0\right) - z, x\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;x + 1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if y < -8.5e7 or 98000 < y

        1. Initial program 99.8%

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

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

            \[\leadsto x + \color{blue}{1} \]
          2. +-lowering-+.f6440.0%

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

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

        if -8.5e7 < y < 98000

        1. Initial program 100.0%

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

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

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

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

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

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

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

            \[\leadsto \mathsf{+.f64}\left(1, \mathsf{fma.f64}\left(y, \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(y, \left(\frac{1}{6} \cdot \left(y \cdot z\right) - \frac{1}{2}\right), 0\right), z\right), x\right)\right) \]
          7. sub-negN/A

            \[\leadsto \mathsf{+.f64}\left(1, \mathsf{fma.f64}\left(y, \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(y, \left(\frac{1}{6} \cdot \left(y \cdot z\right) + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)\right), 0\right), z\right), x\right)\right) \]
          8. associate-*r*N/A

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

            \[\leadsto \mathsf{+.f64}\left(1, \mathsf{fma.f64}\left(y, \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(y, \left(z \cdot \left(\frac{1}{6} \cdot y\right) + \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)\right), 0\right), z\right), x\right)\right) \]
          10. metadata-evalN/A

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

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

            \[\leadsto \mathsf{+.f64}\left(1, \mathsf{fma.f64}\left(y, \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(y, \mathsf{fma.f64}\left(z, \left(y \cdot \frac{1}{6}\right), \frac{-1}{2}\right), 0\right), z\right), x\right)\right) \]
          13. *-lowering-*.f6499.3%

            \[\leadsto \mathsf{+.f64}\left(1, \mathsf{fma.f64}\left(y, \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(y, \mathsf{fma.f64}\left(z, \mathsf{*.f64}\left(y, \frac{1}{6}\right), \frac{-1}{2}\right), 0\right), z\right), x\right)\right) \]
        5. Simplified99.3%

          \[\leadsto \color{blue}{1 + \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(z, y \cdot 0.16666666666666666, -0.5\right), 0\right) - z, x\right)} \]
      3. Recombined 2 regimes into one program.
      4. Add Preprocessing

      Alternative 8: 70.2% accurate, 6.8× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -60000:\\ \;\;\;\;x + 1\\ \mathbf{elif}\;y \leq 30000:\\ \;\;\;\;\mathsf{fma}\left(y, \mathsf{fma}\left(y, -0.5, 0\right) - z, x + 1\right)\\ \mathbf{else}:\\ \;\;\;\;x + 1\\ \end{array} \end{array} \]
      (FPCore (x y z)
       :precision binary64
       (if (<= y -60000.0)
         (+ x 1.0)
         (if (<= y 30000.0) (fma y (- (fma y -0.5 0.0) z) (+ x 1.0)) (+ x 1.0))))
      double code(double x, double y, double z) {
      	double tmp;
      	if (y <= -60000.0) {
      		tmp = x + 1.0;
      	} else if (y <= 30000.0) {
      		tmp = fma(y, (fma(y, -0.5, 0.0) - z), (x + 1.0));
      	} else {
      		tmp = x + 1.0;
      	}
      	return tmp;
      }
      
      function code(x, y, z)
      	tmp = 0.0
      	if (y <= -60000.0)
      		tmp = Float64(x + 1.0);
      	elseif (y <= 30000.0)
      		tmp = fma(y, Float64(fma(y, -0.5, 0.0) - z), Float64(x + 1.0));
      	else
      		tmp = Float64(x + 1.0);
      	end
      	return tmp
      end
      
      code[x_, y_, z_] := If[LessEqual[y, -60000.0], N[(x + 1.0), $MachinePrecision], If[LessEqual[y, 30000.0], N[(y * N[(N[(y * -0.5 + 0.0), $MachinePrecision] - z), $MachinePrecision] + N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(x + 1.0), $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;y \leq -60000:\\
      \;\;\;\;x + 1\\
      
      \mathbf{elif}\;y \leq 30000:\\
      \;\;\;\;\mathsf{fma}\left(y, \mathsf{fma}\left(y, -0.5, 0\right) - z, x + 1\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;x + 1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if y < -6e4 or 3e4 < y

        1. Initial program 99.8%

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

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

            \[\leadsto x + \color{blue}{1} \]
          2. +-lowering-+.f6439.7%

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

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

        if -6e4 < y < 3e4

        1. Initial program 100.0%

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma.f64}\left(y, \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(y, \frac{-1}{2}, 0\right), z\right), \left(1 + x\right)\right) \]
          8. +-commutativeN/A

            \[\leadsto \mathsf{fma.f64}\left(y, \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(y, \frac{-1}{2}, 0\right), z\right), \left(x + 1\right)\right) \]
          9. +-lowering-+.f6499.8%

            \[\leadsto \mathsf{fma.f64}\left(y, \mathsf{\_.f64}\left(\mathsf{fma.f64}\left(y, \frac{-1}{2}, 0\right), z\right), \mathsf{+.f64}\left(x, 1\right)\right) \]
        5. Simplified99.8%

          \[\leadsto \color{blue}{\mathsf{fma}\left(y, \mathsf{fma}\left(y, -0.5, 0\right) - z, x + 1\right)} \]
      3. Recombined 2 regimes into one program.
      4. Add Preprocessing

      Alternative 9: 70.0% accurate, 9.6× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.65 \cdot 10^{+34}:\\ \;\;\;\;x + 1\\ \mathbf{elif}\;y \leq 1.7 \cdot 10^{+19}:\\ \;\;\;\;x - \mathsf{fma}\left(y, z, -1\right)\\ \mathbf{else}:\\ \;\;\;\;x + 1\\ \end{array} \end{array} \]
      (FPCore (x y z)
       :precision binary64
       (if (<= y -1.65e+34)
         (+ x 1.0)
         (if (<= y 1.7e+19) (- x (fma y z -1.0)) (+ x 1.0))))
      double code(double x, double y, double z) {
      	double tmp;
      	if (y <= -1.65e+34) {
      		tmp = x + 1.0;
      	} else if (y <= 1.7e+19) {
      		tmp = x - fma(y, z, -1.0);
      	} else {
      		tmp = x + 1.0;
      	}
      	return tmp;
      }
      
      function code(x, y, z)
      	tmp = 0.0
      	if (y <= -1.65e+34)
      		tmp = Float64(x + 1.0);
      	elseif (y <= 1.7e+19)
      		tmp = Float64(x - fma(y, z, -1.0));
      	else
      		tmp = Float64(x + 1.0);
      	end
      	return tmp
      end
      
      code[x_, y_, z_] := If[LessEqual[y, -1.65e+34], N[(x + 1.0), $MachinePrecision], If[LessEqual[y, 1.7e+19], N[(x - N[(y * z + -1.0), $MachinePrecision]), $MachinePrecision], N[(x + 1.0), $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;y \leq -1.65 \cdot 10^{+34}:\\
      \;\;\;\;x + 1\\
      
      \mathbf{elif}\;y \leq 1.7 \cdot 10^{+19}:\\
      \;\;\;\;x - \mathsf{fma}\left(y, z, -1\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;x + 1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if y < -1.64999999999999994e34 or 1.7e19 < y

        1. Initial program 99.8%

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

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

            \[\leadsto x + \color{blue}{1} \]
          2. +-lowering-+.f6442.2%

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

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

        if -1.64999999999999994e34 < y < 1.7e19

        1. Initial program 99.9%

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

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

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

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

            \[\leadsto \left(x - y \cdot z\right) + 1 \]
          4. associate-+l-N/A

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

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

            \[\leadsto \mathsf{\_.f64}\left(x, \left(y \cdot z + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right) \]
          7. metadata-evalN/A

            \[\leadsto \mathsf{\_.f64}\left(x, \left(y \cdot z + -1\right)\right) \]
          8. accelerator-lowering-fma.f6491.5%

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

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

      Alternative 10: 64.6% accurate, 10.1× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := x - y \cdot z\\ \mathbf{if}\;z \leq -6.1 \cdot 10^{+206}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 1.95 \cdot 10^{+276}:\\ \;\;\;\;x + 1\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
      (FPCore (x y z)
       :precision binary64
       (let* ((t_0 (- x (* y z))))
         (if (<= z -6.1e+206) t_0 (if (<= z 1.95e+276) (+ x 1.0) t_0))))
      double code(double x, double y, double z) {
      	double t_0 = x - (y * z);
      	double tmp;
      	if (z <= -6.1e+206) {
      		tmp = t_0;
      	} else if (z <= 1.95e+276) {
      		tmp = x + 1.0;
      	} else {
      		tmp = t_0;
      	}
      	return tmp;
      }
      
      real(8) function code(x, y, z)
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8) :: t_0
          real(8) :: tmp
          t_0 = x - (y * z)
          if (z <= (-6.1d+206)) then
              tmp = t_0
          else if (z <= 1.95d+276) then
              tmp = x + 1.0d0
          else
              tmp = t_0
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z) {
      	double t_0 = x - (y * z);
      	double tmp;
      	if (z <= -6.1e+206) {
      		tmp = t_0;
      	} else if (z <= 1.95e+276) {
      		tmp = x + 1.0;
      	} else {
      		tmp = t_0;
      	}
      	return tmp;
      }
      
      def code(x, y, z):
      	t_0 = x - (y * z)
      	tmp = 0
      	if z <= -6.1e+206:
      		tmp = t_0
      	elif z <= 1.95e+276:
      		tmp = x + 1.0
      	else:
      		tmp = t_0
      	return tmp
      
      function code(x, y, z)
      	t_0 = Float64(x - Float64(y * z))
      	tmp = 0.0
      	if (z <= -6.1e+206)
      		tmp = t_0;
      	elseif (z <= 1.95e+276)
      		tmp = Float64(x + 1.0);
      	else
      		tmp = t_0;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z)
      	t_0 = x - (y * z);
      	tmp = 0.0;
      	if (z <= -6.1e+206)
      		tmp = t_0;
      	elseif (z <= 1.95e+276)
      		tmp = x + 1.0;
      	else
      		tmp = t_0;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_] := Block[{t$95$0 = N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.1e+206], t$95$0, If[LessEqual[z, 1.95e+276], N[(x + 1.0), $MachinePrecision], t$95$0]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := x - y \cdot z\\
      \mathbf{if}\;z \leq -6.1 \cdot 10^{+206}:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;z \leq 1.95 \cdot 10^{+276}:\\
      \;\;\;\;x + 1\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < -6.09999999999999967e206 or 1.9500000000000001e276 < z

        1. Initial program 99.9%

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

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

            \[\leadsto \color{blue}{x} - z \cdot \sin y \]
          2. Taylor expanded in y around 0

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

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

            if -6.09999999999999967e206 < z < 1.9500000000000001e276

            1. Initial program 99.9%

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

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

                \[\leadsto x + \color{blue}{1} \]
              2. +-lowering-+.f6466.0%

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

              \[\leadsto \color{blue}{x + 1} \]
          4. Recombined 2 regimes into one program.
          5. Final simplification65.8%

            \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.1 \cdot 10^{+206}:\\ \;\;\;\;x - y \cdot z\\ \mathbf{elif}\;z \leq 1.95 \cdot 10^{+276}:\\ \;\;\;\;x + 1\\ \mathbf{else}:\\ \;\;\;\;x - y \cdot z\\ \end{array} \]
          6. Add Preprocessing

          Alternative 11: 62.5% accurate, 14.1× speedup?

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

            1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(-1, \mathsf{*.f64}\left(z, \mathsf{sin.f64}\left(y\right)\right)\right)\right) \]
            7. Simplified82.9%

              \[\leadsto \frac{1}{\color{blue}{\frac{-1}{z \cdot \sin y}}} \]
            8. Step-by-step derivation
              1. associate-/r/N/A

                \[\leadsto \frac{1}{-1} \cdot \color{blue}{\left(z \cdot \sin y\right)} \]
              2. metadata-evalN/A

                \[\leadsto -1 \cdot \left(\color{blue}{z} \cdot \sin y\right) \]
              3. neg-mul-1N/A

                \[\leadsto \mathsf{neg}\left(z \cdot \sin y\right) \]
              4. *-commutativeN/A

                \[\leadsto \mathsf{neg}\left(\sin y \cdot z\right) \]
              5. distribute-lft-neg-inN/A

                \[\leadsto \left(\mathsf{neg}\left(\sin y\right)\right) \cdot \color{blue}{z} \]
              6. *-lowering-*.f64N/A

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{neg.f64}\left(\sin y\right), z\right) \]
              8. sin-lowering-sin.f6483.0%

                \[\leadsto \mathsf{*.f64}\left(\mathsf{neg.f64}\left(\mathsf{sin.f64}\left(y\right)\right), z\right) \]
            9. Applied egg-rr83.0%

              \[\leadsto \color{blue}{\left(-\sin y\right) \cdot z} \]
            10. Taylor expanded in y around 0

              \[\leadsto \mathsf{*.f64}\left(\mathsf{neg.f64}\left(\color{blue}{y}\right), z\right) \]
            11. Step-by-step derivation
              1. Simplified48.1%

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

              if -7.20000000000000005e208 < z

              1. Initial program 99.9%

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

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

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

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

                \[\leadsto \color{blue}{x + 1} \]
            12. Recombined 2 regimes into one program.
            13. Final simplification63.1%

              \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.2 \cdot 10^{+208}:\\ \;\;\;\;0 - y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x + 1\\ \end{array} \]
            14. Add Preprocessing

            Alternative 12: 60.8% accurate, 16.3× speedup?

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

              1. Initial program 99.9%

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

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

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

                if -7.0000000000000003e-17 < x < 1

                1. Initial program 99.9%

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

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

                    \[\leadsto x + \color{blue}{1} \]
                  2. +-lowering-+.f6440.2%

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

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

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

                    \[\leadsto \color{blue}{1} \]
                8. Recombined 2 regimes into one program.
                9. Add Preprocessing

                Alternative 13: 61.8% accurate, 53.0× speedup?

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

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

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

                    \[\leadsto x + \color{blue}{1} \]
                  2. +-lowering-+.f6460.9%

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

                  \[\leadsto \color{blue}{x + 1} \]
                6. Add Preprocessing

                Alternative 14: 21.5% accurate, 212.0× speedup?

                \[\begin{array}{l} \\ 1 \end{array} \]
                (FPCore (x y z) :precision binary64 1.0)
                double code(double x, double y, double z) {
                	return 1.0;
                }
                
                real(8) function code(x, y, z)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    real(8), intent (in) :: z
                    code = 1.0d0
                end function
                
                public static double code(double x, double y, double z) {
                	return 1.0;
                }
                
                def code(x, y, z):
                	return 1.0
                
                function code(x, y, z)
                	return 1.0
                end
                
                function tmp = code(x, y, z)
                	tmp = 1.0;
                end
                
                code[x_, y_, z_] := 1.0
                
                \begin{array}{l}
                
                \\
                1
                \end{array}
                
                Derivation
                1. Initial program 99.9%

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

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

                    \[\leadsto x + \color{blue}{1} \]
                  2. +-lowering-+.f6460.9%

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

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

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

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

                  Reproduce

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