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

Percentage Accurate: 99.9% → 99.9%
Time: 8.8s
Alternatives: 16
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 16 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 := \sin y \cdot z\\ t_1 := \left(\cos y + x\right) - t\_0\\ t_2 := \left(1 + x\right) - t\_0\\ \mathbf{if}\;t\_1 \leq -5000:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 0.999:\\ \;\;\;\;\mathsf{fma}\left(\frac{\cos y}{x}, x, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* (sin y) z))
        (t_1 (- (+ (cos y) x) t_0))
        (t_2 (- (+ 1.0 x) t_0)))
   (if (<= t_1 -5000.0) t_2 (if (<= t_1 0.999) (fma (/ (cos y) x) x x) t_2))))
double code(double x, double y, double z) {
	double t_0 = sin(y) * z;
	double t_1 = (cos(y) + x) - t_0;
	double t_2 = (1.0 + x) - t_0;
	double tmp;
	if (t_1 <= -5000.0) {
		tmp = t_2;
	} else if (t_1 <= 0.999) {
		tmp = fma((cos(y) / x), x, x);
	} else {
		tmp = t_2;
	}
	return tmp;
}
function code(x, y, z)
	t_0 = Float64(sin(y) * z)
	t_1 = Float64(Float64(cos(y) + x) - t_0)
	t_2 = Float64(Float64(1.0 + x) - t_0)
	tmp = 0.0
	if (t_1 <= -5000.0)
		tmp = t_2;
	elseif (t_1 <= 0.999)
		tmp = fma(Float64(cos(y) / x), x, x);
	else
		tmp = t_2;
	end
	return tmp
