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

Percentage Accurate: 99.9% → 99.9%
Time: 11.6s
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: 74.2% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(x + \cos y\right) - z \cdot \sin y\\ \mathbf{if}\;t\_0 \leq -50:\\ \;\;\;\;1 + \mathsf{fma}\left(y, -z, x\right)\\ \mathbf{elif}\;t\_0 \leq 0.995:\\ \;\;\;\;\cos y\\ \mathbf{else}:\\ \;\;\;\;x - \mathsf{fma}\left(y, z, -1\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (- (+ x (cos y)) (* z (sin y)))))
   (if (<= t_0 -50.0)
     (+ 1.0 (fma y (- z) x))
     (if (<= t_0 0.995) (cos y) (- x (fma y z -1.0))))))
double code(double x, double y, double z) {
	double t_0 = (x + cos(y)) - (z * sin(y));
	double tmp;
	if (t_0 <= -50.0) {
		tmp = 1.0 + fma(y, -z, x);
	} else if (t_0 <= 0.995) {
		tmp = cos(y);
	} else {
		tmp = x - fma(y, z, -1.0);
	}
	return tmp;
}
function code(x, y, z)
	t_0 = Float64(Float64(x + cos(y)) - Float64(z * sin(y)))
	tmp = 0.0
	if (t_0 <= -50.0)
		tmp = Float64(1.0 + fma(y, Float64(-z), x));
	elseif (t_0 <= 0.995)
		tmp = cos(y);
	else
		tmp = Float64(x - fma(y, z, -1.0));
	end
	return tmp
