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

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

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

Initial Program: 99.9% accurate, 1.0× speedup?

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

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

Alternative 1: 99.9% accurate, 1.0× speedup?

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

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

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

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

Alternative 2: 73.2% accurate, 0.4× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (+.f64 x (cos.f64 y)) (*.f64 z (sin.f64 y))) < -5e11 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 \color{blue}{1 + \left(x + -1 \cdot \left(y \cdot z\right)\right)} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

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

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

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

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

        \[\leadsto x - \left(z \cdot y + \color{blue}{-1}\right) \]
      9. lower-fma.f6469.7

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

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

    if -5e11 < (-.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 z around 0

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

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

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

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

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

      \[\leadsto \cos y \]
    7. Step-by-step derivation
      1. Applied rewrites92.1%

        \[\leadsto \cos y \]
    8. Recombined 2 regimes into one program.
    9. Final simplification73.1%

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

    Alternative 3: 99.4% accurate, 1.7× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(1 + x\right) - \sin y \cdot z\\ \mathbf{if}\;z \leq -580000:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 1.22:\\ \;\;\;\;\cos y + x\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
    (FPCore (x y z)
     :precision binary64
     (let* ((t_0 (- (+ 1.0 x) (* (sin y) z))))
       (if (<= z -580000.0) t_0 (if (<= z 1.22) (+ (cos y) x) t_0))))
    double code(double x, double y, double z) {
    	double t_0 = (1.0 + x) - (sin(y) * z);
    	double tmp;
    	if (z <= -580000.0) {
    		tmp = t_0;
    	} else if (z <= 1.22) {
    		tmp = cos(y) + x;
    	} else {
    		tmp = t_0;
    	}
    	return tmp;
    }
    
    real(8) function code(x, y, z)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8) :: t_0
        real(8) :: tmp
        t_0 = (1.0d0 + x) - (sin(y) * z)
        if (z <= (-580000.0d0)) then
            tmp = t_0
        else if (z <= 1.22d0) then
            tmp = cos(y) + x
        else
            tmp = t_0
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z) {
    	double t_0 = (1.0 + x) - (Math.sin(y) * z);
    	double tmp;
    	if (z <= -580000.0) {
    		tmp = t_0;
    	} else if (z <= 1.22) {
    		tmp = Math.cos(y) + x;
    	} else {
    		tmp = t_0;
    	}
    	return tmp;
    }
    
    def code(x, y, z):
    	t_0 = (1.0 + x) - (math.sin(y) * z)
    	tmp = 0
    	if z <= -580000.0:
    		tmp = t_0
    	elif z <= 1.22:
    		tmp = math.cos(y) + x
    	else:
    		tmp = t_0
    	return tmp
    
    function code(x, y, z)
    	t_0 = Float64(Float64(1.0 + x) - Float64(sin(y) * z))
    	tmp = 0.0
    	if (z <= -580000.0)
    		tmp = t_0;
    	elseif (z <= 1.22)
    		tmp = Float64(cos(y) + x);
    	else
    		tmp = t_0;
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z)
    	t_0 = (1.0 + x) - (sin(y) * z);
    	tmp = 0.0;
    	if (z <= -580000.0)
    		tmp = t_0;
    	elseif (z <= 1.22)
    		tmp = cos(y) + x;
    	else
    		tmp = t_0;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_] := Block[{t$95$0 = N[(N[(1.0 + x), $MachinePrecision] - N[(N[Sin[y], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -580000.0], t$95$0, If[LessEqual[z, 1.22], N[(N[Cos[y], $MachinePrecision] + x), $MachinePrecision], t$95$0]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \left(1 + x\right) - \sin y \cdot z\\
    \mathbf{if}\;z \leq -580000:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;z \leq 1.22:\\
    \;\;\;\;\cos y + x\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if z < -5.8e5 or 1.21999999999999997 < 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 \left(x + \color{blue}{1}\right) - z \cdot \sin y \]
      4. Step-by-step derivation
        1. Applied rewrites99.3%

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

        if -5.8e5 < z < 1.21999999999999997

        1. Initial program 100.0%

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

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

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

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

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

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

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

      Alternative 4: 79.8% accurate, 1.8× speedup?

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

        1. Initial program 99.9%

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

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

            \[\leadsto \color{blue}{\mathsf{neg}\left(z \cdot \sin y\right)} \]
          2. 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(\mathsf{neg}\left(z\right)\right)} \cdot \sin y \]
          5. lower-sin.f6467.0

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

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

        if -8e9 < z < 1.0000000000000001e178

        1. Initial program 100.0%

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

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

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

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

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

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

      Alternative 5: 80.4% accurate, 1.8× speedup?

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

        1. Initial program 99.9%

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

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

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

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

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

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

        if -1.1200000000000001 < y < 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 \left(x + \color{blue}{1}\right) - z \cdot \sin y \]
        4. Step-by-step derivation
          1. Applied rewrites100.0%

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

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

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

              \[\leadsto \left(x + 1\right) - \color{blue}{\left(z + {y}^{2} \cdot \left(\frac{-1}{6} \cdot z + {y}^{2} \cdot \left(\frac{-1}{5040} \cdot \left({y}^{2} \cdot z\right) + \frac{1}{120} \cdot z\right)\right)\right) \cdot y} \]
          4. Applied rewrites99.0%

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

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

        Alternative 6: 69.2% accurate, 3.4× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -6500000:\\ \;\;\;\;1 + x\\ \mathbf{elif}\;y \leq 7800:\\ \;\;\;\;\left(1 + x\right) - \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.0001984126984126984, y \cdot y, 0.008333333333333333\right), y \cdot y, -0.16666666666666666\right) \cdot z, y \cdot y, z\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;1 + x\\ \end{array} \end{array} \]
        (FPCore (x y z)
         :precision binary64
         (if (<= y -6500000.0)
           (+ 1.0 x)
           (if (<= y 7800.0)
             (-
              (+ 1.0 x)
              (*
               (fma
                (*
                 (fma
                  (fma -0.0001984126984126984 (* y y) 0.008333333333333333)
                  (* y y)
                  -0.16666666666666666)
                 z)
                (* y y)
                z)
               y))
             (+ 1.0 x))))
        double code(double x, double y, double z) {
        	double tmp;
        	if (y <= -6500000.0) {
        		tmp = 1.0 + x;
        	} else if (y <= 7800.0) {
        		tmp = (1.0 + x) - (fma((fma(fma(-0.0001984126984126984, (y * y), 0.008333333333333333), (y * y), -0.16666666666666666) * z), (y * y), z) * y);
        	} else {
        		tmp = 1.0 + x;
        	}
        	return tmp;
        }
        
        function code(x, y, z)
        	tmp = 0.0
        	if (y <= -6500000.0)
        		tmp = Float64(1.0 + x);
        	elseif (y <= 7800.0)
        		tmp = Float64(Float64(1.0 + x) - Float64(fma(Float64(fma(fma(-0.0001984126984126984, Float64(y * y), 0.008333333333333333), Float64(y * y), -0.16666666666666666) * z), Float64(y * y), z) * y));
        	else
        		tmp = Float64(1.0 + x);
        	end
        	return tmp
        end
        
        code[x_, y_, z_] := If[LessEqual[y, -6500000.0], N[(1.0 + x), $MachinePrecision], If[LessEqual[y, 7800.0], N[(N[(1.0 + x), $MachinePrecision] - N[(N[(N[(N[(N[(-0.0001984126984126984 * N[(y * y), $MachinePrecision] + 0.008333333333333333), $MachinePrecision] * N[(y * y), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] * z), $MachinePrecision] * N[(y * y), $MachinePrecision] + z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], N[(1.0 + x), $MachinePrecision]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;y \leq -6500000:\\
        \;\;\;\;1 + x\\
        
        \mathbf{elif}\;y \leq 7800:\\
        \;\;\;\;\left(1 + x\right) - \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.0001984126984126984, y \cdot y, 0.008333333333333333\right), y \cdot y, -0.16666666666666666\right) \cdot z, y \cdot y, z\right) \cdot y\\
        
        \mathbf{else}:\\
        \;\;\;\;1 + x\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if y < -6.5e6 or 7800 < 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-+.f6435.7

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

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

          if -6.5e6 < y < 7800

          1. Initial program 100.0%

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

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

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

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

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

                \[\leadsto \left(x + 1\right) - \color{blue}{\left(z + {y}^{2} \cdot \left(\frac{-1}{6} \cdot z + {y}^{2} \cdot \left(\frac{-1}{5040} \cdot \left({y}^{2} \cdot z\right) + \frac{1}{120} \cdot z\right)\right)\right) \cdot y} \]
            4. Applied rewrites97.7%

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

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

          Alternative 7: 69.3% accurate, 5.2× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1720000:\\ \;\;\;\;1 + x\\ \mathbf{elif}\;y \leq 30:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666, z \cdot y, -0.5\right) \cdot y - z, y, 1 + x\right)\\ \mathbf{else}:\\ \;\;\;\;1 + x\\ \end{array} \end{array} \]
          (FPCore (x y z)
           :precision binary64
           (if (<= y -1720000.0)
             (+ 1.0 x)
             (if (<= y 30.0)
               (fma (- (* (fma 0.16666666666666666 (* z y) -0.5) y) z) y (+ 1.0 x))
               (+ 1.0 x))))
          double code(double x, double y, double z) {
          	double tmp;
          	if (y <= -1720000.0) {
          		tmp = 1.0 + x;
          	} else if (y <= 30.0) {
          		tmp = fma(((fma(0.16666666666666666, (z * y), -0.5) * y) - z), y, (1.0 + x));
          	} else {
          		tmp = 1.0 + x;
          	}
          	return tmp;
          }
          
          function code(x, y, z)
          	tmp = 0.0
          	if (y <= -1720000.0)
          		tmp = Float64(1.0 + x);
          	elseif (y <= 30.0)
          		tmp = fma(Float64(Float64(fma(0.16666666666666666, Float64(z * y), -0.5) * y) - z), y, Float64(1.0 + x));
          	else
          		tmp = Float64(1.0 + x);
          	end
          	return tmp
          end
          
          code[x_, y_, z_] := If[LessEqual[y, -1720000.0], N[(1.0 + x), $MachinePrecision], If[LessEqual[y, 30.0], N[(N[(N[(N[(0.16666666666666666 * N[(z * y), $MachinePrecision] + -0.5), $MachinePrecision] * y), $MachinePrecision] - z), $MachinePrecision] * y + N[(1.0 + x), $MachinePrecision]), $MachinePrecision], N[(1.0 + x), $MachinePrecision]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;y \leq -1720000:\\
          \;\;\;\;1 + x\\
          
          \mathbf{elif}\;y \leq 30:\\
          \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666, z \cdot y, -0.5\right) \cdot y - z, y, 1 + x\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;1 + x\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if y < -1.72e6 or 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-+.f6435.6

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

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

            if -1.72e6 < y < 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. lower--.f64N/A

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

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

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

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

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

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

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

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

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

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

          Alternative 8: 69.0% accurate, 5.3× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2.9 \cdot 10^{+49}:\\ \;\;\;\;1 + x\\ \mathbf{elif}\;y \leq 8500:\\ \;\;\;\;\left(1 + x\right) - \left(\mathsf{fma}\left(-0.16666666666666666, y \cdot y, 1\right) \cdot z\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;1 + x\\ \end{array} \end{array} \]
          (FPCore (x y z)
           :precision binary64
           (if (<= y -2.9e+49)
             (+ 1.0 x)
             (if (<= y 8500.0)
               (- (+ 1.0 x) (* (* (fma -0.16666666666666666 (* y y) 1.0) z) y))
               (+ 1.0 x))))
          double code(double x, double y, double z) {
          	double tmp;
          	if (y <= -2.9e+49) {
          		tmp = 1.0 + x;
          	} else if (y <= 8500.0) {
          		tmp = (1.0 + x) - ((fma(-0.16666666666666666, (y * y), 1.0) * z) * y);
          	} else {
          		tmp = 1.0 + x;
          	}
          	return tmp;
          }
          
          function code(x, y, z)
          	tmp = 0.0
          	if (y <= -2.9e+49)
          		tmp = Float64(1.0 + x);
          	elseif (y <= 8500.0)
          		tmp = Float64(Float64(1.0 + x) - Float64(Float64(fma(-0.16666666666666666, Float64(y * y), 1.0) * z) * y));
          	else
          		tmp = Float64(1.0 + x);
          	end
          	return tmp
          end
          
          code[x_, y_, z_] := If[LessEqual[y, -2.9e+49], N[(1.0 + x), $MachinePrecision], If[LessEqual[y, 8500.0], N[(N[(1.0 + x), $MachinePrecision] - N[(N[(N[(-0.16666666666666666 * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision] * z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], N[(1.0 + x), $MachinePrecision]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;y \leq -2.9 \cdot 10^{+49}:\\
          \;\;\;\;1 + x\\
          
          \mathbf{elif}\;y \leq 8500:\\
          \;\;\;\;\left(1 + x\right) - \left(\mathsf{fma}\left(-0.16666666666666666, y \cdot y, 1\right) \cdot z\right) \cdot y\\
          
          \mathbf{else}:\\
          \;\;\;\;1 + x\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if y < -2.9e49 or 8500 < 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-+.f6435.1

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

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

            if -2.9e49 < y < 8500

            1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.9 \cdot 10^{+49}:\\ \;\;\;\;1 + x\\ \mathbf{elif}\;y \leq 8500:\\ \;\;\;\;\left(1 + x\right) - \left(\mathsf{fma}\left(-0.16666666666666666, y \cdot y, 1\right) \cdot z\right) \cdot y\\ \mathbf{else}:\\ \;\;\;\;1 + x\\ \end{array} \]
              9. Add Preprocessing

              Alternative 9: 69.0% accurate, 5.3× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2.9 \cdot 10^{+49}:\\ \;\;\;\;1 + x\\ \mathbf{elif}\;y \leq 180:\\ \;\;\;\;\left(1 + x\right) - \left(\mathsf{fma}\left(-0.16666666666666666, y \cdot y, 1\right) \cdot y\right) \cdot z\\ \mathbf{else}:\\ \;\;\;\;1 + x\\ \end{array} \end{array} \]
              (FPCore (x y z)
               :precision binary64
               (if (<= y -2.9e+49)
                 (+ 1.0 x)
                 (if (<= y 180.0)
                   (- (+ 1.0 x) (* (* (fma -0.16666666666666666 (* y y) 1.0) y) z))
                   (+ 1.0 x))))
              double code(double x, double y, double z) {
              	double tmp;
              	if (y <= -2.9e+49) {
              		tmp = 1.0 + x;
              	} else if (y <= 180.0) {
              		tmp = (1.0 + x) - ((fma(-0.16666666666666666, (y * y), 1.0) * y) * z);
              	} else {
              		tmp = 1.0 + x;
              	}
              	return tmp;
              }
              
              function code(x, y, z)
              	tmp = 0.0
              	if (y <= -2.9e+49)
              		tmp = Float64(1.0 + x);
              	elseif (y <= 180.0)
              		tmp = Float64(Float64(1.0 + x) - Float64(Float64(fma(-0.16666666666666666, Float64(y * y), 1.0) * y) * z));
              	else
              		tmp = Float64(1.0 + x);
              	end
              	return tmp
              end
              
              code[x_, y_, z_] := If[LessEqual[y, -2.9e+49], N[(1.0 + x), $MachinePrecision], If[LessEqual[y, 180.0], N[(N[(1.0 + x), $MachinePrecision] - N[(N[(N[(-0.16666666666666666 * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(1.0 + x), $MachinePrecision]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;y \leq -2.9 \cdot 10^{+49}:\\
              \;\;\;\;1 + x\\
              
              \mathbf{elif}\;y \leq 180:\\
              \;\;\;\;\left(1 + x\right) - \left(\mathsf{fma}\left(-0.16666666666666666, y \cdot y, 1\right) \cdot y\right) \cdot z\\
              
              \mathbf{else}:\\
              \;\;\;\;1 + x\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if y < -2.9e49 or 180 < 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-+.f6435.1

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

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

                if -2.9e49 < y < 180

                1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                Alternative 10: 69.2% accurate, 7.1× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1100000000000:\\ \;\;\;\;1 + x\\ \mathbf{elif}\;y \leq 11:\\ \;\;\;\;\mathsf{fma}\left(-0.5 \cdot y - z, y, 1 + x\right)\\ \mathbf{else}:\\ \;\;\;\;1 + x\\ \end{array} \end{array} \]
                (FPCore (x y z)
                 :precision binary64
                 (if (<= y -1100000000000.0)
                   (+ 1.0 x)
                   (if (<= y 11.0) (fma (- (* -0.5 y) z) y (+ 1.0 x)) (+ 1.0 x))))
                double code(double x, double y, double z) {
                	double tmp;
                	if (y <= -1100000000000.0) {
                		tmp = 1.0 + x;
                	} else if (y <= 11.0) {
                		tmp = fma(((-0.5 * y) - z), y, (1.0 + x));
                	} else {
                		tmp = 1.0 + x;
                	}
                	return tmp;
                }
                
                function code(x, y, z)
                	tmp = 0.0
                	if (y <= -1100000000000.0)
                		tmp = Float64(1.0 + x);
                	elseif (y <= 11.0)
                		tmp = fma(Float64(Float64(-0.5 * y) - z), y, Float64(1.0 + x));
                	else
                		tmp = Float64(1.0 + x);
                	end
                	return tmp
                end
                
                code[x_, y_, z_] := If[LessEqual[y, -1100000000000.0], N[(1.0 + x), $MachinePrecision], If[LessEqual[y, 11.0], N[(N[(N[(-0.5 * y), $MachinePrecision] - z), $MachinePrecision] * y + N[(1.0 + x), $MachinePrecision]), $MachinePrecision], N[(1.0 + x), $MachinePrecision]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;y \leq -1100000000000:\\
                \;\;\;\;1 + x\\
                
                \mathbf{elif}\;y \leq 11:\\
                \;\;\;\;\mathsf{fma}\left(-0.5 \cdot y - z, y, 1 + x\right)\\
                
                \mathbf{else}:\\
                \;\;\;\;1 + x\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if y < -1.1e12 or 11 < 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-+.f6435.1

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

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

                  if -1.1e12 < y < 11

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

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

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

                Alternative 11: 69.1% accurate, 9.6× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -360000000000:\\ \;\;\;\;1 + x\\ \mathbf{elif}\;y \leq 9.5:\\ \;\;\;\;x - \mathsf{fma}\left(z, y, -1\right)\\ \mathbf{else}:\\ \;\;\;\;1 + x\\ \end{array} \end{array} \]
                (FPCore (x y z)
                 :precision binary64
                 (if (<= y -360000000000.0)
                   (+ 1.0 x)
                   (if (<= y 9.5) (- x (fma z y -1.0)) (+ 1.0 x))))
                double code(double x, double y, double z) {
                	double tmp;
                	if (y <= -360000000000.0) {
                		tmp = 1.0 + x;
                	} else if (y <= 9.5) {
                		tmp = x - fma(z, y, -1.0);
                	} else {
                		tmp = 1.0 + x;
                	}
                	return tmp;
                }
                
                function code(x, y, z)
                	tmp = 0.0
                	if (y <= -360000000000.0)
                		tmp = Float64(1.0 + x);
                	elseif (y <= 9.5)
                		tmp = Float64(x - fma(z, y, -1.0));
                	else
                		tmp = Float64(1.0 + x);
                	end
                	return tmp
                end
                
                code[x_, y_, z_] := If[LessEqual[y, -360000000000.0], N[(1.0 + x), $MachinePrecision], If[LessEqual[y, 9.5], N[(x - N[(z * y + -1.0), $MachinePrecision]), $MachinePrecision], N[(1.0 + x), $MachinePrecision]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;y \leq -360000000000:\\
                \;\;\;\;1 + x\\
                
                \mathbf{elif}\;y \leq 9.5:\\
                \;\;\;\;x - \mathsf{fma}\left(z, y, -1\right)\\
                
                \mathbf{else}:\\
                \;\;\;\;1 + x\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if y < -3.6e11 or 9.5 < 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-+.f6435.1

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

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

                  if -3.6e11 < y < 9.5

                  1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

                Alternative 12: 66.2% accurate, 10.1× speedup?

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

                  1. Initial program 100.0%

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

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

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

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

                  if -6.4000000000000002e-12 < x < 0.71999999999999997

                  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-+.f6443.3

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

                    \[\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 rewrites43.0%

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

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

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

                    Alternative 13: 61.5% accurate, 15.1× speedup?

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

                      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-+.f6462.7

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

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

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

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

                        if -6.4000000000000001e217 < 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-+.f6461.9

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

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

                      Alternative 14: 61.1% 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-+.f6458.4

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

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

                      Alternative 15: 21.2% 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-+.f6458.4

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

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

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

                          \[\leadsto 1 \]
                        2. Add Preprocessing

                        Reproduce

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