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

Percentage Accurate: 99.9% → 99.9%
Time: 11.7s
Alternatives: 17
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 17 alternatives:

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

Initial Program: 99.9% accurate, 1.0× speedup?

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

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

Alternative 1: 99.9% accurate, 1.0× speedup?

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

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

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

Alternative 2: 98.5% 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 := x - t\_1\\ \mathbf{if}\;t\_2 \leq -200000:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t\_2 \leq 2000000:\\ \;\;\;\;t\_0\\ \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 (- x t_1)))
   (if (<= t_2 -200000.0) t_3 (if (<= t_2 2000000.0) t_0 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 = x - t_1;
	double tmp;
	if (t_2 <= -200000.0) {
		tmp = t_3;
	} else if (t_2 <= 2000000.0) {
		tmp = t_0;
	} else {
		tmp = t_3;
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_0 = x + cos(y)
    t_1 = z * sin(y)
    t_2 = t_0 - t_1
    t_3 = x - t_1
    if (t_2 <= (-200000.0d0)) then
        tmp = t_3
    else if (t_2 <= 2000000.0d0) then
        tmp = t_0
    else
        tmp = t_3
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = x + Math.cos(y);
	double t_1 = z * Math.sin(y);
	double t_2 = t_0 - t_1;
	double t_3 = x - t_1;
	double tmp;
	if (t_2 <= -200000.0) {
		tmp = t_3;
	} else if (t_2 <= 2000000.0) {
		tmp = t_0;
	} 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 = x - t_1
	tmp = 0
	if t_2 <= -200000.0:
		tmp = t_3
	elif t_2 <= 2000000.0:
		tmp = t_0
	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(x - t_1)
	tmp = 0.0
	if (t_2 <= -200000.0)
		tmp = t_3;
	elseif (t_2 <= 2000000.0)
		tmp = t_0;
	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 = x - t_1;
	tmp = 0.0;
	if (t_2 <= -200000.0)
		tmp = t_3;
	elseif (t_2 <= 2000000.0)
		tmp = t_0;
	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[(x - t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, -200000.0], t$95$3, If[LessEqual[t$95$2, 2000000.0], t$95$0, 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 := x - t\_1\\
\mathbf{if}\;t\_2 \leq -200000:\\
\;\;\;\;t\_3\\

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

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


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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\mathsf{fma}\left(z, \sin y, -1\right)} \]
      12. lower-sin.f6499.6

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

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

      \[\leadsto x - \color{blue}{z \cdot \sin y} \]
    10. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto x - \color{blue}{z \cdot \sin y} \]
      2. lower-sin.f6499.1

        \[\leadsto x - z \cdot \color{blue}{\sin y} \]
    11. Applied rewrites99.1%

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

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

    1. Initial program 100.0%

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

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

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

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

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

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

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

Alternative 3: 78.8% accurate, 0.4× speedup?

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

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

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

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


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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, y \cdot -0.5 - z, x + 1\right)} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(y, \frac{1}{\color{blue}{\frac{-1 + \frac{\mathsf{fma}\left(y \cdot \frac{y}{z}, -0.25, y \cdot 0.5\right)}{z}}{z}}}, x + 1\right) \]
    10. Step-by-step derivation
      1. Applied rewrites72.4%

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

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

      1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\cos y} \]
      7. Step-by-step derivation
        1. lower-cos.f6493.6

          \[\leadsto \color{blue}{\cos y} \]
      8. Applied rewrites93.6%

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

    Alternative 4: 99.1% accurate, 1.0× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := x - \mathsf{fma}\left(z, \sin y, -1\right)\\ \mathbf{if}\;x \leq -8 \cdot 10^{-12}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 4 \cdot 10^{-13}:\\ \;\;\;\;\cos y - z \cdot \sin y\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
    (FPCore (x y z)
     :precision binary64
     (let* ((t_0 (- x (fma z (sin y) -1.0))))
       (if (<= x -8e-12) t_0 (if (<= x 4e-13) (- (cos y) (* z (sin y))) t_0))))
    double code(double x, double y, double z) {
    	double t_0 = x - fma(z, sin(y), -1.0);
    	double tmp;
    	if (x <= -8e-12) {
    		tmp = t_0;
    	} else if (x <= 4e-13) {
    		tmp = cos(y) - (z * sin(y));
    	} else {
    		tmp = t_0;
    	}
    	return tmp;
    }
    
    function code(x, y, z)
    	t_0 = Float64(x - fma(z, sin(y), -1.0))
    	tmp = 0.0
    	if (x <= -8e-12)
    		tmp = t_0;
    	elseif (x <= 4e-13)
    		tmp = Float64(cos(y) - Float64(z * sin(y)));
    	else
    		tmp = t_0;
    	end
    	return tmp
    end
    
    code[x_, y_, z_] := Block[{t$95$0 = N[(x - N[(z * N[Sin[y], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -8e-12], t$95$0, If[LessEqual[x, 4e-13], N[(N[Cos[y], $MachinePrecision] - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := x - \mathsf{fma}\left(z, \sin y, -1\right)\\
    \mathbf{if}\;x \leq -8 \cdot 10^{-12}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;x \leq 4 \cdot 10^{-13}:\\
    \;\;\;\;\cos y - z \cdot \sin y\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if x < -7.99999999999999984e-12 or 4.0000000000000001e-13 < 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}{\left(1 + x\right)} - z \cdot \sin y \]
      4. Step-by-step derivation
        1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto x - \color{blue}{\mathsf{fma}\left(z, \sin y, -1\right)} \]
        12. lower-sin.f6499.2

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

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

      if -7.99999999999999984e-12 < x < 4.0000000000000001e-13

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

          \[\leadsto \color{blue}{\cos y - z \cdot \sin y} \]
        2. lower-cos.f64N/A

          \[\leadsto \color{blue}{\cos y} - z \cdot \sin y \]
        3. lower-*.f64N/A

          \[\leadsto \cos y - \color{blue}{z \cdot \sin y} \]
        4. lower-sin.f6499.9

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

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

    Alternative 5: 98.6% accurate, 1.7× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := x - \mathsf{fma}\left(z, \sin y, -1\right)\\ \mathbf{if}\;z \leq -1.6 \cdot 10^{+35}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 0.000465:\\ \;\;\;\;x + \cos y\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
    (FPCore (x y z)
     :precision binary64
     (let* ((t_0 (- x (fma z (sin y) -1.0))))
       (if (<= z -1.6e+35) t_0 (if (<= z 0.000465) (+ x (cos y)) t_0))))
    double code(double x, double y, double z) {
    	double t_0 = x - fma(z, sin(y), -1.0);
    	double tmp;
    	if (z <= -1.6e+35) {
    		tmp = t_0;
    	} else if (z <= 0.000465) {
    		tmp = x + cos(y);
    	} else {
    		tmp = t_0;
    	}
    	return tmp;
    }
    
    function code(x, y, z)
    	t_0 = Float64(x - fma(z, sin(y), -1.0))
    	tmp = 0.0
    	if (z <= -1.6e+35)
    		tmp = t_0;
    	elseif (z <= 0.000465)
    		tmp = Float64(x + cos(y));
    	else
    		tmp = t_0;
    	end
    	return tmp
    end
    
    code[x_, y_, z_] := Block[{t$95$0 = N[(x - N[(z * N[Sin[y], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.6e+35], t$95$0, If[LessEqual[z, 0.000465], N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision], t$95$0]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := x - \mathsf{fma}\left(z, \sin y, -1\right)\\
    \mathbf{if}\;z \leq -1.6 \cdot 10^{+35}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;z \leq 0.000465:\\
    \;\;\;\;x + \cos y\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if z < -1.59999999999999991e35 or 4.6500000000000003e-4 < 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}{\left(1 + x\right)} - z \cdot \sin y \]
      4. Step-by-step derivation
        1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto x - \color{blue}{\mathsf{fma}\left(z, \sin y, -1\right)} \]
        12. lower-sin.f6499.5

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

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

      if -1.59999999999999991e35 < z < 4.6500000000000003e-4

      1. Initial program 100.0%

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

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

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

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

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

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

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

    Alternative 6: 82.5% accurate, 1.8× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin y \cdot \left(-z\right)\\ \mathbf{if}\;z \leq -1.1 \cdot 10^{+159}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{+110}:\\ \;\;\;\;x + \cos y\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
    (FPCore (x y z)
     :precision binary64
     (let* ((t_0 (* (sin y) (- z))))
       (if (<= z -1.1e+159) t_0 (if (<= z 3.8e+110) (+ x (cos y)) t_0))))
    double code(double x, double y, double z) {
    	double t_0 = sin(y) * -z;
    	double tmp;
    	if (z <= -1.1e+159) {
    		tmp = t_0;
    	} else if (z <= 3.8e+110) {
    		tmp = x + cos(y);
    	} else {
    		tmp = t_0;
    	}
    	return tmp;
    }
    
    real(8) function code(x, y, z)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8) :: t_0
        real(8) :: tmp
        t_0 = sin(y) * -z
        if (z <= (-1.1d+159)) then
            tmp = t_0
        else if (z <= 3.8d+110) then
            tmp = x + cos(y)
        else
            tmp = t_0
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z) {
    	double t_0 = Math.sin(y) * -z;
    	double tmp;
    	if (z <= -1.1e+159) {
    		tmp = t_0;
    	} else if (z <= 3.8e+110) {
    		tmp = x + Math.cos(y);
    	} else {
    		tmp = t_0;
    	}
    	return tmp;
    }
    
    def code(x, y, z):
    	t_0 = math.sin(y) * -z
    	tmp = 0
    	if z <= -1.1e+159:
    		tmp = t_0
    	elif z <= 3.8e+110:
    		tmp = x + math.cos(y)
    	else:
    		tmp = t_0
    	return tmp
    
    function code(x, y, z)
    	t_0 = Float64(sin(y) * Float64(-z))
    	tmp = 0.0
    	if (z <= -1.1e+159)
    		tmp = t_0;
    	elseif (z <= 3.8e+110)
    		tmp = Float64(x + cos(y));
    	else
    		tmp = t_0;
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z)
    	t_0 = sin(y) * -z;
    	tmp = 0.0;
    	if (z <= -1.1e+159)
    		tmp = t_0;
    	elseif (z <= 3.8e+110)
    		tmp = x + cos(y);
    	else
    		tmp = t_0;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_] := Block[{t$95$0 = N[(N[Sin[y], $MachinePrecision] * (-z)), $MachinePrecision]}, If[LessEqual[z, -1.1e+159], t$95$0, If[LessEqual[z, 3.8e+110], N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision], t$95$0]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \sin y \cdot \left(-z\right)\\
    \mathbf{if}\;z \leq -1.1 \cdot 10^{+159}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;z \leq 3.8 \cdot 10^{+110}:\\
    \;\;\;\;x + \cos y\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if z < -1.1e159 or 3.79999999999999989e110 < z

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

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

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

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

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

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

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

      if -1.1e159 < z < 3.79999999999999989e110

      1. Initial program 100.0%

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

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

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

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

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

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

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

    Alternative 7: 80.6% accurate, 1.8× speedup?

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

      1. Initial program 99.9%

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

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

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

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

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

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

      if -3.2e9 < y < 2.6e9

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{1 \cdot x + \frac{1 - z \cdot \sin y}{x} \cdot x} \]
        4. *-lft-identityN/A

          \[\leadsto \color{blue}{x} + \frac{1 - z \cdot \sin y}{x} \cdot x \]
        5. *-lft-identityN/A

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

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

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

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

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

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

          \[\leadsto x + \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \cdot \left(-1 \cdot \frac{1 - z \cdot \sin y}{x}\right) \]
        12. distribute-lft-neg-outN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 8: 68.8% accurate, 3.7× speedup?

    \[\begin{array}{l} \\ \mathsf{fma}\left(\frac{y}{-1 + \frac{y \cdot \mathsf{fma}\left(\frac{y}{z}, -0.25, 0.5\right)}{z}}, z, x + 1\right) \end{array} \]
    (FPCore (x y z)
     :precision binary64
     (fma (/ y (+ -1.0 (/ (* y (fma (/ y z) -0.25 0.5)) z))) z (+ x 1.0)))
    double code(double x, double y, double z) {
    	return fma((y / (-1.0 + ((y * fma((y / z), -0.25, 0.5)) / z))), z, (x + 1.0));
    }
    
    function code(x, y, z)
    	return fma(Float64(y / Float64(-1.0 + Float64(Float64(y * fma(Float64(y / z), -0.25, 0.5)) / z))), z, Float64(x + 1.0))
    end
    
    code[x_, y_, z_] := N[(N[(y / N[(-1.0 + N[(N[(y * N[(N[(y / z), $MachinePrecision] * -0.25 + 0.5), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * z + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    \mathsf{fma}\left(\frac{y}{-1 + \frac{y \cdot \mathsf{fma}\left(\frac{y}{z}, -0.25, 0.5\right)}{z}}, z, x + 1\right)
    \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 + \left(x + y \cdot \left(\frac{-1}{2} \cdot y - z\right)\right)} \]
    4. Step-by-step derivation
      1. associate-+r+N/A

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, y \cdot -0.5 - z, x + 1\right)} \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(y, \frac{1}{\color{blue}{\frac{-1 + \frac{\mathsf{fma}\left(y \cdot \frac{y}{z}, -0.25, y \cdot 0.5\right)}{z}}{z}}}, x + 1\right) \]
    10. Step-by-step derivation
      1. Applied rewrites65.5%

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{-1 + \frac{y \cdot \mathsf{fma}\left(\frac{y}{z}, -0.25, 0.5\right)}{z}}, z, x + 1\right)} \]
      2. Add Preprocessing

      Alternative 9: 70.0% accurate, 4.3× speedup?

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

        1. Initial program 99.9%

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

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

            \[\leadsto \color{blue}{x + 1} \]
          2. lower-+.f6433.0

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

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

        if -1.35e17 < y < 1.55e10

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{1 \cdot x + \frac{1 - z \cdot \sin y}{x} \cdot x} \]
          4. *-lft-identityN/A

            \[\leadsto \color{blue}{x} + \frac{1 - z \cdot \sin y}{x} \cdot x \]
          5. *-lft-identityN/A

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

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

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

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

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

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

            \[\leadsto x + \color{blue}{\left(\mathsf{neg}\left(x\right)\right)} \cdot \left(-1 \cdot \frac{1 - z \cdot \sin y}{x}\right) \]
          12. distribute-lft-neg-outN/A

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

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

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

            \[\leadsto x - \color{blue}{\left(x \cdot -1\right) \cdot \frac{1 - z \cdot \sin y}{x}} \]
        8. Applied rewrites97.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto x - \mathsf{fma}\left(y, \mathsf{fma}\left(y \cdot y, z \cdot \mathsf{fma}\left(\color{blue}{y \cdot y}, 0.008333333333333333, -0.16666666666666666\right), z\right), -1\right) \]
        11. Applied rewrites97.9%

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

      Alternative 10: 69.9% accurate, 5.2× speedup?

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

        1. Initial program 99.9%

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

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

            \[\leadsto \color{blue}{x + 1} \]
          2. lower-+.f6432.7

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

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

        if -2.05e17 < y < 7.4999999999999998e28

        1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 11: 70.0% accurate, 5.6× speedup?

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

        1. Initial program 99.9%

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

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

            \[\leadsto \color{blue}{x + 1} \]
          2. lower-+.f6433.3

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

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

        if -6.4000000000000004 < y < 35000

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 12: 68.7% accurate, 7.1× speedup?

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

        1. Initial program 99.9%

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

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

            \[\leadsto \color{blue}{x + 1} \]
          2. lower-+.f6434.7

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

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

        if -1.6e17 < y < 5.80000000000000032e118

        1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

      Alternative 13: 69.4% accurate, 9.6× speedup?

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

        1. Initial program 99.9%

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

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

            \[\leadsto \color{blue}{x + 1} \]
          2. lower-+.f6438.0

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

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

        if -2.90000000000000017e78 < y < 5.80000000000000032e118

        1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

      Alternative 14: 66.4% accurate, 10.1× speedup?

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

            \[\leadsto \color{blue}{x + 1} \]
          2. lower-+.f6477.9

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

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

        if -1.1200000000000001e-11 < x < 1.1e22

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

            \[\leadsto \color{blue}{\cos y - z \cdot \sin y} \]
          2. lower-cos.f64N/A

            \[\leadsto \color{blue}{\cos y} - z \cdot \sin y \]
          3. lower-*.f64N/A

            \[\leadsto \cos y - \color{blue}{z \cdot \sin y} \]
          4. lower-sin.f6498.1

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

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

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

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

            \[\leadsto \color{blue}{1 - y \cdot z} \]
          3. lower--.f64N/A

            \[\leadsto \color{blue}{1 - y \cdot z} \]
          4. *-commutativeN/A

            \[\leadsto 1 - \color{blue}{z \cdot y} \]
          5. lower-*.f6448.8

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

          \[\leadsto \color{blue}{1 - z \cdot y} \]
      3. Recombined 2 regimes into one program.
      4. Final simplification62.6%

        \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.12 \cdot 10^{-11}:\\ \;\;\;\;x + 1\\ \mathbf{elif}\;x \leq 1.1 \cdot 10^{+22}:\\ \;\;\;\;1 - y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x + 1\\ \end{array} \]
      5. Add Preprocessing

      Alternative 15: 61.7% accurate, 15.1× speedup?

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

        1. Initial program 99.9%

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

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

            \[\leadsto \color{blue}{x + 1} \]
          2. lower-+.f6459.8

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

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

        if 2.5e261 < z

        1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 16: 61.2% accurate, 53.0× speedup?

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

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

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

          \[\leadsto \color{blue}{x + 1} \]
        2. lower-+.f6457.4

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

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

      Alternative 17: 22.3% accurate, 212.0× speedup?

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

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

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

          \[\leadsto \color{blue}{x + 1} \]
        2. lower-+.f6457.4

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

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

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

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

        Reproduce

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