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

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

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 99.9% accurate, 1.0× speedup?

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

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

Alternative 1: 99.9% accurate, 1.0× speedup?

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

\\
\mathsf{fma}\left(\sin y, -z, \cos y + x\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. lift-*.f64N/A

      \[\leadsto \left(x + \cos y\right) - \color{blue}{z \cdot \sin y} \]
    3. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

Alternative 2: 92.7% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := x + \cos y\\ t_1 := t\_0 - z \cdot \sin y\\ \mathbf{if}\;t\_1 \leq -10000000 \lor \neg \left(t\_1 \leq 0.995\right):\\ \;\;\;\;\mathsf{fma}\left(\sin y, -z, 1 + x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0 - z \cdot y\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (+ x (cos y))) (t_1 (- t_0 (* z (sin y)))))
   (if (or (<= t_1 -10000000.0) (not (<= t_1 0.995)))
     (fma (sin y) (- z) (+ 1.0 x))
     (- t_0 (* z y)))))
double code(double x, double y, double z) {
	double t_0 = x + cos(y);
	double t_1 = t_0 - (z * sin(y));
	double tmp;
	if ((t_1 <= -10000000.0) || !(t_1 <= 0.995)) {
		tmp = fma(sin(y), -z, (1.0 + x));
	} else {
		tmp = t_0 - (z * y);
	}
	return tmp;
}
function code(x, y, z)
	t_0 = Float64(x + cos(y))
	t_1 = Float64(t_0 - Float64(z * sin(y)))
	tmp = 0.0
	if ((t_1 <= -10000000.0) || !(t_1 <= 0.995))
		tmp = fma(sin(y), Float64(-z), Float64(1.0 + x));
	else
		tmp = Float64(t_0 - Float64(z * y));
	end
	return tmp
