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

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

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 14 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 99.9% accurate, 1.0× speedup?

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

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

Alternative 1: 99.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(\sin y, -z, x + \cos y\right) \end{array} \]
(FPCore (x y z) :precision binary64 (fma (sin y) (- z) (+ x (cos y))))
double code(double x, double y, double z) {
	return fma(sin(y), -z, (x + cos(y)));
}
function code(x, y, z)
	return fma(sin(y), Float64(-z), Float64(x + cos(y)))
end
code[x_, y_, z_] := N[(N[Sin[y], $MachinePrecision] * (-z) + N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(\sin y, -z, x + \cos y\right)
\end{array}
Derivation
  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. sub-negN/A

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\sin y, \mathsf{neg}\left(z\right), x + \cos y\right)} \]
    8. lower-neg.f64100.0

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

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

      \[\leadsto \mathsf{fma}\left(\sin y, -z, \color{blue}{\cos y + x}\right) \]
    11. lower-+.f64100.0

      \[\leadsto \mathsf{fma}\left(\sin y, -z, \color{blue}{\cos y + x}\right) \]
  4. Applied rewrites100.0%

    \[\leadsto \color{blue}{\mathsf{fma}\left(\sin y, -z, \cos y + x\right)} \]
  5. Final simplification100.0%

    \[\leadsto \mathsf{fma}\left(\sin y, -z, x + \cos y\right) \]
  6. Add Preprocessing

Alternative 2: 92.6% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x + \cos y\\ t_1 := z \cdot \sin y\\ t_2 := t\_0 - t\_1\\ t_3 := \left(1 + x\right) - t\_1\\ \mathbf{if}\;t\_2 \leq -5 \cdot 10^{+16}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t\_2 \leq 0.9977230244400593:\\ \;\;\;\;t\_0 - z \cdot y\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (+ x (cos y)))
        (t_1 (* z (sin y)))
        (t_2 (- t_0 t_1))
        (t_3 (- (+ 1.0 x) t_1)))
   (if (<= t_2 -5e+16)
     t_3
     (if (<= t_2 0.9977230244400593) (- t_0 (* z y)) t_3))))
