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

Percentage Accurate: 99.9% → 99.9%
Time: 7.1s
Alternatives: 12
Speedup: 1.0×

Specification

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

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

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

Alternative 1: 99.9% accurate, 1.0× speedup?

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

\\
\mathsf{fma}\left(\cos y, z, \sin y + x\right)
\end{array}
Derivation
  1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

Alternative 2: 94.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -5.6 \cdot 10^{-37} \lor \neg \left(x \leq 1.5 \cdot 10^{-59}\right):\\ \;\;\;\;\mathsf{fma}\left(\frac{\cos y \cdot z}{x}, x, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\cos y, z, \sin y\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= x -5.6e-37) (not (<= x 1.5e-59)))
   (fma (/ (* (cos y) z) x) x x)
   (fma (cos y) z (sin y))))
double code(double x, double y, double z) {
	double tmp;
	if ((x <= -5.6e-37) || !(x <= 1.5e-59)) {
		tmp = fma(((cos(y) * z) / x), x, x);
	} else {
		tmp = fma(cos(y), z, sin(y));
	}
	return tmp;
}
function code(x, y, z)
	tmp = 0.0
	if ((x <= -5.6e-37) || !(x <= 1.5e-59))
		tmp = fma(Float64(Float64(cos(y) * z) / x), x, x);
	else
		tmp = fma(cos(y), z, sin(y));
	end
	return tmp