end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -10000000.0], N[Not[LessEqual[t$95$1, 0.995]], $MachinePrecision]], N[(N[Sin[y], $MachinePrecision] * (-z) + N[(1.0 + x), $MachinePrecision]), $MachinePrecision], N[(t$95$0 - N[(z * y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{else}:\\
\;\;\;\;t\_0 - z \cdot y\\


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

    1. Initial program 99.9%

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

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

        \[\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. lift-*.f64N/A

          \[\leadsto \left(x + 1\right) - \color{blue}{z \cdot \sin y} \]
        3. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

      if -1e7 < (-.f64 (+.f64 x (cos.f64 y)) (*.f64 z (sin.f64 y))) < 0.994999999999999996

      1. Initial program 100.0%

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

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

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;\left(x + \cos y\right) - z \cdot \sin y \leq -10000000 \lor \neg \left(\left(x + \cos y\right) - z \cdot \sin y \leq 0.995\right):\\ \;\;\;\;\mathsf{fma}\left(\sin y, -z, 1 + x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x + \cos y\right) - z \cdot y\\ \end{array} \]
    7. Add Preprocessing

    Alternative 3: 92.7% 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\\ \mathbf{if}\;t\_2 \leq -10000000 \lor \neg \left(t\_2 \leq 0.995\right):\\ \;\;\;\;\left(x + 1\right) - t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_0 - z \cdot y\\ \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)))
       (if (or (<= t_2 -10000000.0) (not (<= t_2 0.995)))
         (- (+ x 1.0) t_1)
         (- t_0 (* z y)))))
    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 tmp;
    	if ((t_2 <= -10000000.0) || !(t_2 <= 0.995)) {
    		tmp = (x + 1.0) - t_1;
    	} else {
    		tmp = t_0 - (z * y);
    	}
    	return tmp;
    }
    
    real(8) function code(x, y, z)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8) :: t_0
        real(8) :: t_1
        real(8) :: t_2
        real(8) :: tmp
        t_0 = x + cos(y)
        t_1 = z * sin(y)
        t_2 = t_0 - t_1
        if ((t_2 <= (-10000000.0d0)) .or. (.not. (t_2 <= 0.995d0))) then
            tmp = (x + 1.0d0) - t_1
        else
            tmp = t_0 - (z * y)
        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 tmp;
    	if ((t_2 <= -10000000.0) || !(t_2 <= 0.995)) {
    		tmp = (x + 1.0) - t_1;
    	} else {
    		tmp = t_0 - (z * y);
    	}
    	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
    	tmp = 0
    	if (t_2 <= -10000000.0) or not (t_2 <= 0.995):
    		tmp = (x + 1.0) - t_1
    	else:
    		tmp = t_0 - (z * y)
    	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)
    	tmp = 0.0
    	if ((t_2 <= -10000000.0) || !(t_2 <= 0.995))
    		tmp = Float64(Float64(x + 1.0) - t_1);
    	else
    		tmp = Float64(t_0 - Float64(z * y));
    	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;
    	tmp = 0.0;
    	if ((t_2 <= -10000000.0) || ~((t_2 <= 0.995)))
    		tmp = (x + 1.0) - t_1;
    	else
    		tmp = t_0 - (z * y);
    	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]}, If[Or[LessEqual[t$95$2, -10000000.0], N[Not[LessEqual[t$95$2, 0.995]], $MachinePrecision]], N[(N[(x + 1.0), $MachinePrecision] - t$95$1), $MachinePrecision], N[(t$95$0 - N[(z * y), $MachinePrecision]), $MachinePrecision]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := x + \cos y\\
    t_1 := z \cdot \sin y\\
    t_2 := t\_0 - t\_1\\
    \mathbf{if}\;t\_2 \leq -10000000 \lor \neg \left(t\_2 \leq 0.995\right):\\
    \;\;\;\;\left(x + 1\right) - t\_1\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0 - z \cdot y\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (-.f64 (+.f64 x (cos.f64 y)) (*.f64 z (sin.f64 y))) < -1e7 or 0.994999999999999996 < (-.f64 (+.f64 x (cos.f64 y)) (*.f64 z (sin.f64 y)))

      1. Initial program 99.9%

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

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

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

        if -1e7 < (-.f64 (+.f64 x (cos.f64 y)) (*.f64 z (sin.f64 y))) < 0.994999999999999996

        1. Initial program 100.0%

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

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

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

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

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

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

      Alternative 4: 99.1% accurate, 1.0× speedup?

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

        1. Initial program 99.9%

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

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

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

          if -1.89999999999999998e-12 < x < 4.6000000000000002e-18

          1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

          if 4.6000000000000002e-18 < x

          1. Initial program 99.9%

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

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

              \[\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. lift-*.f64N/A

                \[\leadsto \left(x + 1\right) - \color{blue}{z \cdot \sin y} \]
              3. fp-cancel-sub-sign-invN/A

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

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

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

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

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

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

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

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

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

          Alternative 5: 99.9% accurate, 1.0× speedup?

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

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

          Alternative 6: 69.1% accurate, 1.8× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.85 \cdot 10^{+242}:\\ \;\;\;\;1 + x\\ \mathbf{elif}\;y \leq -9.4 \cdot 10^{+86}:\\ \;\;\;\;\left(-z\right) \cdot \sin y\\ \mathbf{elif}\;y \leq 155000000:\\ \;\;\;\;\mathsf{fma}\left(-z, y, 1 + x\right)\\ \mathbf{else}:\\ \;\;\;\;1 + x\\ \end{array} \end{array} \]
          (FPCore (x y z)
           :precision binary64
           (if (<= y -1.85e+242)
             (+ 1.0 x)
             (if (<= y -9.4e+86)
               (* (- z) (sin y))
               (if (<= y 155000000.0) (fma (- z) y (+ 1.0 x)) (+ 1.0 x)))))
          double code(double x, double y, double z) {
          	double tmp;
          	if (y <= -1.85e+242) {
          		tmp = 1.0 + x;
          	} else if (y <= -9.4e+86) {
          		tmp = -z * sin(y);
          	} else if (y <= 155000000.0) {
          		tmp = fma(-z, y, (1.0 + x));
          	} else {
          		tmp = 1.0 + x;
          	}
          	return tmp;
          }
          
          function code(x, y, z)
          	tmp = 0.0
          	if (y <= -1.85e+242)
          		tmp = Float64(1.0 + x);
          	elseif (y <= -9.4e+86)
          		tmp = Float64(Float64(-z) * sin(y));
          	elseif (y <= 155000000.0)
          		tmp = fma(Float64(-z), y, Float64(1.0 + x));
          	else
          		tmp = Float64(1.0 + x);
          	end
          	return tmp
          end
          
          code[x_, y_, z_] := If[LessEqual[y, -1.85e+242], N[(1.0 + x), $MachinePrecision], If[LessEqual[y, -9.4e+86], N[((-z) * N[Sin[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 155000000.0], N[((-z) * y + N[(1.0 + x), $MachinePrecision]), $MachinePrecision], N[(1.0 + x), $MachinePrecision]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;y \leq -1.85 \cdot 10^{+242}:\\
          \;\;\;\;1 + x\\
          
          \mathbf{elif}\;y \leq -9.4 \cdot 10^{+86}:\\
          \;\;\;\;\left(-z\right) \cdot \sin y\\
          
          \mathbf{elif}\;y \leq 155000000:\\
          \;\;\;\;\mathsf{fma}\left(-z, y, 1 + x\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;1 + x\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if y < -1.85e242 or 1.55e8 < y

            1. Initial program 99.9%

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

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

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

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

            if -1.85e242 < y < -9.4000000000000004e86

            1. Initial program 99.8%

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

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

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

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

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

                \[\leadsto \color{blue}{\left(-z\right)} \cdot \sin y \]
              5. lower-sin.f6457.8

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

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

            if -9.4000000000000004e86 < y < 1.55e8

            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. associate-+r+N/A

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

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

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

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

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

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

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

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

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

          Alternative 7: 88.1% accurate, 1.9× speedup?

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

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

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

            Alternative 8: 69.7% accurate, 4.9× speedup?

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

              1. Initial program 99.9%

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

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

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

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

              if -1.3e15 < y < 8.2000000000000007e-30

              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. associate-+r+N/A

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

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

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

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

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

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

            Alternative 9: 69.7% accurate, 7.1× speedup?

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

              1. Initial program 99.9%

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

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

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

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

              if -1.35e15 < y < 8.2000000000000007e-30

              1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

            Alternative 10: 70.3% accurate, 8.8× speedup?

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

              1. Initial program 99.9%

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

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

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

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

              if -3.9999999999999999e24 < y < 1.55e8

              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. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

            Alternative 11: 67.3% accurate, 10.1× speedup?

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

              1. Initial program 99.9%

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

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

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

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

              if -0.116000000000000006 < x < 11000

              1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                Alternative 12: 63.0% accurate, 15.1× speedup?

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

                  1. Initial program 99.8%

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

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

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

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

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

                      \[\leadsto \color{blue}{\left(-z\right)} \cdot \sin y \]
                    5. lower-sin.f6481.0

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

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

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

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

                    if -2.2e223 < z

                    1. Initial program 99.9%

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

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

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

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

                  Alternative 13: 62.6% accurate, 53.0× speedup?

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

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

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

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

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

                  Alternative 14: 22.3% accurate, 212.0× speedup?

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

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

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

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

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

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

                      \[\leadsto 1 \]
                    2. Add Preprocessing

                    Reproduce

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