end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision] - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -50.0], N[(1.0 + N[(y * (-z) + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.995], N[Cos[y], $MachinePrecision], N[(x - N[(y * z + -1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(x + \cos y\right) - z \cdot \sin y\\
\mathbf{if}\;t\_0 \leq -50:\\
\;\;\;\;1 + \mathsf{fma}\left(y, -z, x\right)\\

\mathbf{elif}\;t\_0 \leq 0.995:\\
\;\;\;\;\cos y\\

\mathbf{else}:\\
\;\;\;\;x - \mathsf{fma}\left(y, z, -1\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (-.f64 (+.f64 x (cos.f64 y)) (*.f64 z (sin.f64 y))) < -50

    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 + 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. lower-+.f64N/A

        \[\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)} \]
      2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 1 + \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, \color{blue}{z \cdot \frac{1}{6}}, \frac{-1}{2}\right), \mathsf{neg}\left(z\right)\right), x\right) \]
      14. lower-neg.f6455.3

        \[\leadsto 1 + \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, z \cdot 0.16666666666666666, -0.5\right), \color{blue}{-z}\right), x\right) \]
    5. Applied rewrites55.3%

      \[\leadsto \color{blue}{1 + \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, z \cdot 0.16666666666666666, -0.5\right), -z\right), x\right)} \]
    6. Taylor expanded in y around 0

      \[\leadsto 1 + \mathsf{fma}\left(y, -1 \cdot \color{blue}{z}, x\right) \]
    7. Step-by-step derivation
      1. Applied rewrites62.2%

        \[\leadsto 1 + \mathsf{fma}\left(y, -z, x\right) \]

      if -50 < (-.f64 (+.f64 x (cos.f64 y)) (*.f64 z (sin.f64 y))) < 0.994999999999999996

      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 \left(x + \color{blue}{1}\right) - z \cdot \sin y \]
      4. Step-by-step derivation
        1. Applied rewrites11.3%

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

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

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

            \[\leadsto \color{blue}{\frac{\left(x + 1\right) \cdot \left(x + 1\right) - \left(z \cdot \sin y\right) \cdot \left(z \cdot \sin y\right)}{\left(x + 1\right) + z \cdot \sin y}} \]
        3. Applied rewrites11.3%

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

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

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

            \[\leadsto \color{blue}{\cos y + x} \]
          3. lower-cos.f6495.5

            \[\leadsto \color{blue}{\cos y} + x \]
        6. Applied rewrites95.5%

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

          \[\leadsto \cos y \]
        8. Step-by-step derivation
          1. Applied rewrites90.3%

            \[\leadsto \cos y \]

          if 0.994999999999999996 < (-.f64 (+.f64 x (cos.f64 y)) (*.f64 z (sin.f64 y)))

          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 \color{blue}{\left(x + -1 \cdot \left(y \cdot z\right)\right) + 1} \]
            2. mul-1-negN/A

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

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

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

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

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

              \[\leadsto x - \left(y \cdot z + \color{blue}{-1}\right) \]
            8. lower-fma.f6474.7

              \[\leadsto x - \color{blue}{\mathsf{fma}\left(y, z, -1\right)} \]
          5. Applied rewrites74.7%

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

        Alternative 3: 99.3% accurate, 1.7× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(x + 1\right) - z \cdot \sin y\\ \mathbf{if}\;z \leq -50000000:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 0.9:\\ \;\;\;\;x + \cos y\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
        (FPCore (x y z)
         :precision binary64
         (let* ((t_0 (- (+ x 1.0) (* z (sin y)))))
           (if (<= z -50000000.0) t_0 (if (<= z 0.9) (+ x (cos y)) t_0))))
        double code(double x, double y, double z) {
        	double t_0 = (x + 1.0) - (z * sin(y));
        	double tmp;
        	if (z <= -50000000.0) {
        		tmp = t_0;
        	} else if (z <= 0.9) {
        		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 + 1.0d0) - (z * sin(y))
            if (z <= (-50000000.0d0)) then
                tmp = t_0
            else if (z <= 0.9d0) 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 + 1.0) - (z * Math.sin(y));
        	double tmp;
        	if (z <= -50000000.0) {
        		tmp = t_0;
        	} else if (z <= 0.9) {
        		tmp = x + Math.cos(y);
        	} else {
        		tmp = t_0;
        	}
        	return tmp;
        }
        
        def code(x, y, z):
        	t_0 = (x + 1.0) - (z * math.sin(y))
        	tmp = 0
        	if z <= -50000000.0:
        		tmp = t_0
        	elif z <= 0.9:
        		tmp = x + math.cos(y)
        	else:
        		tmp = t_0
        	return tmp
        
        function code(x, y, z)
        	t_0 = Float64(Float64(x + 1.0) - Float64(z * sin(y)))
        	tmp = 0.0
        	if (z <= -50000000.0)
        		tmp = t_0;
        	elseif (z <= 0.9)
        		tmp = Float64(x + cos(y));
        	else
        		tmp = t_0;
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y, z)
        	t_0 = (x + 1.0) - (z * sin(y));
        	tmp = 0.0;
        	if (z <= -50000000.0)
        		tmp = t_0;
        	elseif (z <= 0.9)
        		tmp = x + cos(y);
        	else
        		tmp = t_0;
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_, z_] := Block[{t$95$0 = N[(N[(x + 1.0), $MachinePrecision] - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -50000000.0], t$95$0, If[LessEqual[z, 0.9], N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision], t$95$0]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := \left(x + 1\right) - z \cdot \sin y\\
        \mathbf{if}\;z \leq -50000000:\\
        \;\;\;\;t\_0\\
        
        \mathbf{elif}\;z \leq 0.9:\\
        \;\;\;\;x + \cos y\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_0\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if z < -5e7 or 0.900000000000000022 < z

          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 \left(x + \color{blue}{1}\right) - z \cdot \sin y \]
          4. Step-by-step derivation
            1. Applied rewrites99.6%

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

            if -5e7 < z < 0.900000000000000022

            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 \color{blue}{\cos y + x} \]
              2. lower-+.f64N/A

                \[\leadsto \color{blue}{\cos y + x} \]
              3. lower-cos.f6498.8

                \[\leadsto \color{blue}{\cos y} + x \]
            5. Applied rewrites98.8%

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

            \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -50000000:\\ \;\;\;\;\left(x + 1\right) - z \cdot \sin y\\ \mathbf{elif}\;z \leq 0.9:\\ \;\;\;\;x + \cos y\\ \mathbf{else}:\\ \;\;\;\;\left(x + 1\right) - z \cdot \sin y\\ \end{array} \]
          7. Add Preprocessing

          Alternative 4: 82.0% accurate, 1.8× speedup?

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

            1. Initial program 99.8%

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

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

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

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

                \[\leadsto \mathsf{neg}\left(\color{blue}{z \cdot \sin y}\right) \]
              4. lower-sin.f6469.2

                \[\leadsto -z \cdot \color{blue}{\sin y} \]
            5. Applied rewrites69.2%

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

            if -8.9999999999999994e106 < z < 2.3000000000000001e119

            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 \color{blue}{\cos y + x} \]
              2. lower-+.f64N/A

                \[\leadsto \color{blue}{\cos y + x} \]
              3. lower-cos.f6492.1

                \[\leadsto \color{blue}{\cos y} + x \]
            5. Applied rewrites92.1%

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

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

          Alternative 5: 81.0% accurate, 1.8× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := x + \cos y\\ \mathbf{if}\;y \leq -0.0135:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq 2100000:\\ \;\;\;\;\left(x + 1\right) - y \cdot \mathsf{fma}\left(y, y \cdot \left(z \cdot \mathsf{fma}\left(y, y \cdot 0.008333333333333333, -0.16666666666666666\right)\right), z\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
          (FPCore (x y z)
           :precision binary64
           (let* ((t_0 (+ x (cos y))))
             (if (<= y -0.0135)
               t_0
               (if (<= y 2100000.0)
                 (-
                  (+ x 1.0)
                  (*
                   y
                   (fma
                    y
                    (* y (* z (fma y (* y 0.008333333333333333) -0.16666666666666666)))
                    z)))
                 t_0))))
          double code(double x, double y, double z) {
          	double t_0 = x + cos(y);
          	double tmp;
          	if (y <= -0.0135) {
          		tmp = t_0;
          	} else if (y <= 2100000.0) {
          		tmp = (x + 1.0) - (y * fma(y, (y * (z * fma(y, (y * 0.008333333333333333), -0.16666666666666666))), z));
          	} else {
          		tmp = t_0;
          	}
          	return tmp;
          }
          
          function code(x, y, z)
          	t_0 = Float64(x + cos(y))
          	tmp = 0.0
          	if (y <= -0.0135)
          		tmp = t_0;
          	elseif (y <= 2100000.0)
          		tmp = Float64(Float64(x + 1.0) - Float64(y * fma(y, Float64(y * Float64(z * fma(y, Float64(y * 0.008333333333333333), -0.16666666666666666))), z)));
          	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, -0.0135], t$95$0, If[LessEqual[y, 2100000.0], N[(N[(x + 1.0), $MachinePrecision] - N[(y * N[(y * N[(y * N[(z * N[(y * N[(y * 0.008333333333333333), $MachinePrecision] + -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := x + \cos y\\
          \mathbf{if}\;y \leq -0.0135:\\
          \;\;\;\;t\_0\\
          
          \mathbf{elif}\;y \leq 2100000:\\
          \;\;\;\;\left(x + 1\right) - y \cdot \mathsf{fma}\left(y, y \cdot \left(z \cdot \mathsf{fma}\left(y, y \cdot 0.008333333333333333, -0.16666666666666666\right)\right), z\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_0\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if y < -0.0134999999999999998 or 2.1e6 < y

            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 \color{blue}{\cos y + x} \]
              2. lower-+.f64N/A

                \[\leadsto \color{blue}{\cos y + x} \]
              3. lower-cos.f6463.3

                \[\leadsto \color{blue}{\cos y} + x \]
            5. Applied rewrites63.3%

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

            if -0.0134999999999999998 < y < 2.1e6

            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 \left(x + \color{blue}{1}\right) - z \cdot \sin y \]
            4. Step-by-step derivation
              1. Applied rewrites100.0%

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

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

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

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

                  \[\leadsto \left(x + 1\right) - y \cdot \left(\color{blue}{\left(y \cdot y\right)} \cdot \left(\frac{-1}{6} \cdot z + \frac{1}{120} \cdot \left({y}^{2} \cdot z\right)\right) + z\right) \]
                4. associate-*l*N/A

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

                  \[\leadsto \left(x + 1\right) - y \cdot \color{blue}{\mathsf{fma}\left(y, y \cdot \left(\frac{-1}{6} \cdot z + \frac{1}{120} \cdot \left({y}^{2} \cdot z\right)\right), z\right)} \]
              4. Applied rewrites98.2%

                \[\leadsto \left(x + 1\right) - \color{blue}{y \cdot \mathsf{fma}\left(y, y \cdot \left(z \cdot \mathsf{fma}\left(y, y \cdot 0.008333333333333333, -0.16666666666666666\right)\right), z\right)} \]
            5. Recombined 2 regimes into one program.
            6. Final simplification80.7%

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

            Alternative 6: 69.3% accurate, 4.2× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -0.014:\\ \;\;\;\;x \cdot \left(1 + \frac{1}{x}\right)\\ \mathbf{elif}\;y \leq 18500000000000:\\ \;\;\;\;\left(x + 1\right) - y \cdot \mathsf{fma}\left(y, y \cdot \left(z \cdot \mathsf{fma}\left(y, y \cdot 0.008333333333333333, -0.16666666666666666\right)\right), z\right)\\ \mathbf{else}:\\ \;\;\;\;x + 1\\ \end{array} \end{array} \]
            (FPCore (x y z)
             :precision binary64
             (if (<= y -0.014)
               (* x (+ 1.0 (/ 1.0 x)))
               (if (<= y 18500000000000.0)
                 (-
                  (+ x 1.0)
                  (*
                   y
                   (fma
                    y
                    (* y (* z (fma y (* y 0.008333333333333333) -0.16666666666666666)))
                    z)))
                 (+ x 1.0))))
            double code(double x, double y, double z) {
            	double tmp;
            	if (y <= -0.014) {
            		tmp = x * (1.0 + (1.0 / x));
            	} else if (y <= 18500000000000.0) {
            		tmp = (x + 1.0) - (y * fma(y, (y * (z * fma(y, (y * 0.008333333333333333), -0.16666666666666666))), z));
            	} else {
            		tmp = x + 1.0;
            	}
            	return tmp;
            }
            
            function code(x, y, z)
            	tmp = 0.0
            	if (y <= -0.014)
            		tmp = Float64(x * Float64(1.0 + Float64(1.0 / x)));
            	elseif (y <= 18500000000000.0)
            		tmp = Float64(Float64(x + 1.0) - Float64(y * fma(y, Float64(y * Float64(z * fma(y, Float64(y * 0.008333333333333333), -0.16666666666666666))), z)));
            	else
            		tmp = Float64(x + 1.0);
            	end
            	return tmp
            end
            
            code[x_, y_, z_] := If[LessEqual[y, -0.014], N[(x * N[(1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 18500000000000.0], N[(N[(x + 1.0), $MachinePrecision] - N[(y * N[(y * N[(y * N[(z * N[(y * N[(y * 0.008333333333333333), $MachinePrecision] + -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + 1.0), $MachinePrecision]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;y \leq -0.014:\\
            \;\;\;\;x \cdot \left(1 + \frac{1}{x}\right)\\
            
            \mathbf{elif}\;y \leq 18500000000000:\\
            \;\;\;\;\left(x + 1\right) - y \cdot \mathsf{fma}\left(y, y \cdot \left(z \cdot \mathsf{fma}\left(y, y \cdot 0.008333333333333333, -0.16666666666666666\right)\right), z\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;x + 1\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if y < -0.0140000000000000003

              1. Initial program 99.9%

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

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

                  \[\leadsto \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}} \]
                3. clear-numN/A

                  \[\leadsto \color{blue}{\frac{1}{\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)}}} \]
                4. lower-/.f64N/A

                  \[\leadsto \color{blue}{\frac{1}{\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)}}} \]
                5. clear-numN/A

                  \[\leadsto \frac{1}{\color{blue}{\frac{1}{\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}}}} \]
                6. flip--N/A

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

                  \[\leadsto \frac{1}{\frac{1}{\color{blue}{\left(x + \cos y\right) - z \cdot \sin y}}} \]
                8. lower-/.f6499.7

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

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

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

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

                  \[\leadsto \frac{1}{\frac{1}{\color{blue}{x + \left(\cos y - z \cdot \sin y\right)}}} \]
                13. lower--.f6499.7

                  \[\leadsto \frac{1}{\frac{1}{x + \color{blue}{\left(\cos y - z \cdot \sin y\right)}}} \]
              4. Applied rewrites99.7%

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto x \cdot \left(1 + \frac{\color{blue}{\mathsf{fma}\left(z, -1 \cdot \sin y, \cos y\right)}}{x}\right) \]
                11. mul-1-negN/A

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

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

                  \[\leadsto x \cdot \left(1 + \frac{\mathsf{fma}\left(z, \mathsf{neg}\left(\color{blue}{\sin y}\right), \cos y\right)}{x}\right) \]
                14. lower-cos.f6492.8

                  \[\leadsto x \cdot \left(1 + \frac{\mathsf{fma}\left(z, -\sin y, \color{blue}{\cos y}\right)}{x}\right) \]
              7. Applied rewrites92.8%

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

                \[\leadsto x \cdot \left(1 + \frac{1}{x}\right) \]
              9. Step-by-step derivation
                1. Applied rewrites49.5%

                  \[\leadsto x \cdot \left(1 + \frac{1}{x}\right) \]

                if -0.0140000000000000003 < y < 1.85e13

                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 \left(x + \color{blue}{1}\right) - z \cdot \sin y \]
                4. Step-by-step derivation
                  1. Applied rewrites99.3%

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

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

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

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

                      \[\leadsto \left(x + 1\right) - y \cdot \left(\color{blue}{\left(y \cdot y\right)} \cdot \left(\frac{-1}{6} \cdot z + \frac{1}{120} \cdot \left({y}^{2} \cdot z\right)\right) + z\right) \]
                    4. associate-*l*N/A

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

                      \[\leadsto \left(x + 1\right) - y \cdot \color{blue}{\mathsf{fma}\left(y, y \cdot \left(\frac{-1}{6} \cdot z + \frac{1}{120} \cdot \left({y}^{2} \cdot z\right)\right), z\right)} \]
                  4. Applied rewrites97.6%

                    \[\leadsto \left(x + 1\right) - \color{blue}{y \cdot \mathsf{fma}\left(y, y \cdot \left(z \cdot \mathsf{fma}\left(y, y \cdot 0.008333333333333333, -0.16666666666666666\right)\right), z\right)} \]

                  if 1.85e13 < 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 \color{blue}{x + 1} \]
                    2. lower-+.f6430.1

                      \[\leadsto \color{blue}{x + 1} \]
                  5. Applied rewrites30.1%

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

                Alternative 7: 69.4% accurate, 4.6× speedup?

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

                  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 \color{blue}{x + 1} \]
                    2. lower-+.f6449.7

                      \[\leadsto \color{blue}{x + 1} \]
                  5. Applied rewrites49.7%

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

                  if -64 < y < 25

                  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. lower-+.f64N/A

                      \[\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)} \]
                    2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto 1 + \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, \color{blue}{z \cdot \frac{1}{6}}, \frac{-1}{2}\right), \mathsf{neg}\left(z\right)\right), x\right) \]
                    14. lower-neg.f6499.0

                      \[\leadsto 1 + \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, z \cdot 0.16666666666666666, -0.5\right), \color{blue}{-z}\right), x\right) \]
                  5. Applied rewrites99.0%

                    \[\leadsto \color{blue}{1 + \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, z \cdot 0.16666666666666666, -0.5\right), -z\right), x\right)} \]
                  6. Step-by-step derivation
                    1. Applied rewrites99.0%

                      \[\leadsto 1 + \mathsf{fma}\left(\mathsf{fma}\left(y, z \cdot 0.16666666666666666, -0.5\right), \color{blue}{y \cdot y}, \mathsf{fma}\left(y, -z, x\right)\right) \]

                    if 25 < y

                    1. Initial program 99.8%

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

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

                        \[\leadsto \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}} \]
                      3. clear-numN/A

                        \[\leadsto \color{blue}{\frac{1}{\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)}}} \]
                      4. lower-/.f64N/A

                        \[\leadsto \color{blue}{\frac{1}{\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)}}} \]
                      5. clear-numN/A

                        \[\leadsto \frac{1}{\color{blue}{\frac{1}{\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}}}} \]
                      6. flip--N/A

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

                        \[\leadsto \frac{1}{\frac{1}{\color{blue}{\left(x + \cos y\right) - z \cdot \sin y}}} \]
                      8. lower-/.f6499.6

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

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

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

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

                        \[\leadsto \frac{1}{\frac{1}{\color{blue}{x + \left(\cos y - z \cdot \sin y\right)}}} \]
                      13. lower--.f6499.6

                        \[\leadsto \frac{1}{\frac{1}{x + \color{blue}{\left(\cos y - z \cdot \sin y\right)}}} \]
                    4. Applied rewrites99.6%

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto x \cdot \left(1 + \frac{\color{blue}{\mathsf{fma}\left(z, -1 \cdot \sin y, \cos y\right)}}{x}\right) \]
                      11. mul-1-negN/A

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

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

                        \[\leadsto x \cdot \left(1 + \frac{\mathsf{fma}\left(z, \mathsf{neg}\left(\color{blue}{\sin y}\right), \cos y\right)}{x}\right) \]
                      14. lower-cos.f6487.9

                        \[\leadsto x \cdot \left(1 + \frac{\mathsf{fma}\left(z, -\sin y, \color{blue}{\cos y}\right)}{x}\right) \]
                    7. Applied rewrites87.9%

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

                      \[\leadsto x \cdot \left(1 + \frac{1}{x}\right) \]
                    9. Step-by-step derivation
                      1. Applied rewrites29.0%

                        \[\leadsto x \cdot \left(1 + \frac{1}{x}\right) \]
                    10. Recombined 3 regimes into one program.
                    11. Add Preprocessing

                    Alternative 8: 69.4% accurate, 5.2× speedup?

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

                      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 \color{blue}{x + 1} \]
                        2. lower-+.f6449.7

                          \[\leadsto \color{blue}{x + 1} \]
                      5. Applied rewrites49.7%

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

                      if -64 < y < 25

                      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. lower-+.f64N/A

                          \[\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)} \]
                        2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto 1 + \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, \color{blue}{z \cdot \frac{1}{6}}, \frac{-1}{2}\right), \mathsf{neg}\left(z\right)\right), x\right) \]
                        14. lower-neg.f6499.0

                          \[\leadsto 1 + \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, z \cdot 0.16666666666666666, -0.5\right), \color{blue}{-z}\right), x\right) \]
                      5. Applied rewrites99.0%

                        \[\leadsto \color{blue}{1 + \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, z \cdot 0.16666666666666666, -0.5\right), -z\right), x\right)} \]

                      if 25 < y

                      1. Initial program 99.8%

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

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

                          \[\leadsto \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}} \]
                        3. clear-numN/A

                          \[\leadsto \color{blue}{\frac{1}{\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)}}} \]
                        4. lower-/.f64N/A

                          \[\leadsto \color{blue}{\frac{1}{\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)}}} \]
                        5. clear-numN/A

                          \[\leadsto \frac{1}{\color{blue}{\frac{1}{\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}}}} \]
                        6. flip--N/A

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

                          \[\leadsto \frac{1}{\frac{1}{\color{blue}{\left(x + \cos y\right) - z \cdot \sin y}}} \]
                        8. lower-/.f6499.6

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

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

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

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

                          \[\leadsto \frac{1}{\frac{1}{\color{blue}{x + \left(\cos y - z \cdot \sin y\right)}}} \]
                        13. lower--.f6499.6

                          \[\leadsto \frac{1}{\frac{1}{x + \color{blue}{\left(\cos y - z \cdot \sin y\right)}}} \]
                      4. Applied rewrites99.6%

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto x \cdot \left(1 + \frac{\color{blue}{\mathsf{fma}\left(z, -1 \cdot \sin y, \cos y\right)}}{x}\right) \]
                        11. mul-1-negN/A

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

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

                          \[\leadsto x \cdot \left(1 + \frac{\mathsf{fma}\left(z, \mathsf{neg}\left(\color{blue}{\sin y}\right), \cos y\right)}{x}\right) \]
                        14. lower-cos.f6487.9

                          \[\leadsto x \cdot \left(1 + \frac{\mathsf{fma}\left(z, -\sin y, \color{blue}{\cos y}\right)}{x}\right) \]
                      7. Applied rewrites87.9%

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

                        \[\leadsto x \cdot \left(1 + \frac{1}{x}\right) \]
                      9. Step-by-step derivation
                        1. Applied rewrites29.0%

                          \[\leadsto x \cdot \left(1 + \frac{1}{x}\right) \]
                      10. Recombined 3 regimes into one program.
                      11. Add Preprocessing

                      Alternative 9: 69.2% accurate, 6.6× speedup?

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

                        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 \color{blue}{x + 1} \]
                          2. lower-+.f6449.7

                            \[\leadsto \color{blue}{x + 1} \]
                        5. Applied rewrites49.7%

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

                        if -62 < y < 8.2e9

                        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 \color{blue}{\left(1 + x\right) + y \cdot \left(\frac{-1}{2} \cdot y - z\right)} \]
                          2. +-commutativeN/A

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

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

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

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

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

                            \[\leadsto \mathsf{fma}\left(y, y \cdot \frac{-1}{2} - z, \color{blue}{x + 1}\right) \]
                          8. lower-+.f6497.0

                            \[\leadsto \mathsf{fma}\left(y, y \cdot -0.5 - z, \color{blue}{x + 1}\right) \]
                        5. Applied rewrites97.0%

                          \[\leadsto \color{blue}{\mathsf{fma}\left(y, y \cdot -0.5 - z, x + 1\right)} \]

                        if 8.2e9 < y

                        1. Initial program 99.8%

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

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

                            \[\leadsto \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}} \]
                          3. clear-numN/A

                            \[\leadsto \color{blue}{\frac{1}{\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)}}} \]
                          4. lower-/.f64N/A

                            \[\leadsto \color{blue}{\frac{1}{\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)}}} \]
                          5. clear-numN/A

                            \[\leadsto \frac{1}{\color{blue}{\frac{1}{\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}}}} \]
                          6. flip--N/A

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

                            \[\leadsto \frac{1}{\frac{1}{\color{blue}{\left(x + \cos y\right) - z \cdot \sin y}}} \]
                          8. lower-/.f6499.6

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

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

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

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

                            \[\leadsto \frac{1}{\frac{1}{\color{blue}{x + \left(\cos y - z \cdot \sin y\right)}}} \]
                          13. lower--.f6499.6

                            \[\leadsto \frac{1}{\frac{1}{x + \color{blue}{\left(\cos y - z \cdot \sin y\right)}}} \]
                        4. Applied rewrites99.6%

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto x \cdot \left(1 + \frac{\color{blue}{\mathsf{fma}\left(z, -1 \cdot \sin y, \cos y\right)}}{x}\right) \]
                          11. mul-1-negN/A

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

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

                            \[\leadsto x \cdot \left(1 + \frac{\mathsf{fma}\left(z, \mathsf{neg}\left(\color{blue}{\sin y}\right), \cos y\right)}{x}\right) \]
                          14. lower-cos.f6487.5

                            \[\leadsto x \cdot \left(1 + \frac{\mathsf{fma}\left(z, -\sin y, \color{blue}{\cos y}\right)}{x}\right) \]
                        7. Applied rewrites87.5%

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

                          \[\leadsto x \cdot \left(1 + \frac{1}{x}\right) \]
                        9. Step-by-step derivation
                          1. Applied rewrites29.9%

                            \[\leadsto x \cdot \left(1 + \frac{1}{x}\right) \]
                        10. Recombined 3 regimes into one program.
                        11. Add Preprocessing

                        Alternative 10: 69.2% accurate, 7.1× speedup?

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

                          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 \color{blue}{x + 1} \]
                            2. lower-+.f6440.2

                              \[\leadsto \color{blue}{x + 1} \]
                          5. Applied rewrites40.2%

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

                          if -62 < y < 8.2e9

                          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 \color{blue}{\left(1 + x\right) + y \cdot \left(\frac{-1}{2} \cdot y - z\right)} \]
                            2. +-commutativeN/A

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

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

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

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

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

                              \[\leadsto \mathsf{fma}\left(y, y \cdot \frac{-1}{2} - z, \color{blue}{x + 1}\right) \]
                            8. lower-+.f6497.0

                              \[\leadsto \mathsf{fma}\left(y, y \cdot -0.5 - z, \color{blue}{x + 1}\right) \]
                          5. Applied rewrites97.0%

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

                        Alternative 11: 69.2% accurate, 8.8× speedup?

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

                          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 \color{blue}{x + 1} \]
                            2. lower-+.f6440.3

                              \[\leadsto \color{blue}{x + 1} \]
                          5. Applied rewrites40.3%

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

                          if -3.2000000000000002 < y < 3.4e13

                          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. lower-+.f64N/A

                              \[\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)} \]
                            2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto 1 + \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, \color{blue}{z \cdot \frac{1}{6}}, \frac{-1}{2}\right), \mathsf{neg}\left(z\right)\right), x\right) \]
                            14. lower-neg.f6496.7

                              \[\leadsto 1 + \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, z \cdot 0.16666666666666666, -0.5\right), \color{blue}{-z}\right), x\right) \]
                          5. Applied rewrites96.7%

                            \[\leadsto \color{blue}{1 + \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, z \cdot 0.16666666666666666, -0.5\right), -z\right), x\right)} \]
                          6. Taylor expanded in y around 0

                            \[\leadsto 1 + \mathsf{fma}\left(y, -1 \cdot \color{blue}{z}, x\right) \]
                          7. Step-by-step derivation
                            1. Applied rewrites96.2%

                              \[\leadsto 1 + \mathsf{fma}\left(y, -z, x\right) \]
                          8. Recombined 2 regimes into one program.
                          9. Add Preprocessing

                          Alternative 12: 69.2% accurate, 9.6× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -3.2:\\ \;\;\;\;x + 1\\ \mathbf{elif}\;y \leq 34000000000000:\\ \;\;\;\;x - \mathsf{fma}\left(y, z, -1\right)\\ \mathbf{else}:\\ \;\;\;\;x + 1\\ \end{array} \end{array} \]
                          (FPCore (x y z)
                           :precision binary64
                           (if (<= y -3.2)
                             (+ x 1.0)
                             (if (<= y 34000000000000.0) (- x (fma y z -1.0)) (+ x 1.0))))
                          double code(double x, double y, double z) {
                          	double tmp;
                          	if (y <= -3.2) {
                          		tmp = x + 1.0;
                          	} else if (y <= 34000000000000.0) {
                          		tmp = x - fma(y, z, -1.0);
                          	} else {
                          		tmp = x + 1.0;
                          	}
                          	return tmp;
                          }
                          
                          function code(x, y, z)
                          	tmp = 0.0
                          	if (y <= -3.2)
                          		tmp = Float64(x + 1.0);
                          	elseif (y <= 34000000000000.0)
                          		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, -3.2], N[(x + 1.0), $MachinePrecision], If[LessEqual[y, 34000000000000.0], N[(x - N[(y * z + -1.0), $MachinePrecision]), $MachinePrecision], N[(x + 1.0), $MachinePrecision]]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;y \leq -3.2:\\
                          \;\;\;\;x + 1\\
                          
                          \mathbf{elif}\;y \leq 34000000000000:\\
                          \;\;\;\;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 < -3.2000000000000002 or 3.4e13 < y

                            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 \color{blue}{x + 1} \]
                              2. lower-+.f6440.3

                                \[\leadsto \color{blue}{x + 1} \]
                            5. Applied rewrites40.3%

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

                            if -3.2000000000000002 < y < 3.4e13

                            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 + -1 \cdot \left(y \cdot z\right)\right)} \]
                            4. Step-by-step derivation
                              1. +-commutativeN/A

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

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

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

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

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

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

                                \[\leadsto x - \left(y \cdot z + \color{blue}{-1}\right) \]
                              8. lower-fma.f6496.2

                                \[\leadsto x - \color{blue}{\mathsf{fma}\left(y, z, -1\right)} \]
                            5. Applied rewrites96.2%

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

                          Alternative 13: 61.2% 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 \color{blue}{x + 1} \]
                            2. lower-+.f6457.8

                              \[\leadsto \color{blue}{x + 1} \]
                          5. Applied rewrites57.8%

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

                          Alternative 14: 21.2% 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 \color{blue}{x + 1} \]
                            2. lower-+.f6457.8

                              \[\leadsto \color{blue}{x + 1} \]
                          5. Applied rewrites57.8%

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

                            \[\leadsto 1 \]
                          7. Step-by-step derivation
                            1. Applied rewrites18.9%

                              \[\leadsto 1 \]
                            2. Add Preprocessing

                            Reproduce

                            ?
                            herbie shell --seed 2024220 
                            (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))))