double code(double x, double y, double z) {
	double t_0 = x + cos(y);
	double t_1 = z * sin(y);
	double t_2 = t_0 - t_1;
	double t_3 = (1.0 + x) - t_1;
	double tmp;
	if (t_2 <= -5e+16) {
		tmp = t_3;
	} else if (t_2 <= 0.9977230244400593) {
		tmp = t_0 - (z * y);
	} 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 = x + cos(y)
    t_1 = z * sin(y)
    t_2 = t_0 - t_1
    t_3 = (1.0d0 + x) - t_1
    if (t_2 <= (-5d+16)) then
        tmp = t_3
    else if (t_2 <= 0.9977230244400593d0) then
        tmp = t_0 - (z * y)
    else
        tmp = t_3
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = x + Math.cos(y);
	double t_1 = z * Math.sin(y);
	double t_2 = t_0 - t_1;
	double t_3 = (1.0 + x) - t_1;
	double tmp;
	if (t_2 <= -5e+16) {
		tmp = t_3;
	} else if (t_2 <= 0.9977230244400593) {
		tmp = t_0 - (z * y);
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = x + math.cos(y)
	t_1 = z * math.sin(y)
	t_2 = t_0 - t_1
	t_3 = (1.0 + x) - t_1
	tmp = 0
	if t_2 <= -5e+16:
		tmp = t_3
	elif t_2 <= 0.9977230244400593:
		tmp = t_0 - (z * y)
	else:
		tmp = t_3
	return tmp
function code(x, y, z)
	t_0 = Float64(x + cos(y))
	t_1 = Float64(z * sin(y))
	t_2 = Float64(t_0 - t_1)
	t_3 = Float64(Float64(1.0 + x) - t_1)
	tmp = 0.0
	if (t_2 <= -5e+16)
		tmp = t_3;
	elseif (t_2 <= 0.9977230244400593)
		tmp = Float64(t_0 - Float64(z * y));
	else
		tmp = t_3;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = x + cos(y);
	t_1 = z * sin(y);
	t_2 = t_0 - t_1;
	t_3 = (1.0 + x) - t_1;
	tmp = 0.0;
	if (t_2 <= -5e+16)
		tmp = t_3;
	elseif (t_2 <= 0.9977230244400593)
		tmp = t_0 - (z * y);
	else
		tmp = t_3;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(z * N[Sin[y], $MachinePrecision]), $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, -5e+16], t$95$3, If[LessEqual[t$95$2, 0.9977230244400593], N[(t$95$0 - N[(z * y), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_2 \leq 0.9977230244400593:\\
\;\;\;\;t\_0 - z \cdot y\\

\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))) < -5e16 or 0.997723024440059336 < (-.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.8%

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

      if -5e16 < (-.f64 (+.f64 x (cos.f64 y)) (*.f64 z (sin.f64 y))) < 0.997723024440059336

      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 + \cos y\right) - \color{blue}{y \cdot z} \]
      4. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \left(x + \cos y\right) - \color{blue}{z \cdot y} \]
        2. lower-*.f6466.8

          \[\leadsto \left(x + \cos y\right) - \color{blue}{z \cdot y} \]
      5. Applied rewrites66.8%

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

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

    Alternative 3: 92.5% accurate, 0.4× speedup?

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

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

        if -2e6 < (-.f64 (+.f64 x (cos.f64 y)) (*.f64 z (sin.f64 y))) < 0.997723024440059336

        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 + \cos y\right) - \color{blue}{y \cdot z} \]
        4. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \left(x + \cos y\right) - \color{blue}{z \cdot y} \]
          2. lower-*.f6463.7

            \[\leadsto \left(x + \cos y\right) - \color{blue}{z \cdot y} \]
        5. Applied rewrites63.7%

          \[\leadsto \left(x + \cos y\right) - \color{blue}{z \cdot y} \]
        6. 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) - z \cdot y \]
        7. 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) - z \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) - z \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) - z \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) - z \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) - z \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) - z \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) - z \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) - z \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) - z \cdot y \]
          10. lower-*.f646.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) - z \cdot y \]
        8. Applied rewrites6.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) - z \cdot y \]
        9. Taylor expanded in x around 0

          \[\leadsto \color{blue}{\cos y} - z \cdot y \]
        10. Step-by-step derivation
          1. lower-cos.f6458.9

            \[\leadsto \color{blue}{\cos y} - z \cdot y \]
        11. Applied rewrites58.9%

          \[\leadsto \color{blue}{\cos y} - z \cdot y \]
      5. Recombined 2 regimes into one program.
      6. Final simplification94.5%

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

      Alternative 4: 99.2% accurate, 1.0× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := z \cdot \sin y\\ t_1 := \left(1 + x\right) - t\_0\\ \mathbf{if}\;x \leq -6.2 \cdot 10^{-7}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 1.4 \cdot 10^{-19}:\\ \;\;\;\;\cos y - t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (x y z)
       :precision binary64
       (let* ((t_0 (* z (sin y))) (t_1 (- (+ 1.0 x) t_0)))
         (if (<= x -6.2e-7) t_1 (if (<= x 1.4e-19) (- (cos y) t_0) t_1))))
      double code(double x, double y, double z) {
      	double t_0 = z * sin(y);
      	double t_1 = (1.0 + x) - t_0;
      	double tmp;
      	if (x <= -6.2e-7) {
      		tmp = t_1;
      	} else if (x <= 1.4e-19) {
      		tmp = cos(y) - t_0;
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      real(8) function code(x, y, z)
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8) :: t_0
          real(8) :: t_1
          real(8) :: tmp
          t_0 = z * sin(y)
          t_1 = (1.0d0 + x) - t_0
          if (x <= (-6.2d-7)) then
              tmp = t_1
          else if (x <= 1.4d-19) then
              tmp = cos(y) - t_0
          else
              tmp = t_1
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z) {
      	double t_0 = z * Math.sin(y);
      	double t_1 = (1.0 + x) - t_0;
      	double tmp;
      	if (x <= -6.2e-7) {
      		tmp = t_1;
      	} else if (x <= 1.4e-19) {
      		tmp = Math.cos(y) - t_0;
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      def code(x, y, z):
      	t_0 = z * math.sin(y)
      	t_1 = (1.0 + x) - t_0
      	tmp = 0
      	if x <= -6.2e-7:
      		tmp = t_1
      	elif x <= 1.4e-19:
      		tmp = math.cos(y) - t_0
      	else:
      		tmp = t_1
      	return tmp
      
      function code(x, y, z)
      	t_0 = Float64(z * sin(y))
      	t_1 = Float64(Float64(1.0 + x) - t_0)
      	tmp = 0.0
      	if (x <= -6.2e-7)
      		tmp = t_1;
      	elseif (x <= 1.4e-19)
      		tmp = Float64(cos(y) - t_0);
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z)
      	t_0 = z * sin(y);
      	t_1 = (1.0 + x) - t_0;
      	tmp = 0.0;
      	if (x <= -6.2e-7)
      		tmp = t_1;
      	elseif (x <= 1.4e-19)
      		tmp = cos(y) - t_0;
      	else
      		tmp = t_1;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(1.0 + x), $MachinePrecision] - t$95$0), $MachinePrecision]}, If[LessEqual[x, -6.2e-7], t$95$1, If[LessEqual[x, 1.4e-19], N[(N[Cos[y], $MachinePrecision] - t$95$0), $MachinePrecision], t$95$1]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := z \cdot \sin y\\
      t_1 := \left(1 + x\right) - t\_0\\
      \mathbf{if}\;x \leq -6.2 \cdot 10^{-7}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;x \leq 1.4 \cdot 10^{-19}:\\
      \;\;\;\;\cos y - t\_0\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if x < -6.1999999999999999e-7 or 1.40000000000000001e-19 < 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 \left(x + \color{blue}{1}\right) - z \cdot \sin y \]
        4. Step-by-step derivation
          1. Applied rewrites99.6%

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

          if -6.1999999999999999e-7 < x < 1.40000000000000001e-19

          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.f6499.3

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

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

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

        Alternative 5: 99.9% accurate, 1.0× speedup?

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

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

        Alternative 6: 71.1% accurate, 1.8× speedup?

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

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

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

          if -52 < x < 2.35000000000000001e-34

          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 + \cos y\right) - \color{blue}{y \cdot z} \]
          4. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \left(x + \cos y\right) - \color{blue}{z \cdot y} \]
            2. lower-*.f6468.9

              \[\leadsto \left(x + \cos y\right) - \color{blue}{z \cdot y} \]
          5. Applied rewrites68.9%

            \[\leadsto \left(x + \cos y\right) - \color{blue}{z \cdot y} \]
          6. 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) - z \cdot y \]
          7. 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) - z \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) - z \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) - z \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) - z \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) - z \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) - z \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) - z \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) - z \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) - z \cdot y \]
            10. lower-*.f6453.8

              \[\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) - z \cdot y \]
          8. Applied rewrites53.8%

            \[\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) - z \cdot y \]
          9. Taylor expanded in x around 0

            \[\leadsto \color{blue}{\cos y} - z \cdot y \]
          10. Step-by-step derivation
            1. lower-cos.f6467.6

              \[\leadsto \color{blue}{\cos y} - z \cdot y \]
          11. Applied rewrites67.6%

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

        Alternative 7: 70.3% accurate, 1.8× speedup?

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

          1. Initial program 99.8%

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

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

              \[\leadsto \color{blue}{\mathsf{neg}\left(z \cdot \sin y\right)} \]
            2. 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.f6468.9

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

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

          if -7.89999999999999965e149 < z < 4.2000000000000003e73

          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-+.f6477.5

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

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

        Alternative 8: 68.9% accurate, 3.7× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -6.6 \cdot 10^{+15}:\\ \;\;\;\;1 + x\\ \mathbf{elif}\;y \leq 8 \cdot 10^{-20}:\\ \;\;\;\;\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) - z \cdot y\\ \mathbf{else}:\\ \;\;\;\;1 + x\\ \end{array} \end{array} \]
        (FPCore (x y z)
         :precision binary64
         (if (<= y -6.6e+15)
           (+ 1.0 x)
           (if (<= y 8e-20)
             (-
              (+
               (fma
                (fma
                 (fma -0.001388888888888889 (* y y) 0.041666666666666664)
                 (* y y)
                 -0.5)
                (* y y)
                1.0)
               x)
              (* z y))
             (+ 1.0 x))))
        double code(double x, double y, double z) {
        	double tmp;
        	if (y <= -6.6e+15) {
        		tmp = 1.0 + x;
        	} else if (y <= 8e-20) {
        		tmp = (fma(fma(fma(-0.001388888888888889, (y * y), 0.041666666666666664), (y * y), -0.5), (y * y), 1.0) + x) - (z * y);
        	} else {
        		tmp = 1.0 + x;
        	}
        	return tmp;
        }
        
        function code(x, y, z)
        	tmp = 0.0
        	if (y <= -6.6e+15)
        		tmp = Float64(1.0 + x);
        	elseif (y <= 8e-20)
        		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(z * y));
        	else
        		tmp = Float64(1.0 + x);
        	end
        	return tmp
        end
        
        code[x_, y_, z_] := If[LessEqual[y, -6.6e+15], N[(1.0 + x), $MachinePrecision], If[LessEqual[y, 8e-20], 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[(z * y), $MachinePrecision]), $MachinePrecision], N[(1.0 + x), $MachinePrecision]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;y \leq -6.6 \cdot 10^{+15}:\\
        \;\;\;\;1 + x\\
        
        \mathbf{elif}\;y \leq 8 \cdot 10^{-20}:\\
        \;\;\;\;\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) - z \cdot y\\
        
        \mathbf{else}:\\
        \;\;\;\;1 + x\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if y < -6.6e15 or 7.99999999999999956e-20 < 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-+.f6446.0

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

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

          if -6.6e15 < y < 7.99999999999999956e-20

          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 + \cos y\right) - \color{blue}{y \cdot z} \]
          4. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \left(x + \cos y\right) - \color{blue}{z \cdot y} \]
            2. lower-*.f6499.4

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

            \[\leadsto \left(x + \cos y\right) - \color{blue}{z \cdot y} \]
          6. 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) - z \cdot y \]
          7. 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) - z \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) - z \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) - z \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) - z \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) - z \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) - z \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) - z \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) - z \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) - z \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) - z \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) - z \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) - z \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) - z \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) - z \cdot y \]
            15. lower-*.f6497.7

              \[\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) - z \cdot y \]
          8. Applied rewrites97.7%

            \[\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) - z \cdot y \]
        3. Recombined 2 regimes into one program.
        4. Final simplification72.8%

          \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.6 \cdot 10^{+15}:\\ \;\;\;\;1 + x\\ \mathbf{elif}\;y \leq 8 \cdot 10^{-20}:\\ \;\;\;\;\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) - z \cdot y\\ \mathbf{else}:\\ \;\;\;\;1 + x\\ \end{array} \]
        5. Add Preprocessing

        Alternative 9: 69.2% accurate, 7.1× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -3.3 \cdot 10^{+16}:\\ \;\;\;\;1 + x\\ \mathbf{elif}\;y \leq 9.5 \cdot 10^{+30}:\\ \;\;\;\;\mathsf{fma}\left(-0.5 \cdot y - z, y, 1 + x\right)\\ \mathbf{else}:\\ \;\;\;\;1 + x\\ \end{array} \end{array} \]
        (FPCore (x y z)
         :precision binary64
         (if (<= y -3.3e+16)
           (+ 1.0 x)
           (if (<= y 9.5e+30) (fma (- (* -0.5 y) z) y (+ 1.0 x)) (+ 1.0 x))))
        double code(double x, double y, double z) {
        	double tmp;
        	if (y <= -3.3e+16) {
        		tmp = 1.0 + x;
        	} else if (y <= 9.5e+30) {
        		tmp = fma(((-0.5 * y) - z), y, (1.0 + x));
        	} else {
        		tmp = 1.0 + x;
        	}
        	return tmp;
        }
        
        function code(x, y, z)
        	tmp = 0.0
        	if (y <= -3.3e+16)
        		tmp = Float64(1.0 + x);
        	elseif (y <= 9.5e+30)
        		tmp = fma(Float64(Float64(-0.5 * y) - z), y, Float64(1.0 + x));
        	else
        		tmp = Float64(1.0 + x);
        	end
        	return tmp
        end
        
        code[x_, y_, z_] := If[LessEqual[y, -3.3e+16], N[(1.0 + x), $MachinePrecision], If[LessEqual[y, 9.5e+30], N[(N[(N[(-0.5 * y), $MachinePrecision] - z), $MachinePrecision] * y + N[(1.0 + x), $MachinePrecision]), $MachinePrecision], N[(1.0 + x), $MachinePrecision]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;y \leq -3.3 \cdot 10^{+16}:\\
        \;\;\;\;1 + x\\
        
        \mathbf{elif}\;y \leq 9.5 \cdot 10^{+30}:\\
        \;\;\;\;\mathsf{fma}\left(-0.5 \cdot y - z, y, 1 + x\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;1 + x\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if y < -3.3e16 or 9.5000000000000003e30 < 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-+.f6444.1

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

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

          if -3.3e16 < y < 9.5000000000000003e30

          1. Initial program 100.0%

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

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

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

              \[\leadsto \color{blue}{y \cdot \left(\frac{-1}{2} \cdot y - z\right) + \left(1 + x\right)} \]
            3. *-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-+.f6497.0

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

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

        Alternative 10: 69.3% accurate, 9.6× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -4 \cdot 10^{+20}:\\ \;\;\;\;1 + x\\ \mathbf{elif}\;y \leq 9.5 \cdot 10^{+30}:\\ \;\;\;\;x - \mathsf{fma}\left(z, y, -1\right)\\ \mathbf{else}:\\ \;\;\;\;1 + x\\ \end{array} \end{array} \]
        (FPCore (x y z)
         :precision binary64
         (if (<= y -4e+20)
           (+ 1.0 x)
           (if (<= y 9.5e+30) (- x (fma z y -1.0)) (+ 1.0 x))))
        double code(double x, double y, double z) {
        	double tmp;
        	if (y <= -4e+20) {
        		tmp = 1.0 + x;
        	} else if (y <= 9.5e+30) {
        		tmp = x - fma(z, y, -1.0);
        	} else {
        		tmp = 1.0 + x;
        	}
        	return tmp;
        }
        
        function code(x, y, z)
        	tmp = 0.0
        	if (y <= -4e+20)
        		tmp = Float64(1.0 + x);
        	elseif (y <= 9.5e+30)
        		tmp = Float64(x - fma(z, y, -1.0));
        	else
        		tmp = Float64(1.0 + x);
        	end
        	return tmp
        end
        
        code[x_, y_, z_] := If[LessEqual[y, -4e+20], N[(1.0 + x), $MachinePrecision], If[LessEqual[y, 9.5e+30], N[(x - N[(z * y + -1.0), $MachinePrecision]), $MachinePrecision], N[(1.0 + x), $MachinePrecision]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;y \leq -4 \cdot 10^{+20}:\\
        \;\;\;\;1 + x\\
        
        \mathbf{elif}\;y \leq 9.5 \cdot 10^{+30}:\\
        \;\;\;\;x - \mathsf{fma}\left(z, y, -1\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;1 + x\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if y < -4e20 or 9.5000000000000003e30 < 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-+.f6444.1

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

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

          if -4e20 < y < 9.5000000000000003e30

          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.f6496.8

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

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

        Alternative 11: 65.9% accurate, 10.1× speedup?

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

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

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

          if -52 < x < 2.30000000000000011e-34

          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-+.f6453.8

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

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

            \[\leadsto \mathsf{fma}\left(\frac{-1}{2} \cdot y - z, y, 1\right) \]
          7. Step-by-step derivation
            1. Applied rewrites53.2%

              \[\leadsto \mathsf{fma}\left(-0.5 \cdot y - z, y, 1\right) \]
            2. Taylor expanded in y around 0

              \[\leadsto \mathsf{fma}\left(-1 \cdot z, y, 1\right) \]
            3. Step-by-step derivation
              1. Applied rewrites54.4%

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

            Alternative 12: 61.6% accurate, 15.1× speedup?

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

              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.f6480.6

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

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

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

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

                if -1.50000000000000012e220 < z

                1. Initial program 99.9%

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

                  \[\leadsto \color{blue}{1 + x} \]
                4. Step-by-step derivation
                  1. lower-+.f6467.8

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

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

              Alternative 13: 60.9% 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-+.f6464.3

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

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

              Alternative 14: 21.7% 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-+.f6464.3

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

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

                \[\leadsto 1 \]
              7. Step-by-step derivation
                1. Applied rewrites22.8%

                  \[\leadsto 1 \]
                2. Add Preprocessing

                Reproduce

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