end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Sin[y], $MachinePrecision] * z), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Cos[y], $MachinePrecision] + x), $MachinePrecision] - t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(1.0 + x), $MachinePrecision] - t$95$0), $MachinePrecision]}, If[LessEqual[t$95$1, -5000.0], t$95$2, If[LessEqual[t$95$1, 0.999], N[(N[(N[Cos[y], $MachinePrecision] / x), $MachinePrecision] * x + x), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_1 \leq 0.999:\\
\;\;\;\;\mathsf{fma}\left(\frac{\cos y}{x}, x, x\right)\\

\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))) < -5e3 or 0.998999999999999999 < (-.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.2%

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

      if -5e3 < (-.f64 (+.f64 x (cos.f64 y)) (*.f64 z (sin.f64 y))) < 0.998999999999999999

      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. lower-/.f64N/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}} \]
        4. lower--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{{\left(\cos y + x\right)}^{2} - {\left(\sin y \cdot z\right)}^{2}}{\mathsf{fma}\left(\sin y, z, \color{blue}{\cos y + x}\right)} \]
        21. lower-+.f6499.9

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(\left(1 + 2 \cdot \frac{\cos y}{x}\right) - \frac{\cos y}{x}\right)} \]
      9. Step-by-step derivation
        1. Applied rewrites95.0%

          \[\leadsto \mathsf{fma}\left(\frac{\cos y}{x}, \color{blue}{x}, x\right) \]
      10. Recombined 2 regimes into one program.
      11. Final simplification98.7%

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

      Alternative 3: 92.5% 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 -5000:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t\_2 \leq 0.999:\\ \;\;\;\;t\_0 - z \cdot y\\ \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 -5000.0) t_3 (if (<= t_2 0.999) (- t_0 (* z y)) 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 <= -5000.0) {
      		tmp = t_3;
      	} else if (t_2 <= 0.999) {
      		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 = cos(y) + x
          t_1 = sin(y) * z
          t_2 = t_0 - t_1
          t_3 = (1.0d0 + x) - t_1
          if (t_2 <= (-5000.0d0)) then
              tmp = t_3
          else if (t_2 <= 0.999d0) 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 = 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 <= -5000.0) {
      		tmp = t_3;
      	} else if (t_2 <= 0.999) {
      		tmp = t_0 - (z * y);
      	} 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 <= -5000.0:
      		tmp = t_3
      	elif t_2 <= 0.999:
      		tmp = t_0 - (z * y)
      	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 <= -5000.0)
      		tmp = t_3;
      	elseif (t_2 <= 0.999)
      		tmp = Float64(t_0 - Float64(z * y));
      	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 <= -5000.0)
      		tmp = t_3;
      	elseif (t_2 <= 0.999)
      		tmp = t_0 - (z * y);
      	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, -5000.0], t$95$3, If[LessEqual[t$95$2, 0.999], N[(t$95$0 - N[(z * y), $MachinePrecision]), $MachinePrecision], 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 -5000:\\
      \;\;\;\;t\_3\\
      
      \mathbf{elif}\;t\_2 \leq 0.999:\\
      \;\;\;\;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))) < -5e3 or 0.998999999999999999 < (-.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.2%

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

          if -5e3 < (-.f64 (+.f64 x (cos.f64 y)) (*.f64 z (sin.f64 y))) < 0.998999999999999999

          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-*.f6453.1

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

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

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

        Alternative 4: 92.1% accurate, 0.4× speedup?

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

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

            if -5e3 < (-.f64 (+.f64 x (cos.f64 y)) (*.f64 z (sin.f64 y))) < 0.998999999999999999

            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-*.f6453.1

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

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

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

                \[\leadsto \color{blue}{\cos y} - z \cdot y \]
            8. Applied rewrites53.1%

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

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

          Alternative 5: 99.2% accurate, 1.0× speedup?

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

            1. Initial program 99.9%

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

              \[\leadsto \left(x + \color{blue}{1}\right) - z \cdot \sin y \]
            4. Step-by-step derivation
              1. Applied rewrites99.9%

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

              if -6.99999999999999989e-6 < x < 1.2e-14

              1. Initial program 99.8%

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(-z, \color{blue}{\sin y}, \cos y\right) \]
                7. lower-cos.f6499.4

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

                \[\leadsto \color{blue}{\mathsf{fma}\left(-z, \sin y, \cos y\right)} \]
            5. Recombined 2 regimes into one program.
            6. Final simplification99.7%

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

            Alternative 6: 66.6% accurate, 1.7× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.9 \cdot 10^{-25}:\\ \;\;\;\;1 + x\\ \mathbf{elif}\;x \leq -1.35 \cdot 10^{-288}:\\ \;\;\;\;\left(-z\right) \cdot \sin y\\ \mathbf{elif}\;x \leq 80000000000000:\\ \;\;\;\;\cos y - z \cdot y\\ \mathbf{else}:\\ \;\;\;\;1 + x\\ \end{array} \end{array} \]
            (FPCore (x y z)
             :precision binary64
             (if (<= x -1.9e-25)
               (+ 1.0 x)
               (if (<= x -1.35e-288)
                 (* (- z) (sin y))
                 (if (<= x 80000000000000.0) (- (cos y) (* z y)) (+ 1.0 x)))))
            double code(double x, double y, double z) {
            	double tmp;
            	if (x <= -1.9e-25) {
            		tmp = 1.0 + x;
            	} else if (x <= -1.35e-288) {
            		tmp = -z * sin(y);
            	} else if (x <= 80000000000000.0) {
            		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 <= (-1.9d-25)) then
                    tmp = 1.0d0 + x
                else if (x <= (-1.35d-288)) then
                    tmp = -z * sin(y)
                else if (x <= 80000000000000.0d0) 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 <= -1.9e-25) {
            		tmp = 1.0 + x;
            	} else if (x <= -1.35e-288) {
            		tmp = -z * Math.sin(y);
            	} else if (x <= 80000000000000.0) {
            		tmp = Math.cos(y) - (z * y);
            	} else {
            		tmp = 1.0 + x;
            	}
            	return tmp;
            }
            
            def code(x, y, z):
            	tmp = 0
            	if x <= -1.9e-25:
            		tmp = 1.0 + x
            	elif x <= -1.35e-288:
            		tmp = -z * math.sin(y)
            	elif x <= 80000000000000.0:
            		tmp = math.cos(y) - (z * y)
            	else:
            		tmp = 1.0 + x
            	return tmp
            
            function code(x, y, z)
            	tmp = 0.0
            	if (x <= -1.9e-25)
            		tmp = Float64(1.0 + x);
            	elseif (x <= -1.35e-288)
            		tmp = Float64(Float64(-z) * sin(y));
            	elseif (x <= 80000000000000.0)
            		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 <= -1.9e-25)
            		tmp = 1.0 + x;
            	elseif (x <= -1.35e-288)
            		tmp = -z * sin(y);
            	elseif (x <= 80000000000000.0)
            		tmp = cos(y) - (z * y);
            	else
            		tmp = 1.0 + x;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_, z_] := If[LessEqual[x, -1.9e-25], N[(1.0 + x), $MachinePrecision], If[LessEqual[x, -1.35e-288], N[((-z) * N[Sin[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 80000000000000.0], 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 -1.9 \cdot 10^{-25}:\\
            \;\;\;\;1 + x\\
            
            \mathbf{elif}\;x \leq -1.35 \cdot 10^{-288}:\\
            \;\;\;\;\left(-z\right) \cdot \sin y\\
            
            \mathbf{elif}\;x \leq 80000000000000:\\
            \;\;\;\;\cos y - z \cdot y\\
            
            \mathbf{else}:\\
            \;\;\;\;1 + x\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if x < -1.8999999999999999e-25 or 8e13 < x

              1. Initial program 99.9%

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

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

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

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

              if -1.8999999999999999e-25 < x < -1.3500000000000001e-288

              1. Initial program 99.7%

                \[\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.f6460.7

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

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

              if -1.3500000000000001e-288 < x < 8e13

              1. Initial program 99.8%

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

                \[\leadsto \left(x + \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-*.f6470.2

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

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

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

                  \[\leadsto \color{blue}{\cos y} - z \cdot y \]
              8. Applied rewrites70.1%

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

            Alternative 7: 69.2% accurate, 1.8× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(-z\right) \cdot \sin y\\ \mathbf{if}\;z \leq -4 \cdot 10^{+179}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 1.75 \cdot 10^{+49}:\\ \;\;\;\;1 + x\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
            (FPCore (x y z)
             :precision binary64
             (let* ((t_0 (* (- z) (sin y))))
               (if (<= z -4e+179) t_0 (if (<= z 1.75e+49) (+ 1.0 x) t_0))))
            double code(double x, double y, double z) {
            	double t_0 = -z * sin(y);
            	double tmp;
            	if (z <= -4e+179) {
            		tmp = t_0;
            	} else if (z <= 1.75e+49) {
            		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 <= (-4d+179)) then
                    tmp = t_0
                else if (z <= 1.75d+49) 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 <= -4e+179) {
            		tmp = t_0;
            	} else if (z <= 1.75e+49) {
            		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 <= -4e+179:
            		tmp = t_0
            	elif z <= 1.75e+49:
            		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 <= -4e+179)
            		tmp = t_0;
            	elseif (z <= 1.75e+49)
            		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 <= -4e+179)
            		tmp = t_0;
            	elseif (z <= 1.75e+49)
            		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, -4e+179], t$95$0, If[LessEqual[z, 1.75e+49], 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 -4 \cdot 10^{+179}:\\
            \;\;\;\;t\_0\\
            
            \mathbf{elif}\;z \leq 1.75 \cdot 10^{+49}:\\
            \;\;\;\;1 + x\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_0\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if z < -3.99999999999999992e179 or 1.74999999999999987e49 < 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.f6471.4

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

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

              if -3.99999999999999992e179 < z < 1.74999999999999987e49

              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-+.f6475.1

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

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

            Alternative 8: 69.5% accurate, 5.2× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2.3 \cdot 10^{+52}:\\ \;\;\;\;1 + x\\ \mathbf{elif}\;y \leq 3.1 \cdot 10^{+15}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666, z \cdot y, -0.5\right) \cdot y - z, y, 1 + x\right)\\ \mathbf{else}:\\ \;\;\;\;1 + x\\ \end{array} \end{array} \]
            (FPCore (x y z)
             :precision binary64
             (if (<= y -2.3e+52)
               (+ 1.0 x)
               (if (<= y 3.1e+15)
                 (fma (- (* (fma 0.16666666666666666 (* z y) -0.5) y) z) y (+ 1.0 x))
                 (+ 1.0 x))))
            double code(double x, double y, double z) {
            	double tmp;
            	if (y <= -2.3e+52) {
            		tmp = 1.0 + x;
            	} else if (y <= 3.1e+15) {
            		tmp = fma(((fma(0.16666666666666666, (z * y), -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 <= -2.3e+52)
            		tmp = Float64(1.0 + x);
            	elseif (y <= 3.1e+15)
            		tmp = fma(Float64(Float64(fma(0.16666666666666666, Float64(z * y), -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, -2.3e+52], N[(1.0 + x), $MachinePrecision], If[LessEqual[y, 3.1e+15], N[(N[(N[(N[(0.16666666666666666 * N[(z * y), $MachinePrecision] + -0.5), $MachinePrecision] * 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 -2.3 \cdot 10^{+52}:\\
            \;\;\;\;1 + x\\
            
            \mathbf{elif}\;y \leq 3.1 \cdot 10^{+15}:\\
            \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666, z \cdot y, -0.5\right) \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 < -2.3e52 or 3.1e15 < y

              1. Initial program 99.8%

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

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

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

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

              if -2.3e52 < y < 3.1e15

              1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            Alternative 9: 69.7% accurate, 7.1× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -9 \cdot 10^{+28}:\\ \;\;\;\;1 + x\\ \mathbf{elif}\;y \leq 7 \cdot 10^{+15}:\\ \;\;\;\;\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 -9e+28)
               (+ 1.0 x)
               (if (<= y 7e+15) (fma (- (* -0.5 y) z) y (+ 1.0 x)) (+ 1.0 x))))
            double code(double x, double y, double z) {
            	double tmp;
            	if (y <= -9e+28) {
            		tmp = 1.0 + x;
            	} else if (y <= 7e+15) {
            		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 <= -9e+28)
            		tmp = Float64(1.0 + x);
            	elseif (y <= 7e+15)
            		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, -9e+28], N[(1.0 + x), $MachinePrecision], If[LessEqual[y, 7e+15], 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 -9 \cdot 10^{+28}:\\
            \;\;\;\;1 + x\\
            
            \mathbf{elif}\;y \leq 7 \cdot 10^{+15}:\\
            \;\;\;\;\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 < -8.9999999999999994e28 or 7e15 < y

              1. Initial program 99.8%

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

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

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

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

              if -8.9999999999999994e28 < y < 7e15

              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-+.f6493.4

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

                \[\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.5% accurate, 8.8× speedup?

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

              1. Initial program 99.8%

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

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

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

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

              if -2.19999999999999986e28 < y < 1.22000000000000008e82

              1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              Alternative 11: 69.5% accurate, 9.6× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2.2 \cdot 10^{+28}:\\ \;\;\;\;1 + x\\ \mathbf{elif}\;y \leq 1.22 \cdot 10^{+82}:\\ \;\;\;\;x - \mathsf{fma}\left(z, y, -1\right)\\ \mathbf{else}:\\ \;\;\;\;1 + x\\ \end{array} \end{array} \]
              (FPCore (x y z)
               :precision binary64
               (if (<= y -2.2e+28)
                 (+ 1.0 x)
                 (if (<= y 1.22e+82) (- x (fma z y -1.0)) (+ 1.0 x))))
              double code(double x, double y, double z) {
              	double tmp;
              	if (y <= -2.2e+28) {
              		tmp = 1.0 + x;
              	} else if (y <= 1.22e+82) {
              		tmp = x - fma(z, y, -1.0);
              	} else {
              		tmp = 1.0 + x;
              	}
              	return tmp;
              }
              
              function code(x, y, z)
              	tmp = 0.0
              	if (y <= -2.2e+28)
              		tmp = Float64(1.0 + x);
              	elseif (y <= 1.22e+82)
              		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, -2.2e+28], N[(1.0 + x), $MachinePrecision], If[LessEqual[y, 1.22e+82], N[(x - N[(z * y + -1.0), $MachinePrecision]), $MachinePrecision], N[(1.0 + x), $MachinePrecision]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;y \leq -2.2 \cdot 10^{+28}:\\
              \;\;\;\;1 + x\\
              
              \mathbf{elif}\;y \leq 1.22 \cdot 10^{+82}:\\
              \;\;\;\;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 < -2.19999999999999986e28 or 1.22000000000000008e82 < y

                1. Initial program 99.8%

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

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

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

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

                if -2.19999999999999986e28 < y < 1.22000000000000008e82

                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.f6489.4

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

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

              Alternative 12: 66.8% accurate, 10.1× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.85 \cdot 10^{-5}:\\ \;\;\;\;1 + x\\ \mathbf{elif}\;x \leq 80000000000000:\\ \;\;\;\;\mathsf{fma}\left(-z, y, 1\right)\\ \mathbf{else}:\\ \;\;\;\;1 + x\\ \end{array} \end{array} \]
              (FPCore (x y z)
               :precision binary64
               (if (<= x -1.85e-5)
                 (+ 1.0 x)
                 (if (<= x 80000000000000.0) (fma (- z) y 1.0) (+ 1.0 x))))
              double code(double x, double y, double z) {
              	double tmp;
              	if (x <= -1.85e-5) {
              		tmp = 1.0 + x;
              	} else if (x <= 80000000000000.0) {
              		tmp = fma(-z, y, 1.0);
              	} else {
              		tmp = 1.0 + x;
              	}
              	return tmp;
              }
              
              function code(x, y, z)
              	tmp = 0.0
              	if (x <= -1.85e-5)
              		tmp = Float64(1.0 + x);
              	elseif (x <= 80000000000000.0)
              		tmp = fma(Float64(-z), y, 1.0);
              	else
              		tmp = Float64(1.0 + x);
              	end
              	return tmp
              end
              
              code[x_, y_, z_] := If[LessEqual[x, -1.85e-5], N[(1.0 + x), $MachinePrecision], If[LessEqual[x, 80000000000000.0], N[((-z) * y + 1.0), $MachinePrecision], N[(1.0 + x), $MachinePrecision]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;x \leq -1.85 \cdot 10^{-5}:\\
              \;\;\;\;1 + x\\
              
              \mathbf{elif}\;x \leq 80000000000000:\\
              \;\;\;\;\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 < -1.84999999999999991e-5 or 8e13 < 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-+.f6488.1

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

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

                if -1.84999999999999991e-5 < x < 8e13

                1. Initial program 99.8%

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(-z, \color{blue}{\sin y}, \cos y\right) \]
                  7. lower-cos.f6499.3

                    \[\leadsto \mathsf{fma}\left(-z, \sin y, \color{blue}{\cos y}\right) \]
                5. Applied rewrites99.3%

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

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

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

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

                  Alternative 13: 66.8% accurate, 10.1× speedup?

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

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

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

                    if -1.84999999999999991e-5 < x < 8e13

                    1. Initial program 99.8%

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

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

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

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

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

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

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

                        \[\leadsto \mathsf{fma}\left(-z, \color{blue}{\sin y}, \cos y\right) \]
                      7. lower-cos.f6499.3

                        \[\leadsto \mathsf{fma}\left(-z, \sin y, \color{blue}{\cos y}\right) \]
                    5. Applied rewrites99.3%

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

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

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

                    Alternative 14: 61.5% accurate, 15.1× speedup?

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

                      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-+.f6466.0

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

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

                      if 1.4599999999999999e162 < z

                      1. Initial program 100.0%

                        \[\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. sub-negN/A

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

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

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

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

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

                          \[\leadsto \mathsf{fma}\left(-z, \color{blue}{\sin y}, \cos y\right) \]
                        7. lower-cos.f6481.8

                          \[\leadsto \mathsf{fma}\left(-z, \sin y, \color{blue}{\cos y}\right) \]
                      5. Applied rewrites81.8%

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

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

                          \[\leadsto 1 - \color{blue}{z \cdot y} \]
                        2. Taylor expanded in y around inf

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

                            \[\leadsto \left(-z\right) \cdot y \]
                        4. Recombined 2 regimes into one program.
                        5. Add Preprocessing

                        Alternative 15: 62.0% 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-+.f6460.7

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

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

                        Alternative 16: 21.0% 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-+.f6460.7

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

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

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

                            \[\leadsto 1 \]
                          2. Add Preprocessing

                          Reproduce

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