end
code[x_, y_, z_] := If[Or[LessEqual[x, -5.6e-37], N[Not[LessEqual[x, 1.5e-59]], $MachinePrecision]], N[(N[(N[(N[Cos[y], $MachinePrecision] * z), $MachinePrecision] / x), $MachinePrecision] * x + x), $MachinePrecision], N[(N[Cos[y], $MachinePrecision] * z + N[Sin[y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.6 \cdot 10^{-37} \lor \neg \left(x \leq 1.5 \cdot 10^{-59}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{\cos y \cdot z}{x}, x, x\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\cos y, z, \sin y\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.6000000000000002e-37 or 1.5e-59 < x

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sin y + z \cdot \cos y}{x} \cdot x + \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(x\right)\right)}\right)\right) \]
      12. remove-double-negN/A

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

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

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

      \[\leadsto \mathsf{fma}\left(\frac{z \cdot \cos y}{x}, x, x\right) \]
    9. Step-by-step derivation
      1. Applied rewrites97.6%

        \[\leadsto \mathsf{fma}\left(\frac{\cos y \cdot z}{x}, x, x\right) \]

      if -5.6000000000000002e-37 < x < 1.5e-59

      1. Initial program 99.9%

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

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

          \[\leadsto \color{blue}{z \cdot \cos y + \sin y} \]
        2. *-commutativeN/A

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\cos y, z, \sin y\right)} \]
    10. Recombined 2 regimes into one program.
    11. Final simplification97.3%

      \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5.6 \cdot 10^{-37} \lor \neg \left(x \leq 1.5 \cdot 10^{-59}\right):\\ \;\;\;\;\mathsf{fma}\left(\frac{\cos y \cdot z}{x}, x, x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\cos y, z, \sin y\right)\\ \end{array} \]
    12. Add Preprocessing

    Alternative 3: 84.2% accurate, 1.7× speedup?

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

      1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(\frac{z \cdot \cos y}{x} + 1\right) \cdot x + \sin y \cdot \color{blue}{1} \]
        8. rgt-mult-inverseN/A

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{\color{blue}{\cos y}}{x}, z, 1\right), x, z \cdot \frac{\sin y}{z}\right) \]
      7. Applied rewrites68.5%

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

        \[\leadsto z \cdot \color{blue}{\cos y} \]
      9. Step-by-step derivation
        1. Applied rewrites84.4%

          \[\leadsto \cos y \cdot \color{blue}{z} \]

        if -24 < z < 7.99999999999999964e-57

        1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(\frac{z \cdot \cos y}{x} + 1\right) \cdot x + \sin y \cdot \color{blue}{1} \]
          8. rgt-mult-inverseN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(1, x, \sin y\right) \]
        9. Step-by-step derivation
          1. Applied rewrites94.3%

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

          if 7.99999999999999964e-57 < z < 3.4999999999999998e133

          1. Initial program 99.9%

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

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

              \[\leadsto \color{blue}{z + x} \]
            2. lower-+.f6484.3

              \[\leadsto \color{blue}{z + x} \]
          5. Applied rewrites84.3%

            \[\leadsto \color{blue}{z + x} \]
        10. Recombined 3 regimes into one program.
        11. Final simplification88.9%

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

        Alternative 4: 89.5% accurate, 1.7× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.7 \cdot 10^{+56} \lor \neg \left(z \leq 3.5 \cdot 10^{+133}\right):\\ \;\;\;\;\cos y \cdot z\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(1, z, \sin y + x\right)\\ \end{array} \end{array} \]
        (FPCore (x y z)
         :precision binary64
         (if (or (<= z -3.7e+56) (not (<= z 3.5e+133)))
           (* (cos y) z)
           (fma 1.0 z (+ (sin y) x))))
        double code(double x, double y, double z) {
        	double tmp;
        	if ((z <= -3.7e+56) || !(z <= 3.5e+133)) {
        		tmp = cos(y) * z;
        	} else {
        		tmp = fma(1.0, z, (sin(y) + x));
        	}
        	return tmp;
        }
        
        function code(x, y, z)
        	tmp = 0.0
        	if ((z <= -3.7e+56) || !(z <= 3.5e+133))
        		tmp = Float64(cos(y) * z);
        	else
        		tmp = fma(1.0, z, Float64(sin(y) + x));
        	end
        	return tmp
        end
        
        code[x_, y_, z_] := If[Or[LessEqual[z, -3.7e+56], N[Not[LessEqual[z, 3.5e+133]], $MachinePrecision]], N[(N[Cos[y], $MachinePrecision] * z), $MachinePrecision], N[(1.0 * z + N[(N[Sin[y], $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;z \leq -3.7 \cdot 10^{+56} \lor \neg \left(z \leq 3.5 \cdot 10^{+133}\right):\\
        \;\;\;\;\cos y \cdot z\\
        
        \mathbf{else}:\\
        \;\;\;\;\mathsf{fma}\left(1, z, \sin y + x\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if z < -3.69999999999999997e56 or 3.4999999999999998e133 < z

          1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \left(\frac{z \cdot \cos y}{x} + 1\right) \cdot x + \sin y \cdot \color{blue}{1} \]
            8. rgt-mult-inverseN/A

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{\color{blue}{\cos y}}{x}, z, 1\right), x, z \cdot \frac{\sin y}{z}\right) \]
          7. Applied rewrites65.9%

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

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

              \[\leadsto \cos y \cdot \color{blue}{z} \]

            if -3.69999999999999997e56 < z < 3.4999999999999998e133

            1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(\color{blue}{1}, z, \sin y + x\right) \]
            6. Step-by-step derivation
              1. Applied rewrites96.3%

                \[\leadsto \mathsf{fma}\left(\color{blue}{1}, z, \sin y + x\right) \]
            7. Recombined 2 regimes into one program.
            8. Final simplification92.9%

              \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.7 \cdot 10^{+56} \lor \neg \left(z \leq 3.5 \cdot 10^{+133}\right):\\ \;\;\;\;\cos y \cdot z\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(1, z, \sin y + x\right)\\ \end{array} \]
            9. Add Preprocessing

            Alternative 5: 73.1% accurate, 1.8× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.7 \cdot 10^{+56} \lor \neg \left(z \leq 3.5 \cdot 10^{+133}\right):\\ \;\;\;\;\cos y \cdot z\\ \mathbf{else}:\\ \;\;\;\;z + x\\ \end{array} \end{array} \]
            (FPCore (x y z)
             :precision binary64
             (if (or (<= z -3.7e+56) (not (<= z 3.5e+133))) (* (cos y) z) (+ z x)))
            double code(double x, double y, double z) {
            	double tmp;
            	if ((z <= -3.7e+56) || !(z <= 3.5e+133)) {
            		tmp = cos(y) * z;
            	} else {
            		tmp = z + x;
            	}
            	return tmp;
            }
            
            real(8) function code(x, y, z)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                real(8), intent (in) :: z
                real(8) :: tmp
                if ((z <= (-3.7d+56)) .or. (.not. (z <= 3.5d+133))) then
                    tmp = cos(y) * z
                else
                    tmp = z + x
                end if
                code = tmp
            end function
            
            public static double code(double x, double y, double z) {
            	double tmp;
            	if ((z <= -3.7e+56) || !(z <= 3.5e+133)) {
            		tmp = Math.cos(y) * z;
            	} else {
            		tmp = z + x;
            	}
            	return tmp;
            }
            
            def code(x, y, z):
            	tmp = 0
            	if (z <= -3.7e+56) or not (z <= 3.5e+133):
            		tmp = math.cos(y) * z
            	else:
            		tmp = z + x
            	return tmp
            
            function code(x, y, z)
            	tmp = 0.0
            	if ((z <= -3.7e+56) || !(z <= 3.5e+133))
            		tmp = Float64(cos(y) * z);
            	else
            		tmp = Float64(z + x);
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, y, z)
            	tmp = 0.0;
            	if ((z <= -3.7e+56) || ~((z <= 3.5e+133)))
            		tmp = cos(y) * z;
            	else
            		tmp = z + x;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, y_, z_] := If[Or[LessEqual[z, -3.7e+56], N[Not[LessEqual[z, 3.5e+133]], $MachinePrecision]], N[(N[Cos[y], $MachinePrecision] * z), $MachinePrecision], N[(z + x), $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;z \leq -3.7 \cdot 10^{+56} \lor \neg \left(z \leq 3.5 \cdot 10^{+133}\right):\\
            \;\;\;\;\cos y \cdot z\\
            
            \mathbf{else}:\\
            \;\;\;\;z + x\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if z < -3.69999999999999997e56 or 3.4999999999999998e133 < z

              1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(\frac{z \cdot \cos y}{x} + 1\right) \cdot x + \sin y \cdot \color{blue}{1} \]
                8. rgt-mult-inverseN/A

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\frac{\color{blue}{\cos y}}{x}, z, 1\right), x, z \cdot \frac{\sin y}{z}\right) \]
              7. Applied rewrites65.9%

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

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

                  \[\leadsto \cos y \cdot \color{blue}{z} \]

                if -3.69999999999999997e56 < z < 3.4999999999999998e133

                1. Initial program 100.0%

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

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

                    \[\leadsto \color{blue}{z + x} \]
                  2. lower-+.f6474.9

                    \[\leadsto \color{blue}{z + x} \]
                5. Applied rewrites74.9%

                  \[\leadsto \color{blue}{z + x} \]
              10. Recombined 2 regimes into one program.
              11. Final simplification78.9%

                \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.7 \cdot 10^{+56} \lor \neg \left(z \leq 3.5 \cdot 10^{+133}\right):\\ \;\;\;\;\cos y \cdot z\\ \mathbf{else}:\\ \;\;\;\;z + x\\ \end{array} \]
              12. Add Preprocessing

              Alternative 6: 69.8% accurate, 3.9× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.25 \cdot 10^{+33} \lor \neg \left(y \leq 29000\right):\\ \;\;\;\;z + x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(y \cdot y, -0.001388888888888889, 0.041666666666666664\right), y \cdot y, -0.5\right), y \cdot y, 1\right), z, x + y\right)\\ \end{array} \end{array} \]
              (FPCore (x y z)
               :precision binary64
               (if (or (<= y -1.25e+33) (not (<= y 29000.0)))
                 (+ z x)
                 (fma
                  (fma
                   (fma
                    (fma (* y y) -0.001388888888888889 0.041666666666666664)
                    (* y y)
                    -0.5)
                   (* y y)
                   1.0)
                  z
                  (+ x y))))
              double code(double x, double y, double z) {
              	double tmp;
              	if ((y <= -1.25e+33) || !(y <= 29000.0)) {
              		tmp = z + x;
              	} else {
              		tmp = fma(fma(fma(fma((y * y), -0.001388888888888889, 0.041666666666666664), (y * y), -0.5), (y * y), 1.0), z, (x + y));
              	}
              	return tmp;
              }
              
              function code(x, y, z)
              	tmp = 0.0
              	if ((y <= -1.25e+33) || !(y <= 29000.0))
              		tmp = Float64(z + x);
              	else
              		tmp = fma(fma(fma(fma(Float64(y * y), -0.001388888888888889, 0.041666666666666664), Float64(y * y), -0.5), Float64(y * y), 1.0), z, Float64(x + y));
              	end
              	return tmp
              end
              
              code[x_, y_, z_] := If[Or[LessEqual[y, -1.25e+33], N[Not[LessEqual[y, 29000.0]], $MachinePrecision]], N[(z + x), $MachinePrecision], N[(N[(N[(N[(N[(y * y), $MachinePrecision] * -0.001388888888888889 + 0.041666666666666664), $MachinePrecision] * N[(y * y), $MachinePrecision] + -0.5), $MachinePrecision] * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision] * z + N[(x + y), $MachinePrecision]), $MachinePrecision]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;y \leq -1.25 \cdot 10^{+33} \lor \neg \left(y \leq 29000\right):\\
              \;\;\;\;z + x\\
              
              \mathbf{else}:\\
              \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(y \cdot y, -0.001388888888888889, 0.041666666666666664\right), y \cdot y, -0.5\right), y \cdot y, 1\right), z, x + y\right)\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if y < -1.24999999999999993e33 or 29000 < y

                1. Initial program 99.9%

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

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

                    \[\leadsto \color{blue}{z + x} \]
                  2. lower-+.f6443.5

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

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

                if -1.24999999999999993e33 < y < 29000

                1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.25 \cdot 10^{+33} \lor \neg \left(y \leq 29000\right):\\ \;\;\;\;z + x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(y \cdot y, -0.001388888888888889, 0.041666666666666664\right), y \cdot y, -0.5\right), y \cdot y, 1\right), z, x + y\right)\\ \end{array} \]
              5. Add Preprocessing

              Alternative 7: 69.8% accurate, 5.4× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.25 \cdot 10^{+33} \lor \neg \left(y \leq 29000\right):\\ \;\;\;\;z + x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, y, -0.5 \cdot z\right), y, 1\right), y, z + x\right)\\ \end{array} \end{array} \]
              (FPCore (x y z)
               :precision binary64
               (if (or (<= y -1.25e+33) (not (<= y 29000.0)))
                 (+ z x)
                 (fma (fma (fma -0.16666666666666666 y (* -0.5 z)) y 1.0) y (+ z x))))
              double code(double x, double y, double z) {
              	double tmp;
              	if ((y <= -1.25e+33) || !(y <= 29000.0)) {
              		tmp = z + x;
              	} else {
              		tmp = fma(fma(fma(-0.16666666666666666, y, (-0.5 * z)), y, 1.0), y, (z + x));
              	}
              	return tmp;
              }
              
              function code(x, y, z)
              	tmp = 0.0
              	if ((y <= -1.25e+33) || !(y <= 29000.0))
              		tmp = Float64(z + x);
              	else
              		tmp = fma(fma(fma(-0.16666666666666666, y, Float64(-0.5 * z)), y, 1.0), y, Float64(z + x));
              	end
              	return tmp
              end
              
              code[x_, y_, z_] := If[Or[LessEqual[y, -1.25e+33], N[Not[LessEqual[y, 29000.0]], $MachinePrecision]], N[(z + x), $MachinePrecision], N[(N[(N[(-0.16666666666666666 * y + N[(-0.5 * z), $MachinePrecision]), $MachinePrecision] * y + 1.0), $MachinePrecision] * y + N[(z + x), $MachinePrecision]), $MachinePrecision]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;y \leq -1.25 \cdot 10^{+33} \lor \neg \left(y \leq 29000\right):\\
              \;\;\;\;z + x\\
              
              \mathbf{else}:\\
              \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, y, -0.5 \cdot z\right), y, 1\right), y, z + x\right)\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if y < -1.24999999999999993e33 or 29000 < y

                1. Initial program 99.9%

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

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

                    \[\leadsto \color{blue}{z + x} \]
                  2. lower-+.f6443.5

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

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

                if -1.24999999999999993e33 < y < 29000

                1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.25 \cdot 10^{+33} \lor \neg \left(y \leq 29000\right):\\ \;\;\;\;z + x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, y, -0.5 \cdot z\right), y, 1\right), y, z + x\right)\\ \end{array} \]
              5. Add Preprocessing

              Alternative 8: 69.8% accurate, 6.4× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.6 \cdot 10^{+34} \lor \neg \left(y \leq 29000\right):\\ \;\;\;\;z + x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z, 1\right), y, z + x\right)\\ \end{array} \end{array} \]
              (FPCore (x y z)
               :precision binary64
               (if (or (<= y -1.6e+34) (not (<= y 29000.0)))
                 (+ z x)
                 (fma (fma (* -0.5 y) z 1.0) y (+ z x))))
              double code(double x, double y, double z) {
              	double tmp;
              	if ((y <= -1.6e+34) || !(y <= 29000.0)) {
              		tmp = z + x;
              	} else {
              		tmp = fma(fma((-0.5 * y), z, 1.0), y, (z + x));
              	}
              	return tmp;
              }
              
              function code(x, y, z)
              	tmp = 0.0
              	if ((y <= -1.6e+34) || !(y <= 29000.0))
              		tmp = Float64(z + x);
              	else
              		tmp = fma(fma(Float64(-0.5 * y), z, 1.0), y, Float64(z + x));
              	end
              	return tmp
              end
              
              code[x_, y_, z_] := If[Or[LessEqual[y, -1.6e+34], N[Not[LessEqual[y, 29000.0]], $MachinePrecision]], N[(z + x), $MachinePrecision], N[(N[(N[(-0.5 * y), $MachinePrecision] * z + 1.0), $MachinePrecision] * y + N[(z + x), $MachinePrecision]), $MachinePrecision]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;y \leq -1.6 \cdot 10^{+34} \lor \neg \left(y \leq 29000\right):\\
              \;\;\;\;z + x\\
              
              \mathbf{else}:\\
              \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z, 1\right), y, z + x\right)\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if y < -1.5999999999999999e34 or 29000 < y

                1. Initial program 99.9%

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

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

                    \[\leadsto \color{blue}{z + x} \]
                  2. lower-+.f6443.5

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

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

                if -1.5999999999999999e34 < y < 29000

                1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.6 \cdot 10^{+34} \lor \neg \left(y \leq 29000\right):\\ \;\;\;\;z + x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-0.5 \cdot y, z, 1\right), y, z + x\right)\\ \end{array} \]
              5. Add Preprocessing

              Alternative 9: 69.9% accurate, 6.4× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -110000000000 \lor \neg \left(y \leq 5000\right):\\ \;\;\;\;z + x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666 \cdot y, y, 1\right), y, z + x\right)\\ \end{array} \end{array} \]
              (FPCore (x y z)
               :precision binary64
               (if (or (<= y -110000000000.0) (not (<= y 5000.0)))
                 (+ z x)
                 (fma (fma (* -0.16666666666666666 y) y 1.0) y (+ z x))))
              double code(double x, double y, double z) {
              	double tmp;
              	if ((y <= -110000000000.0) || !(y <= 5000.0)) {
              		tmp = z + x;
              	} else {
              		tmp = fma(fma((-0.16666666666666666 * y), y, 1.0), y, (z + x));
              	}
              	return tmp;
              }
              
              function code(x, y, z)
              	tmp = 0.0
              	if ((y <= -110000000000.0) || !(y <= 5000.0))
              		tmp = Float64(z + x);
              	else
              		tmp = fma(fma(Float64(-0.16666666666666666 * y), y, 1.0), y, Float64(z + x));
              	end
              	return tmp
              end
              
              code[x_, y_, z_] := If[Or[LessEqual[y, -110000000000.0], N[Not[LessEqual[y, 5000.0]], $MachinePrecision]], N[(z + x), $MachinePrecision], N[(N[(N[(-0.16666666666666666 * y), $MachinePrecision] * y + 1.0), $MachinePrecision] * y + N[(z + x), $MachinePrecision]), $MachinePrecision]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;y \leq -110000000000 \lor \neg \left(y \leq 5000\right):\\
              \;\;\;\;z + x\\
              
              \mathbf{else}:\\
              \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666 \cdot y, y, 1\right), y, z + x\right)\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if y < -1.1e11 or 5e3 < y

                1. Initial program 99.9%

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

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

                    \[\leadsto \color{blue}{z + x} \]
                  2. lower-+.f6442.9

                    \[\leadsto \color{blue}{z + x} \]
                5. Applied rewrites42.9%

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

                if -1.1e11 < y < 5e3

                1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666 \cdot y, y, 1\right), y, z + x\right) \]
                8. Recombined 2 regimes into one program.
                9. Final simplification71.0%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -110000000000 \lor \neg \left(y \leq 5000\right):\\ \;\;\;\;z + x\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666 \cdot y, y, 1\right), y, z + x\right)\\ \end{array} \]
                10. Add Preprocessing

                Alternative 10: 69.8% accurate, 11.1× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -9.2 \cdot 10^{+32} \lor \neg \left(y \leq 1.05 \cdot 10^{+28}\right):\\ \;\;\;\;z + x\\ \mathbf{else}:\\ \;\;\;\;\left(y + x\right) + z\\ \end{array} \end{array} \]
                (FPCore (x y z)
                 :precision binary64
                 (if (or (<= y -9.2e+32) (not (<= y 1.05e+28))) (+ z x) (+ (+ y x) z)))
                double code(double x, double y, double z) {
                	double tmp;
                	if ((y <= -9.2e+32) || !(y <= 1.05e+28)) {
                		tmp = z + x;
                	} else {
                		tmp = (y + x) + 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 ((y <= (-9.2d+32)) .or. (.not. (y <= 1.05d+28))) then
                        tmp = z + x
                    else
                        tmp = (y + x) + z
                    end if
                    code = tmp
                end function
                
                public static double code(double x, double y, double z) {
                	double tmp;
                	if ((y <= -9.2e+32) || !(y <= 1.05e+28)) {
                		tmp = z + x;
                	} else {
                		tmp = (y + x) + z;
                	}
                	return tmp;
                }
                
                def code(x, y, z):
                	tmp = 0
                	if (y <= -9.2e+32) or not (y <= 1.05e+28):
                		tmp = z + x
                	else:
                		tmp = (y + x) + z
                	return tmp
                
                function code(x, y, z)
                	tmp = 0.0
                	if ((y <= -9.2e+32) || !(y <= 1.05e+28))
                		tmp = Float64(z + x);
                	else
                		tmp = Float64(Float64(y + x) + z);
                	end
                	return tmp
                end
                
                function tmp_2 = code(x, y, z)
                	tmp = 0.0;
                	if ((y <= -9.2e+32) || ~((y <= 1.05e+28)))
                		tmp = z + x;
                	else
                		tmp = (y + x) + z;
                	end
                	tmp_2 = tmp;
                end
                
                code[x_, y_, z_] := If[Or[LessEqual[y, -9.2e+32], N[Not[LessEqual[y, 1.05e+28]], $MachinePrecision]], N[(z + x), $MachinePrecision], N[(N[(y + x), $MachinePrecision] + z), $MachinePrecision]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;y \leq -9.2 \cdot 10^{+32} \lor \neg \left(y \leq 1.05 \cdot 10^{+28}\right):\\
                \;\;\;\;z + x\\
                
                \mathbf{else}:\\
                \;\;\;\;\left(y + x\right) + z\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if y < -9.1999999999999998e32 or 1.04999999999999995e28 < y

                  1. Initial program 99.9%

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

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

                      \[\leadsto \color{blue}{z + x} \]
                    2. lower-+.f6442.5

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

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

                  if -9.1999999999999998e32 < y < 1.04999999999999995e28

                  1. Initial program 100.0%

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

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

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

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

                      \[\leadsto \color{blue}{\left(y + x\right)} + z \]
                    4. lower-+.f6493.6

                      \[\leadsto \color{blue}{\left(y + x\right)} + z \]
                  5. Applied rewrites93.6%

                    \[\leadsto \color{blue}{\left(y + x\right) + z} \]
                3. Recombined 2 regimes into one program.
                4. Final simplification71.0%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9.2 \cdot 10^{+32} \lor \neg \left(y \leq 1.05 \cdot 10^{+28}\right):\\ \;\;\;\;z + x\\ \mathbf{else}:\\ \;\;\;\;\left(y + x\right) + z\\ \end{array} \]
                5. Add Preprocessing

                Alternative 11: 65.6% accurate, 53.0× speedup?

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

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

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

                    \[\leadsto \color{blue}{z + x} \]
                  2. lower-+.f6467.2

                    \[\leadsto \color{blue}{z + x} \]
                5. Applied rewrites67.2%

                  \[\leadsto \color{blue}{z + x} \]
                6. Final simplification67.2%

                  \[\leadsto z + x \]
                7. Add Preprocessing

                Alternative 12: 29.5% accurate, 53.0× speedup?

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

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

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

                    \[\leadsto \color{blue}{z \cdot \cos y + \sin y} \]
                  2. *-commutativeN/A

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

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

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

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

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

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

                    \[\leadsto z + \color{blue}{y} \]
                  2. Final simplification27.6%

                    \[\leadsto z + y \]
                  3. Add Preprocessing

                  Reproduce

                  ?
                  herbie shell --seed 2024321 
                  (FPCore (x y z)
                    :name "Graphics.Rasterific.Svg.PathConverter:segmentToBezier from rasterific-svg-0.2.3.1, C"
                    :precision binary64
                    (+ (+ x (sin y)) (* z (cos y))))