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

Percentage Accurate: 99.9% → 99.9%
Time: 12.4s
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, 0.3× speedup?

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

\\
\begin{array}{l}
t_0 := x + \mathsf{fma}\left(z, \sin y, \cos y\right)\\
t\_0 \cdot \frac{x + \left(\cos y - z \cdot \sin y\right)}{t\_0}
\end{array}
\end{array}
Derivation
  1. Initial program 99.9%

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

      \[\leadsto \color{blue}{\left(x + \cos y\right) - z \cdot \sin y} \]
    2. 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. difference-of-squaresN/A

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\left(x + \mathsf{fma}\left(z, \sin y, \cos y\right)\right) \cdot \frac{x + \left(\cos y - z \cdot \sin y\right)}{x + \mathsf{fma}\left(z, \sin y, \cos y\right)}} \]
  5. Add Preprocessing

Alternative 2: 98.4% 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 + \left(-t\_1\right)\\ \mathbf{if}\;t\_2 \leq -40000000000:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+15}:\\ \;\;\;\;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 -40000000000.0) t_3 (if (<= t_2 5e+15) 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 <= -40000000000.0) {
		tmp = t_3;
	} else if (t_2 <= 5e+15) {
		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 <= (-40000000000.0d0)) then
        tmp = t_3
    else if (t_2 <= 5d+15) 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 <= -40000000000.0) {
		tmp = t_3;
	} else if (t_2 <= 5e+15) {
		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 <= -40000000000.0:
		tmp = t_3
	elif t_2 <= 5e+15:
		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 + Float64(-t_1))
	tmp = 0.0
	if (t_2 <= -40000000000.0)
		tmp = t_3;
	elseif (t_2 <= 5e+15)
		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 <= -40000000000.0)
		tmp = t_3;
	elseif (t_2 <= 5e+15)
		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, -40000000000.0], t$95$3, If[LessEqual[t$95$2, 5e+15], 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 + \left(-t\_1\right)\\
\mathbf{if}\;t\_2 \leq -40000000000:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+15}:\\
\;\;\;\;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))) < -4e10 or 5e15 < (-.f64 (+.f64 x (cos.f64 y)) (*.f64 z (sin.f64 y)))

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{x \cdot \frac{\cos y - z \cdot \sin y}{x}} \]
      7. lower-/.f64N/A

        \[\leadsto x + x \cdot \color{blue}{\frac{\cos y - z \cdot \sin y}{x}} \]
      8. lower--.f64N/A

        \[\leadsto x + x \cdot \frac{\color{blue}{\cos y - z \cdot \sin y}}{x} \]
      9. lower-cos.f64N/A

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

        \[\leadsto x + x \cdot \frac{\cos y - \color{blue}{z \cdot \sin y}}{x} \]
      11. lower-sin.f6482.8

        \[\leadsto x + x \cdot \frac{\cos y - z \cdot \color{blue}{\sin y}}{x} \]
    7. Applied rewrites82.8%

      \[\leadsto \color{blue}{x + x \cdot \frac{\cos y - z \cdot \sin y}{x}} \]
    8. Taylor expanded in z around inf

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

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

      if -4e10 < (-.f64 (+.f64 x (cos.f64 y)) (*.f64 z (sin.f64 y))) < 5e15

      1. Initial program 100.0%

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

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

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

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

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

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

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

    Alternative 3: 99.9% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

    Alternative 4: 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 5: 97.7% accurate, 1.7× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -8.8 \cdot 10^{+74}:\\ \;\;\;\;\left(x + 1\right) - z \cdot \sin y\\ \mathbf{elif}\;z \leq 0.92:\\ \;\;\;\;x + \cos y\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\sin y, -z, x + 1\right)\\ \end{array} \end{array} \]
    (FPCore (x y z)
     :precision binary64
     (if (<= z -8.8e+74)
       (- (+ x 1.0) (* z (sin y)))
       (if (<= z 0.92) (+ x (cos y)) (fma (sin y) (- z) (+ x 1.0)))))
    double code(double x, double y, double z) {
    	double tmp;
    	if (z <= -8.8e+74) {
    		tmp = (x + 1.0) - (z * sin(y));
    	} else if (z <= 0.92) {
    		tmp = x + cos(y);
    	} else {
    		tmp = fma(sin(y), -z, (x + 1.0));
    	}
    	return tmp;
    }
    
    function code(x, y, z)
    	tmp = 0.0
    	if (z <= -8.8e+74)
    		tmp = Float64(Float64(x + 1.0) - Float64(z * sin(y)));
    	elseif (z <= 0.92)
    		tmp = Float64(x + cos(y));
    	else
    		tmp = fma(sin(y), Float64(-z), Float64(x + 1.0));
    	end
    	return tmp
    end
    
    code[x_, y_, z_] := If[LessEqual[z, -8.8e+74], N[(N[(x + 1.0), $MachinePrecision] - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.92], N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision], N[(N[Sin[y], $MachinePrecision] * (-z) + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;z \leq -8.8 \cdot 10^{+74}:\\
    \;\;\;\;\left(x + 1\right) - z \cdot \sin y\\
    
    \mathbf{elif}\;z \leq 0.92:\\
    \;\;\;\;x + \cos y\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(\sin y, -z, x + 1\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if z < -8.8000000000000005e74

      1. Initial program 99.8%

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

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

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

        if -8.8000000000000005e74 < z < 0.92000000000000004

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

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

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

        if 0.92000000000000004 < z

        1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 6: 97.7% accurate, 1.7× speedup?

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

          1. Initial program 99.8%

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

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

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

            if -8.8000000000000005e74 < z < 0.92000000000000004

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

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

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

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

          Alternative 7: 82.3% accurate, 1.8× speedup?

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

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

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

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

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

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

            if -2.1999999999999999e131 < z < 3.00000000000000007e110

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

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

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

            \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.2 \cdot 10^{+131}:\\ \;\;\;\;-z \cdot \sin y\\ \mathbf{elif}\;z \leq 3 \cdot 10^{+110}:\\ \;\;\;\;x + \cos y\\ \mathbf{else}:\\ \;\;\;\;-z \cdot \sin y\\ \end{array} \]
          5. Add Preprocessing

          Alternative 8: 80.4% accurate, 1.8× speedup?

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

            1. Initial program 99.8%

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

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

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

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

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

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

            if -0.029999999999999999 < y < 3.5999999999999998e-22

            1. Initial program 100.0%

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

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

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

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

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

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

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

                  \[\leadsto \left(x + 1\right) - y \cdot \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) \]
                5. lower-*.f64N/A

                  \[\leadsto \left(x + 1\right) - y \cdot \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) \]
                6. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(x + 1\right) - y \cdot \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) \]
                17. lower-*.f64100.0

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

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

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

            Alternative 9: 68.7% accurate, 5.2× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -8 \cdot 10^{+83}:\\ \;\;\;\;x + x \cdot \frac{1}{x}\\ \mathbf{elif}\;y \leq 4.1 \cdot 10^{+21}:\\ \;\;\;\;1 + \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, z \cdot 0.16666666666666666, -0.5\right), -z\right), x\right)\\ \mathbf{else}:\\ \;\;\;\;x + 1\\ \end{array} \end{array} \]
            (FPCore (x y z)
             :precision binary64
             (if (<= y -8e+83)
               (+ x (* x (/ 1.0 x)))
               (if (<= y 4.1e+21)
                 (+ 1.0 (fma y (fma 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 <= -8e+83) {
            		tmp = x + (x * (1.0 / x));
            	} else if (y <= 4.1e+21) {
            		tmp = 1.0 + fma(y, fma(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 <= -8e+83)
            		tmp = Float64(x + Float64(x * Float64(1.0 / x)));
            	elseif (y <= 4.1e+21)
            		tmp = Float64(1.0 + fma(y, fma(y, fma(y, Float64(z * 0.16666666666666666), -0.5), Float64(-z)), x));
            	else
            		tmp = Float64(x + 1.0);
            	end
            	return tmp
            end
            
            code[x_, y_, z_] := If[LessEqual[y, -8e+83], N[(x + N[(x * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.1e+21], N[(1.0 + N[(y * N[(y * N[(y * N[(z * 0.16666666666666666), $MachinePrecision] + -0.5), $MachinePrecision] + (-z)), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(x + 1.0), $MachinePrecision]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;y \leq -8 \cdot 10^{+83}:\\
            \;\;\;\;x + x \cdot \frac{1}{x}\\
            
            \mathbf{elif}\;y \leq 4.1 \cdot 10^{+21}:\\
            \;\;\;\;1 + \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, z \cdot 0.16666666666666666, -0.5\right), -z\right), x\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;x + 1\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if y < -8.00000000000000025e83

              1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto x + \color{blue}{x \cdot \frac{\cos y - z \cdot \sin y}{x}} \]
                7. lower-/.f64N/A

                  \[\leadsto x + x \cdot \color{blue}{\frac{\cos y - z \cdot \sin y}{x}} \]
                8. lower--.f64N/A

                  \[\leadsto x + x \cdot \frac{\color{blue}{\cos y - z \cdot \sin y}}{x} \]
                9. lower-cos.f64N/A

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

                  \[\leadsto x + x \cdot \frac{\cos y - \color{blue}{z \cdot \sin y}}{x} \]
                11. lower-sin.f6481.2

                  \[\leadsto x + x \cdot \frac{\cos y - z \cdot \color{blue}{\sin y}}{x} \]
              7. Applied rewrites81.2%

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

                \[\leadsto x + x \cdot \frac{1}{\color{blue}{x}} \]
              9. Step-by-step derivation
                1. Applied rewrites45.8%

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

                if -8.00000000000000025e83 < y < 4.1e21

                1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                if 4.1e21 < y

                1. Initial program 99.8%

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

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

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

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

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

              Alternative 10: 68.9% accurate, 5.3× speedup?

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

                1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto x + \color{blue}{x \cdot \frac{\cos y - z \cdot \sin y}{x}} \]
                  7. lower-/.f64N/A

                    \[\leadsto x + x \cdot \color{blue}{\frac{\cos y - z \cdot \sin y}{x}} \]
                  8. lower--.f64N/A

                    \[\leadsto x + x \cdot \frac{\color{blue}{\cos y - z \cdot \sin y}}{x} \]
                  9. lower-cos.f64N/A

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

                    \[\leadsto x + x \cdot \frac{\cos y - \color{blue}{z \cdot \sin y}}{x} \]
                  11. lower-sin.f6481.2

                    \[\leadsto x + x \cdot \frac{\cos y - z \cdot \color{blue}{\sin y}}{x} \]
                7. Applied rewrites81.2%

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

                  \[\leadsto x + x \cdot \frac{1}{\color{blue}{x}} \]
                9. Step-by-step derivation
                  1. Applied rewrites45.8%

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

                  if -8.00000000000000025e83 < y < 3.6e16

                  1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    if 3.6e16 < y

                    1. Initial program 99.8%

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

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

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

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

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

                  Alternative 11: 69.1% accurate, 7.1× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -3.5 \cdot 10^{+64}:\\ \;\;\;\;x + x \cdot \frac{1}{x}\\ \mathbf{elif}\;y \leq 4.1 \cdot 10^{+21}:\\ \;\;\;\;\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 -3.5e+64)
                     (+ x (* x (/ 1.0 x)))
                     (if (<= y 4.1e+21) (fma y (- (* y -0.5) z) (+ x 1.0)) (+ x 1.0))))
                  double code(double x, double y, double z) {
                  	double tmp;
                  	if (y <= -3.5e+64) {
                  		tmp = x + (x * (1.0 / x));
                  	} else if (y <= 4.1e+21) {
                  		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 <= -3.5e+64)
                  		tmp = Float64(x + Float64(x * Float64(1.0 / x)));
                  	elseif (y <= 4.1e+21)
                  		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, -3.5e+64], N[(x + N[(x * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.1e+21], 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 -3.5 \cdot 10^{+64}:\\
                  \;\;\;\;x + x \cdot \frac{1}{x}\\
                  
                  \mathbf{elif}\;y \leq 4.1 \cdot 10^{+21}:\\
                  \;\;\;\;\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 3 regimes
                  2. if y < -3.4999999999999999e64

                    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto x + \color{blue}{x \cdot \frac{\cos y - z \cdot \sin y}{x}} \]
                      7. lower-/.f64N/A

                        \[\leadsto x + x \cdot \color{blue}{\frac{\cos y - z \cdot \sin y}{x}} \]
                      8. lower--.f64N/A

                        \[\leadsto x + x \cdot \frac{\color{blue}{\cos y - z \cdot \sin y}}{x} \]
                      9. lower-cos.f64N/A

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

                        \[\leadsto x + x \cdot \frac{\cos y - \color{blue}{z \cdot \sin y}}{x} \]
                      11. lower-sin.f6478.4

                        \[\leadsto x + x \cdot \frac{\cos y - z \cdot \color{blue}{\sin y}}{x} \]
                    7. Applied rewrites78.4%

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

                      \[\leadsto x + x \cdot \frac{1}{\color{blue}{x}} \]
                    9. Step-by-step derivation
                      1. Applied rewrites42.5%

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

                      if -3.4999999999999999e64 < y < 4.1e21

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

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

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

                      if 4.1e21 < y

                      1. Initial program 99.8%

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

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

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

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

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

                    Alternative 12: 69.1% accurate, 7.1× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -3.5 \cdot 10^{+64}:\\ \;\;\;\;x + 1\\ \mathbf{elif}\;y \leq 4.1 \cdot 10^{+21}:\\ \;\;\;\;\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 -3.5e+64)
                       (+ x 1.0)
                       (if (<= y 4.1e+21) (fma y (- (* y -0.5) z) (+ x 1.0)) (+ x 1.0))))
                    double code(double x, double y, double z) {
                    	double tmp;
                    	if (y <= -3.5e+64) {
                    		tmp = x + 1.0;
                    	} else if (y <= 4.1e+21) {
                    		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 <= -3.5e+64)
                    		tmp = Float64(x + 1.0);
                    	elseif (y <= 4.1e+21)
                    		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, -3.5e+64], N[(x + 1.0), $MachinePrecision], If[LessEqual[y, 4.1e+21], 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 -3.5 \cdot 10^{+64}:\\
                    \;\;\;\;x + 1\\
                    
                    \mathbf{elif}\;y \leq 4.1 \cdot 10^{+21}:\\
                    \;\;\;\;\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 < -3.4999999999999999e64 or 4.1e21 < y

                      1. Initial program 99.8%

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

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

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

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

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

                      if -3.4999999999999999e64 < y < 4.1e21

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

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

                        \[\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: 68.8% accurate, 9.6× speedup?

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

                      1. Initial program 99.8%

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

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

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

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

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

                      if -7.09999999999999982e75 < y < 3.5999999999999998e-22

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

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

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

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

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

                      if -200 < x < 4.9999999999999999e-20

                      1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto 1 - \color{blue}{y \cdot z} \]
                      8. Recombined 2 regimes into one program.
                      9. Final simplification68.4%

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

                      Alternative 15: 61.5% accurate, 15.1× speedup?

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

                        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-+.f6467.9

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

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

                        if 8.4999999999999996e206 < z

                        1. Initial program 99.6%

                          \[\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.f6444.8

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

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

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

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

                        Alternative 16: 61.0% 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-+.f6461.7

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

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

                        Alternative 17: 20.9% 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-+.f6461.7

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

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

                          \[\leadsto 1 \]
                        7. Step-by-step derivation
                          1. Applied rewrites25.3%

                            \[\leadsto 1 \]
                          2. Add Preprocessing

                          Reproduce

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