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

Percentage Accurate: 99.9% → 99.9%
Time: 8.7s
Alternatives: 15
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 15 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(\cos y + x\right) - \sin y \cdot z \end{array} \]
(FPCore (x y z) :precision binary64 (- (+ (cos y) x) (* (sin y) z)))
double code(double x, double y, double z) {
	return (cos(y) + x) - (sin(y) * z);
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = (cos(y) + x) - (sin(y) * z)
end function
public static double code(double x, double y, double z) {
	return (Math.cos(y) + x) - (Math.sin(y) * z);
}
def code(x, y, z):
	return (math.cos(y) + x) - (math.sin(y) * z)
function code(x, y, z)
	return Float64(Float64(cos(y) + x) - Float64(sin(y) * z))
end
function tmp = code(x, y, z)
	tmp = (cos(y) + x) - (sin(y) * z);
end
code[x_, y_, z_] := N[(N[(N[Cos[y], $MachinePrecision] + x), $MachinePrecision] - N[(N[Sin[y], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

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

Alternative 2: 98.9% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \cos y + x\\ t_1 := \sin y \cdot z\\ t_2 := t\_0 - t\_1\\ t_3 := \left(1 + x\right) - t\_1\\ \mathbf{if}\;t\_2 \leq -1000000:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t\_2 \leq 0.9999931210694952:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (+ (cos y) x))
        (t_1 (* (sin y) z))
        (t_2 (- t_0 t_1))
        (t_3 (- (+ 1.0 x) t_1)))
   (if (<= t_2 -1000000.0) t_3 (if (<= t_2 0.9999931210694952) t_0 t_3))))
double code(double x, double y, double z) {
	double t_0 = cos(y) + x;
	double t_1 = sin(y) * z;
	double t_2 = t_0 - t_1;
	double t_3 = (1.0 + x) - t_1;
	double tmp;
	if (t_2 <= -1000000.0) {
		tmp = t_3;
	} else if (t_2 <= 0.9999931210694952) {
		tmp = t_0;
	} else {
		tmp = t_3;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_0 = cos(y) + x
    t_1 = sin(y) * z
    t_2 = t_0 - t_1
    t_3 = (1.0d0 + x) - t_1
    if (t_2 <= (-1000000.0d0)) then
        tmp = t_3
    else if (t_2 <= 0.9999931210694952d0) then
        tmp = t_0
    else
        tmp = t_3
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = Math.cos(y) + x;
	double t_1 = Math.sin(y) * z;
	double t_2 = t_0 - t_1;
	double t_3 = (1.0 + x) - t_1;
	double tmp;
	if (t_2 <= -1000000.0) {
		tmp = t_3;
	} else if (t_2 <= 0.9999931210694952) {
		tmp = t_0;
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = math.cos(y) + x
	t_1 = math.sin(y) * z
	t_2 = t_0 - t_1
	t_3 = (1.0 + x) - t_1
	tmp = 0
	if t_2 <= -1000000.0:
		tmp = t_3
	elif t_2 <= 0.9999931210694952:
		tmp = t_0
	else:
		tmp = t_3
	return tmp
function code(x, y, z)
	t_0 = Float64(cos(y) + x)
	t_1 = Float64(sin(y) * z)
	t_2 = Float64(t_0 - t_1)
	t_3 = Float64(Float64(1.0 + x) - t_1)
	tmp = 0.0
	if (t_2 <= -1000000.0)
		tmp = t_3;
	elseif (t_2 <= 0.9999931210694952)
		tmp = t_0;
	else
		tmp = t_3;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = cos(y) + x;
	t_1 = sin(y) * z;
	t_2 = t_0 - t_1;
	t_3 = (1.0 + x) - t_1;
	tmp = 0.0;
	if (t_2 <= -1000000.0)
		tmp = t_3;
	elseif (t_2 <= 0.9999931210694952)
		tmp = t_0;
	else
		tmp = t_3;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Cos[y], $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sin[y], $MachinePrecision] * z), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 - t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(1.0 + x), $MachinePrecision] - t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, -1000000.0], t$95$3, If[LessEqual[t$95$2, 0.9999931210694952], t$95$0, t$95$3]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \cos y + x\\
t_1 := \sin y \cdot z\\
t_2 := t\_0 - t\_1\\
t_3 := \left(1 + x\right) - t\_1\\
\mathbf{if}\;t\_2 \leq -1000000:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;t\_2 \leq 0.9999931210694952:\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (+.f64 x (cos.f64 y)) (*.f64 z (sin.f64 y))) < -1e6 or 0.99999312106949523 < (-.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 \left(x + \color{blue}{1}\right) - z \cdot \sin y \]
    4. Step-by-step derivation
      1. Applied rewrites99.7%

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

      if -1e6 < (-.f64 (+.f64 x (cos.f64 y)) (*.f64 z (sin.f64 y))) < 0.99999312106949523

      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.f64100.0

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

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

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

    Alternative 3: 72.5% accurate, 0.4× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(\cos y + x\right) - \sin y \cdot z\\ \mathbf{if}\;t\_0 \leq -2 \cdot 10^{+23}:\\ \;\;\;\;\mathsf{fma}\left(-z, y, 1 + x\right)\\ \mathbf{elif}\;t\_0 \leq 0.9999931210694952:\\ \;\;\;\;\cos y\\ \mathbf{else}:\\ \;\;\;\;x - \mathsf{fma}\left(z, y, -1\right)\\ \end{array} \end{array} \]
    (FPCore (x y z)
     :precision binary64
     (let* ((t_0 (- (+ (cos y) x) (* (sin y) z))))
       (if (<= t_0 -2e+23)
         (fma (- z) y (+ 1.0 x))
         (if (<= t_0 0.9999931210694952) (cos y) (- x (fma z y -1.0))))))
    double code(double x, double y, double z) {
    	double t_0 = (cos(y) + x) - (sin(y) * z);
    	double tmp;
    	if (t_0 <= -2e+23) {
    		tmp = fma(-z, y, (1.0 + x));
    	} else if (t_0 <= 0.9999931210694952) {
    		tmp = cos(y);
    	} else {
    		tmp = x - fma(z, y, -1.0);
    	}
    	return tmp;
    }
    
    function code(x, y, z)
    	t_0 = Float64(Float64(cos(y) + x) - Float64(sin(y) * z))
    	tmp = 0.0
    	if (t_0 <= -2e+23)
    		tmp = fma(Float64(-z), y, Float64(1.0 + x));
    	elseif (t_0 <= 0.9999931210694952)
    		tmp = cos(y);
    	else
    		tmp = Float64(x - fma(z, y, -1.0));
    	end
    	return tmp
    end
    
    code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[Cos[y], $MachinePrecision] + x), $MachinePrecision] - N[(N[Sin[y], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e+23], N[((-z) * y + N[(1.0 + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.9999931210694952], N[Cos[y], $MachinePrecision], N[(x - N[(z * y + -1.0), $MachinePrecision]), $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \left(\cos y + x\right) - \sin y \cdot z\\
    \mathbf{if}\;t\_0 \leq -2 \cdot 10^{+23}:\\
    \;\;\;\;\mathsf{fma}\left(-z, y, 1 + x\right)\\
    
    \mathbf{elif}\;t\_0 \leq 0.9999931210694952:\\
    \;\;\;\;\cos y\\
    
    \mathbf{else}:\\
    \;\;\;\;x - \mathsf{fma}\left(z, y, -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))) < -1.9999999999999998e23

      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. inv-powN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -1.9999999999999998e23 < (-.f64 (+.f64 x (cos.f64 y)) (*.f64 z (sin.f64 y))) < 0.99999312106949523

      1. Initial program 100.0%

        \[\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. inv-powN/A

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

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

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

        \[\leadsto \color{blue}{x + \cos y} \]
      6. 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.0

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

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

        \[\leadsto \cos y \]
      9. Step-by-step derivation
        1. Applied rewrites88.5%

          \[\leadsto \cos y \]

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

        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. *-commutativeN/A

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

            \[\leadsto x - \left(z \cdot y + \color{blue}{-1}\right) \]
          9. lower-fma.f6478.6

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

          \[\leadsto \color{blue}{x - \mathsf{fma}\left(z, y, -1\right)} \]
      10. Recombined 3 regimes into one program.
      11. Final simplification75.4%

        \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\cos y + x\right) - \sin y \cdot z \leq -2 \cdot 10^{+23}:\\ \;\;\;\;\mathsf{fma}\left(-z, y, 1 + x\right)\\ \mathbf{elif}\;\left(\cos y + x\right) - \sin y \cdot z \leq 0.9999931210694952:\\ \;\;\;\;\cos y\\ \mathbf{else}:\\ \;\;\;\;x - \mathsf{fma}\left(z, y, -1\right)\\ \end{array} \]
      12. Add Preprocessing

      Alternative 4: 77.9% accurate, 1.7× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(-z\right) \cdot \sin y\\ \mathbf{if}\;z \leq -1.7 \cdot 10^{+141}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 265000000000:\\ \;\;\;\;\cos y + x\\ \mathbf{elif}\;z \leq 4 \cdot 10^{+160}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.5 \cdot y - z, y, 1 + x\right)\\ \end{array} \end{array} \]
      (FPCore (x y z)
       :precision binary64
       (let* ((t_0 (* (- z) (sin y))))
         (if (<= z -1.7e+141)
           t_0
           (if (<= z 265000000000.0)
             (+ (cos y) x)
             (if (<= z 4e+160) t_0 (fma (- (* -0.5 y) z) y (+ 1.0 x)))))))
      double code(double x, double y, double z) {
      	double t_0 = -z * sin(y);
      	double tmp;
      	if (z <= -1.7e+141) {
      		tmp = t_0;
      	} else if (z <= 265000000000.0) {
      		tmp = cos(y) + x;
      	} else if (z <= 4e+160) {
      		tmp = t_0;
      	} else {
      		tmp = fma(((-0.5 * y) - z), y, (1.0 + x));
      	}
      	return tmp;
      }
      
      function code(x, y, z)
      	t_0 = Float64(Float64(-z) * sin(y))
      	tmp = 0.0
      	if (z <= -1.7e+141)
      		tmp = t_0;
      	elseif (z <= 265000000000.0)
      		tmp = Float64(cos(y) + x);
      	elseif (z <= 4e+160)
      		tmp = t_0;
      	else
      		tmp = fma(Float64(Float64(-0.5 * y) - z), y, Float64(1.0 + x));
      	end
      	return tmp
      end
      
      code[x_, y_, z_] := Block[{t$95$0 = N[((-z) * N[Sin[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.7e+141], t$95$0, If[LessEqual[z, 265000000000.0], N[(N[Cos[y], $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 4e+160], t$95$0, N[(N[(N[(-0.5 * y), $MachinePrecision] - z), $MachinePrecision] * y + N[(1.0 + x), $MachinePrecision]), $MachinePrecision]]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := \left(-z\right) \cdot \sin y\\
      \mathbf{if}\;z \leq -1.7 \cdot 10^{+141}:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;z \leq 265000000000:\\
      \;\;\;\;\cos y + x\\
      
      \mathbf{elif}\;z \leq 4 \cdot 10^{+160}:\\
      \;\;\;\;t\_0\\
      
      \mathbf{else}:\\
      \;\;\;\;\mathsf{fma}\left(-0.5 \cdot y - z, y, 1 + x\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if z < -1.6999999999999999e141 or 2.65e11 < z < 4.00000000000000003e160

        1. Initial program 99.9%

          \[\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. distribute-lft-neg-inN/A

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

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

            \[\leadsto \color{blue}{\left(-z\right)} \cdot \sin y \]
          5. lower-sin.f6472.3

            \[\leadsto \left(-z\right) \cdot \color{blue}{\sin y} \]
        5. Applied rewrites72.3%

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

        if -1.6999999999999999e141 < z < 2.65e11

        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.f6495.7

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

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

        if 4.00000000000000003e160 < z

        1. Initial program 99.9%

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

          \[\leadsto \color{blue}{1 + \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. *-commutativeN/A

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

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

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

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

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

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

      Alternative 5: 84.1% accurate, 1.8× speedup?

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

        1. Initial program 99.9%

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

          \[\leadsto \color{blue}{\cos y} - z \cdot \sin y \]
        4. Step-by-step derivation
          1. lower-cos.f6475.8

            \[\leadsto \color{blue}{\cos y} - z \cdot \sin y \]
        5. Applied rewrites75.8%

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

          \[\leadsto 1 - z \cdot \sin y \]
        7. Step-by-step derivation
          1. Applied rewrites75.7%

            \[\leadsto 1 - z \cdot \sin y \]

          if -3.49999999999999989e140 < z < 2.65e11

          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.f6495.7

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

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.5 \cdot 10^{+140}:\\ \;\;\;\;1 - \sin y \cdot z\\ \mathbf{elif}\;z \leq 265000000000:\\ \;\;\;\;\cos y + x\\ \mathbf{else}:\\ \;\;\;\;1 - \sin y \cdot z\\ \end{array} \]
        10. Add Preprocessing

        Alternative 6: 80.8% accurate, 1.8× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \cos y + x\\ \mathbf{if}\;y \leq -10000000:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq 1.05:\\ \;\;\;\;\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.001388888888888889, y \cdot y, 0.041666666666666664\right), y \cdot y, -0.5\right), y \cdot y, 1\right) + x\right) - \mathsf{fma}\left(\mathsf{fma}\left(0.008333333333333333, y \cdot y, -0.16666666666666666\right) \cdot z, y \cdot y, z\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
        (FPCore (x y z)
         :precision binary64
         (let* ((t_0 (+ (cos y) x)))
           (if (<= y -10000000.0)
             t_0
             (if (<= y 1.05)
               (-
                (+
                 (fma
                  (fma
                   (fma -0.001388888888888889 (* y y) 0.041666666666666664)
                   (* y y)
                   -0.5)
                  (* y y)
                  1.0)
                 x)
                (*
                 (fma
                  (* (fma 0.008333333333333333 (* y y) -0.16666666666666666) z)
                  (* y y)
                  z)
                 y))
               t_0))))
        double code(double x, double y, double z) {
        	double t_0 = cos(y) + x;
        	double tmp;
        	if (y <= -10000000.0) {
        		tmp = t_0;
        	} else if (y <= 1.05) {
        		tmp = (fma(fma(fma(-0.001388888888888889, (y * y), 0.041666666666666664), (y * y), -0.5), (y * y), 1.0) + x) - (fma((fma(0.008333333333333333, (y * y), -0.16666666666666666) * z), (y * y), z) * y);
        	} else {
        		tmp = t_0;
        	}
        	return tmp;
        }
        
        function code(x, y, z)
        	t_0 = Float64(cos(y) + x)
        	tmp = 0.0
        	if (y <= -10000000.0)
        		tmp = t_0;
        	elseif (y <= 1.05)
        		tmp = Float64(Float64(fma(fma(fma(-0.001388888888888889, Float64(y * y), 0.041666666666666664), Float64(y * y), -0.5), Float64(y * y), 1.0) + x) - Float64(fma(Float64(fma(0.008333333333333333, Float64(y * y), -0.16666666666666666) * z), Float64(y * y), z) * y));
        	else
        		tmp = t_0;
        	end
        	return tmp
        end
        
        code[x_, y_, z_] := Block[{t$95$0 = N[(N[Cos[y], $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[y, -10000000.0], t$95$0, If[LessEqual[y, 1.05], N[(N[(N[(N[(N[(-0.001388888888888889 * N[(y * y), $MachinePrecision] + 0.041666666666666664), $MachinePrecision] * N[(y * y), $MachinePrecision] + -0.5), $MachinePrecision] * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision] + x), $MachinePrecision] - N[(N[(N[(N[(0.008333333333333333 * N[(y * y), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] * z), $MachinePrecision] * N[(y * y), $MachinePrecision] + z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], t$95$0]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := \cos y + x\\
        \mathbf{if}\;y \leq -10000000:\\
        \;\;\;\;t\_0\\
        
        \mathbf{elif}\;y \leq 1.05:\\
        \;\;\;\;\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.001388888888888889, y \cdot y, 0.041666666666666664\right), y \cdot y, -0.5\right), y \cdot y, 1\right) + x\right) - \mathsf{fma}\left(\mathsf{fma}\left(0.008333333333333333, y \cdot y, -0.16666666666666666\right) \cdot z, y \cdot y, z\right) \cdot y\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_0\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if y < -1e7 or 1.05000000000000004 < 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.f6462.8

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

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

          if -1e7 < y < 1.05000000000000004

          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.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \left(x + \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{720}, y \cdot y, \frac{1}{24}\right), y \cdot y, \frac{-1}{2}\right), \color{blue}{y \cdot y}, 1\right)\right) - \mathsf{fma}\left(z \cdot \mathsf{fma}\left(\frac{1}{120}, y \cdot y, \frac{-1}{6}\right), y \cdot y, z\right) \cdot y \]
              15. lower-*.f6498.6

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

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

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

          Alternative 7: 69.7% accurate, 2.5× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -10000000:\\ \;\;\;\;1 + x\\ \mathbf{elif}\;y \leq 1350000:\\ \;\;\;\;\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.001388888888888889, y \cdot y, 0.041666666666666664\right), y \cdot y, -0.5\right), y \cdot y, 1\right) + x\right) - \mathsf{fma}\left(\mathsf{fma}\left(0.008333333333333333, y \cdot y, -0.16666666666666666\right) \cdot z, y \cdot y, z\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;1 + x\\ \end{array} \end{array} \]
          (FPCore (x y z)
           :precision binary64
           (if (<= y -10000000.0)
             (+ 1.0 x)
             (if (<= y 1350000.0)
               (-
                (+
                 (fma
                  (fma
                   (fma -0.001388888888888889 (* y y) 0.041666666666666664)
                   (* y y)
                   -0.5)
                  (* y y)
                  1.0)
                 x)
                (*
                 (fma
                  (* (fma 0.008333333333333333 (* y y) -0.16666666666666666) z)
                  (* y y)
                  z)
                 y))
               (+ 1.0 x))))
          double code(double x, double y, double z) {
          	double tmp;
          	if (y <= -10000000.0) {
          		tmp = 1.0 + x;
          	} else if (y <= 1350000.0) {
          		tmp = (fma(fma(fma(-0.001388888888888889, (y * y), 0.041666666666666664), (y * y), -0.5), (y * y), 1.0) + x) - (fma((fma(0.008333333333333333, (y * y), -0.16666666666666666) * z), (y * y), z) * y);
          	} else {
          		tmp = 1.0 + x;
          	}
          	return tmp;
          }
          
          function code(x, y, z)
          	tmp = 0.0
          	if (y <= -10000000.0)
          		tmp = Float64(1.0 + x);
          	elseif (y <= 1350000.0)
          		tmp = Float64(Float64(fma(fma(fma(-0.001388888888888889, Float64(y * y), 0.041666666666666664), Float64(y * y), -0.5), Float64(y * y), 1.0) + x) - Float64(fma(Float64(fma(0.008333333333333333, Float64(y * y), -0.16666666666666666) * z), Float64(y * y), z) * y));
          	else
          		tmp = Float64(1.0 + x);
          	end
          	return tmp
          end
          
          code[x_, y_, z_] := If[LessEqual[y, -10000000.0], N[(1.0 + x), $MachinePrecision], If[LessEqual[y, 1350000.0], N[(N[(N[(N[(N[(-0.001388888888888889 * N[(y * y), $MachinePrecision] + 0.041666666666666664), $MachinePrecision] * N[(y * y), $MachinePrecision] + -0.5), $MachinePrecision] * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision] + x), $MachinePrecision] - N[(N[(N[(N[(0.008333333333333333 * N[(y * y), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] * z), $MachinePrecision] * N[(y * y), $MachinePrecision] + z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], N[(1.0 + x), $MachinePrecision]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;y \leq -10000000:\\
          \;\;\;\;1 + x\\
          
          \mathbf{elif}\;y \leq 1350000:\\
          \;\;\;\;\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.001388888888888889, y \cdot y, 0.041666666666666664\right), y \cdot y, -0.5\right), y \cdot y, 1\right) + x\right) - \mathsf{fma}\left(\mathsf{fma}\left(0.008333333333333333, y \cdot y, -0.16666666666666666\right) \cdot z, y \cdot y, z\right) \cdot y\\
          
          \mathbf{else}:\\
          \;\;\;\;1 + x\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if y < -1e7 or 1.35e6 < 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. lower-+.f6440.1

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

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

            if -1e7 < y < 1.35e6

            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 rewrites98.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(x + \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{-1}{720}, y \cdot y, \frac{1}{24}\right), y \cdot y, \frac{-1}{2}\right), \color{blue}{y \cdot y}, 1\right)\right) - \mathsf{fma}\left(z \cdot \mathsf{fma}\left(\frac{1}{120}, y \cdot y, \frac{-1}{6}\right), y \cdot y, z\right) \cdot y \]
                15. lower-*.f6496.5

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

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

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

            Alternative 8: 69.7% accurate, 2.9× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -10000000:\\ \;\;\;\;1 + x\\ \mathbf{elif}\;y \leq 3.2:\\ \;\;\;\;\left(\mathsf{fma}\left(\mathsf{fma}\left(0.041666666666666664, y \cdot y, -0.5\right), y \cdot y, 1\right) + x\right) - \mathsf{fma}\left(\mathsf{fma}\left(0.008333333333333333, y \cdot y, -0.16666666666666666\right) \cdot z, y \cdot y, z\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;1 + x\\ \end{array} \end{array} \]
            (FPCore (x y z)
             :precision binary64
             (if (<= y -10000000.0)
               (+ 1.0 x)
               (if (<= y 3.2)
                 (-
                  (+ (fma (fma 0.041666666666666664 (* y y) -0.5) (* y y) 1.0) x)
                  (*
                   (fma
                    (* (fma 0.008333333333333333 (* y y) -0.16666666666666666) z)
                    (* y y)
                    z)
                   y))
                 (+ 1.0 x))))
            double code(double x, double y, double z) {
            	double tmp;
            	if (y <= -10000000.0) {
            		tmp = 1.0 + x;
            	} else if (y <= 3.2) {
            		tmp = (fma(fma(0.041666666666666664, (y * y), -0.5), (y * y), 1.0) + x) - (fma((fma(0.008333333333333333, (y * y), -0.16666666666666666) * z), (y * y), z) * y);
            	} else {
            		tmp = 1.0 + x;
            	}
            	return tmp;
            }
            
            function code(x, y, z)
            	tmp = 0.0
            	if (y <= -10000000.0)
            		tmp = Float64(1.0 + x);
            	elseif (y <= 3.2)
            		tmp = Float64(Float64(fma(fma(0.041666666666666664, Float64(y * y), -0.5), Float64(y * y), 1.0) + x) - Float64(fma(Float64(fma(0.008333333333333333, Float64(y * y), -0.16666666666666666) * z), Float64(y * y), z) * y));
            	else
            		tmp = Float64(1.0 + x);
            	end
            	return tmp
            end
            
            code[x_, y_, z_] := If[LessEqual[y, -10000000.0], N[(1.0 + x), $MachinePrecision], If[LessEqual[y, 3.2], N[(N[(N[(N[(0.041666666666666664 * N[(y * y), $MachinePrecision] + -0.5), $MachinePrecision] * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision] + x), $MachinePrecision] - N[(N[(N[(N[(0.008333333333333333 * N[(y * y), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] * z), $MachinePrecision] * N[(y * y), $MachinePrecision] + z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], N[(1.0 + x), $MachinePrecision]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;y \leq -10000000:\\
            \;\;\;\;1 + x\\
            
            \mathbf{elif}\;y \leq 3.2:\\
            \;\;\;\;\left(\mathsf{fma}\left(\mathsf{fma}\left(0.041666666666666664, y \cdot y, -0.5\right), y \cdot y, 1\right) + x\right) - \mathsf{fma}\left(\mathsf{fma}\left(0.008333333333333333, y \cdot y, -0.16666666666666666\right) \cdot z, y \cdot y, z\right) \cdot y\\
            
            \mathbf{else}:\\
            \;\;\;\;1 + x\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if y < -1e7 or 3.2000000000000002 < 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. lower-+.f6439.1

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

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

              if -1e7 < y < 3.2000000000000002

              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.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \left(x + \mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{24}, y \cdot y, \frac{-1}{2}\right), \color{blue}{y \cdot y}, 1\right)\right) - \mathsf{fma}\left(z \cdot \mathsf{fma}\left(\frac{1}{120}, y \cdot y, \frac{-1}{6}\right), y \cdot y, z\right) \cdot y \]
                  10. lower-*.f6498.5

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

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

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

              Alternative 9: 64.9% accurate, 10.1× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_0 := x - z \cdot y\\ \mathbf{if}\;z \leq -2.55 \cdot 10^{+148}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 1.38 \cdot 10^{+166}:\\ \;\;\;\;1 + x\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
              (FPCore (x y z)
               :precision binary64
               (let* ((t_0 (- x (* z y))))
                 (if (<= z -2.55e+148) t_0 (if (<= z 1.38e+166) (+ 1.0 x) t_0))))
              double code(double x, double y, double z) {
              	double t_0 = x - (z * y);
              	double tmp;
              	if (z <= -2.55e+148) {
              		tmp = t_0;
              	} else if (z <= 1.38e+166) {
              		tmp = 1.0 + x;
              	} else {
              		tmp = t_0;
              	}
              	return tmp;
              }
              
              real(8) function code(x, y, z)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  real(8), intent (in) :: z
                  real(8) :: t_0
                  real(8) :: tmp
                  t_0 = x - (z * y)
                  if (z <= (-2.55d+148)) then
                      tmp = t_0
                  else if (z <= 1.38d+166) then
                      tmp = 1.0d0 + x
                  else
                      tmp = t_0
                  end if
                  code = tmp
              end function
              
              public static double code(double x, double y, double z) {
              	double t_0 = x - (z * y);
              	double tmp;
              	if (z <= -2.55e+148) {
              		tmp = t_0;
              	} else if (z <= 1.38e+166) {
              		tmp = 1.0 + x;
              	} else {
              		tmp = t_0;
              	}
              	return tmp;
              }
              
              def code(x, y, z):
              	t_0 = x - (z * y)
              	tmp = 0
              	if z <= -2.55e+148:
              		tmp = t_0
              	elif z <= 1.38e+166:
              		tmp = 1.0 + x
              	else:
              		tmp = t_0
              	return tmp
              
              function code(x, y, z)
              	t_0 = Float64(x - Float64(z * y))
              	tmp = 0.0
              	if (z <= -2.55e+148)
              		tmp = t_0;
              	elseif (z <= 1.38e+166)
              		tmp = Float64(1.0 + x);
              	else
              		tmp = t_0;
              	end
              	return tmp
              end
              
              function tmp_2 = code(x, y, z)
              	t_0 = x - (z * y);
              	tmp = 0.0;
              	if (z <= -2.55e+148)
              		tmp = t_0;
              	elseif (z <= 1.38e+166)
              		tmp = 1.0 + x;
              	else
              		tmp = t_0;
              	end
              	tmp_2 = tmp;
              end
              
              code[x_, y_, z_] := Block[{t$95$0 = N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.55e+148], t$95$0, If[LessEqual[z, 1.38e+166], N[(1.0 + x), $MachinePrecision], t$95$0]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_0 := x - z \cdot y\\
              \mathbf{if}\;z \leq -2.55 \cdot 10^{+148}:\\
              \;\;\;\;t\_0\\
              
              \mathbf{elif}\;z \leq 1.38 \cdot 10^{+166}:\\
              \;\;\;\;1 + x\\
              
              \mathbf{else}:\\
              \;\;\;\;t\_0\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if z < -2.54999999999999993e148 or 1.38000000000000001e166 < 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 \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. *-commutativeN/A

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

                    \[\leadsto x - \left(z \cdot y + \color{blue}{-1}\right) \]
                  9. lower-fma.f6464.5

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

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

                  \[\leadsto x - y \cdot \color{blue}{z} \]
                7. Step-by-step derivation
                  1. Applied rewrites60.4%

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

                  if -2.54999999999999993e148 < z < 1.38000000000000001e166

                  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 + x} \]
                  4. Step-by-step derivation
                    1. lower-+.f6469.3

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

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

                Alternative 10: 66.0% accurate, 10.1× speedup?

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

                  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 + x} \]
                  4. Step-by-step derivation
                    1. lower-+.f6481.9

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

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

                  if -1.18e23 < x < 9.1999999999999998e-7

                  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. *-commutativeN/A

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

                      \[\leadsto x - \left(z \cdot y + \color{blue}{-1}\right) \]
                    9. lower-fma.f6451.6

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

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

                    \[\leadsto 1 - \color{blue}{y \cdot z} \]
                  7. Step-by-step derivation
                    1. Applied rewrites51.1%

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

                  Alternative 11: 66.2% accurate, 11.8× speedup?

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

                    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. lower-+.f6444.2

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

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

                    if -4.6e9 < y

                    1. Initial program 100.0%

                      \[\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. inv-powN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                  Alternative 12: 66.2% accurate, 13.2× speedup?

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

                    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. lower-+.f6444.2

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

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

                    if -4.6e9 < y

                    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. *-commutativeN/A

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

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

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

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

                  Alternative 13: 62.5% accurate, 15.1× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq 2.3 \cdot 10^{+255}:\\ \;\;\;\;1 + x\\ \mathbf{else}:\\ \;\;\;\;\left(-y\right) \cdot z\\ \end{array} \end{array} \]
                  (FPCore (x y z) :precision binary64 (if (<= z 2.3e+255) (+ 1.0 x) (* (- y) z)))
                  double code(double x, double y, double z) {
                  	double tmp;
                  	if (z <= 2.3e+255) {
                  		tmp = 1.0 + x;
                  	} else {
                  		tmp = -y * z;
                  	}
                  	return tmp;
                  }
                  
                  real(8) function code(x, y, z)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      real(8), intent (in) :: z
                      real(8) :: tmp
                      if (z <= 2.3d+255) then
                          tmp = 1.0d0 + x
                      else
                          tmp = -y * z
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double x, double y, double z) {
                  	double tmp;
                  	if (z <= 2.3e+255) {
                  		tmp = 1.0 + x;
                  	} else {
                  		tmp = -y * z;
                  	}
                  	return tmp;
                  }
                  
                  def code(x, y, z):
                  	tmp = 0
                  	if z <= 2.3e+255:
                  		tmp = 1.0 + x
                  	else:
                  		tmp = -y * z
                  	return tmp
                  
                  function code(x, y, z)
                  	tmp = 0.0
                  	if (z <= 2.3e+255)
                  		tmp = Float64(1.0 + x);
                  	else
                  		tmp = Float64(Float64(-y) * z);
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(x, y, z)
                  	tmp = 0.0;
                  	if (z <= 2.3e+255)
                  		tmp = 1.0 + x;
                  	else
                  		tmp = -y * z;
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[x_, y_, z_] := If[LessEqual[z, 2.3e+255], N[(1.0 + x), $MachinePrecision], N[((-y) * z), $MachinePrecision]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;z \leq 2.3 \cdot 10^{+255}:\\
                  \;\;\;\;1 + x\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\left(-y\right) \cdot z\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if z < 2.3e255

                    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 + x} \]
                    4. Step-by-step derivation
                      1. lower-+.f6463.3

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

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

                    if 2.3e255 < 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 \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. *-commutativeN/A

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

                        \[\leadsto x - \left(z \cdot y + \color{blue}{-1}\right) \]
                      9. lower-fma.f6477.3

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

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

                      \[\leadsto -1 \cdot \color{blue}{\left(y \cdot z\right)} \]
                    7. Step-by-step derivation
                      1. Applied rewrites65.1%

                        \[\leadsto \left(-z\right) \cdot \color{blue}{y} \]
                    8. Recombined 2 regimes into one program.
                    9. Final simplification63.5%

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

                    Alternative 14: 61.8% accurate, 53.0× speedup?

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

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

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

                    Alternative 15: 20.8% 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. lower-+.f6459.2

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

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

                      \[\leadsto 1 \]
                    7. Step-by-step derivation
                      1. Applied rewrites21.2%

                        \[\leadsto 1 \]
                      2. Add Preprocessing

                      Reproduce

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