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

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

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

Initial Program: 99.9% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(\sin y, -z, \color{blue}{\cos y + x}\right) \]
    11. 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. Final simplification99.9%

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

Alternative 2: 92.0% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := z \cdot \sin y\\ t_1 := \left(x + \cos y\right) - t\_0\\ t_2 := \left(1 + x\right) - t\_0\\ \mathbf{if}\;t\_1 \leq -40000000:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 0.97:\\ \;\;\;\;\cos y - z \cdot y\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* z (sin y)))
        (t_1 (- (+ x (cos y)) t_0))
        (t_2 (- (+ 1.0 x) t_0)))
   (if (<= t_1 -40000000.0) t_2 (if (<= t_1 0.97) (- (cos y) (* z y)) t_2))))
double code(double x, double y, double z) {
	double t_0 = z * sin(y);
	double t_1 = (x + cos(y)) - t_0;
	double t_2 = (1.0 + x) - t_0;
	double tmp;
	if (t_1 <= -40000000.0) {
		tmp = t_2;
	} else if (t_1 <= 0.97) {
		tmp = cos(y) - (z * y);
	} else {
		tmp = t_2;
	}
	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 = z * sin(y)
    t_1 = (x + cos(y)) - t_0
    t_2 = (1.0d0 + x) - t_0
    if (t_1 <= (-40000000.0d0)) then
        tmp = t_2
    else if (t_1 <= 0.97d0) then
        tmp = cos(y) - (z * y)
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = z * Math.sin(y);
	double t_1 = (x + Math.cos(y)) - t_0;
	double t_2 = (1.0 + x) - t_0;
	double tmp;
	if (t_1 <= -40000000.0) {
		tmp = t_2;
	} else if (t_1 <= 0.97) {
		tmp = Math.cos(y) - (z * y);
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = z * math.sin(y)
	t_1 = (x + math.cos(y)) - t_0
	t_2 = (1.0 + x) - t_0
	tmp = 0
	if t_1 <= -40000000.0:
		tmp = t_2
	elif t_1 <= 0.97:
		tmp = math.cos(y) - (z * y)
	else:
		tmp = t_2
	return tmp
function code(x, y, z)
	t_0 = Float64(z * sin(y))
	t_1 = Float64(Float64(x + cos(y)) - t_0)
	t_2 = Float64(Float64(1.0 + x) - t_0)
	tmp = 0.0
	if (t_1 <= -40000000.0)
		tmp = t_2;
	elseif (t_1 <= 0.97)
		tmp = Float64(cos(y) - Float64(z * y));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = z * sin(y);
	t_1 = (x + cos(y)) - t_0;
	t_2 = (1.0 + x) - t_0;
	tmp = 0.0;
	if (t_1 <= -40000000.0)
		tmp = t_2;
	elseif (t_1 <= 0.97)
		tmp = cos(y) - (z * y);
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(1.0 + x), $MachinePrecision] - t$95$0), $MachinePrecision]}, If[LessEqual[t$95$1, -40000000.0], t$95$2, If[LessEqual[t$95$1, 0.97], N[(N[Cos[y], $MachinePrecision] - N[(z * y), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_1 \leq 0.97:\\
\;\;\;\;\cos y - z \cdot y\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (+.f64 x (cos.f64 y)) (*.f64 z (sin.f64 y))) < -4e7 or 0.96999999999999997 < (-.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.2%

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

      if -4e7 < (-.f64 (+.f64 x (cos.f64 y)) (*.f64 z (sin.f64 y))) < 0.96999999999999997

      1. Initial program 99.9%

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

        \[\leadsto \color{blue}{\cos y} - z \cdot \sin y \]
      4. Step-by-step derivation
        1. lower-cos.f6499.2

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

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

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

          \[\leadsto \cos y - \color{blue}{z \cdot y} \]
        2. lower-*.f6463.9

          \[\leadsto \cos y - \color{blue}{z \cdot y} \]
      8. Applied rewrites63.9%

        \[\leadsto \cos y - \color{blue}{z \cdot y} \]
    5. Recombined 2 regimes into one program.
    6. Final simplification93.8%

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

    Alternative 3: 98.7% accurate, 1.0× speedup?

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

        if -2.4e7 < x < 2e-8

        1. Initial program 99.8%

          \[\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. sub-negN/A

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

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

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

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

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

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

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

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

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

      Alternative 4: 99.9% accurate, 1.0× speedup?

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

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

      Alternative 5: 99.1% accurate, 1.5× speedup?

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

        1. Initial program 99.8%

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

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

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

          if -0.13 < z < 2.39999999999999998e-8

          1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{1}{\color{blue}{\frac{1}{x + \cos y}}} \]
          6. Step-by-step derivation
            1. lower-/.f64N/A

              \[\leadsto \frac{1}{\color{blue}{\frac{1}{x + \cos y}}} \]
            2. +-commutativeN/A

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

              \[\leadsto \frac{1}{\frac{1}{\color{blue}{\cos y + x}}} \]
            4. lower-cos.f6498.1

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

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

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

        Alternative 6: 92.0% accurate, 1.7× speedup?

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

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

            if -6.9999999999999997e-108 < z < 8.0000000000000003e-62

            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-*.f6495.3

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

              \[\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}\;z \leq -7 \cdot 10^{-108}:\\ \;\;\;\;\left(1 + x\right) - z \cdot \sin y\\ \mathbf{elif}\;z \leq 8 \cdot 10^{-62}:\\ \;\;\;\;\left(x + \cos y\right) - z \cdot y\\ \mathbf{else}:\\ \;\;\;\;\left(1 + x\right) - z \cdot \sin y\\ \end{array} \]
          7. Add Preprocessing

          Alternative 7: 71.1% accurate, 1.8× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(-z\right) \cdot \sin y\\ \mathbf{if}\;z \leq -3 \cdot 10^{+84}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{+142}:\\ \;\;\;\;1 + x\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
          (FPCore (x y z)
           :precision binary64
           (let* ((t_0 (* (- z) (sin y))))
             (if (<= z -3e+84) t_0 (if (<= z 1.6e+142) (+ 1.0 x) t_0))))
          double code(double x, double y, double z) {
          	double t_0 = -z * sin(y);
          	double tmp;
          	if (z <= -3e+84) {
          		tmp = t_0;
          	} else if (z <= 1.6e+142) {
          		tmp = 1.0 + 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 <= (-3d+84)) then
                  tmp = t_0
              else if (z <= 1.6d+142) then
                  tmp = 1.0d0 + 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 <= -3e+84) {
          		tmp = t_0;
          	} else if (z <= 1.6e+142) {
          		tmp = 1.0 + x;
          	} else {
          		tmp = t_0;
          	}
          	return tmp;
          }
          
          def code(x, y, z):
          	t_0 = -z * math.sin(y)
          	tmp = 0
          	if z <= -3e+84:
          		tmp = t_0
          	elif z <= 1.6e+142:
          		tmp = 1.0 + x
          	else:
          		tmp = t_0
          	return tmp
          
          function code(x, y, z)
          	t_0 = Float64(Float64(-z) * sin(y))
          	tmp = 0.0
          	if (z <= -3e+84)
          		tmp = t_0;
          	elseif (z <= 1.6e+142)
          		tmp = Float64(1.0 + 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 <= -3e+84)
          		tmp = t_0;
          	elseif (z <= 1.6e+142)
          		tmp = 1.0 + 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, -3e+84], t$95$0, If[LessEqual[z, 1.6e+142], N[(1.0 + x), $MachinePrecision], t$95$0]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := \left(-z\right) \cdot \sin y\\
          \mathbf{if}\;z \leq -3 \cdot 10^{+84}:\\
          \;\;\;\;t\_0\\
          
          \mathbf{elif}\;z \leq 1.6 \cdot 10^{+142}:\\
          \;\;\;\;1 + x\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_0\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if z < -2.99999999999999996e84 or 1.60000000000000003e142 < 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(-z\right)} \cdot \sin y \]
              5. lower-sin.f6468.0

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

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

            if -2.99999999999999996e84 < z < 1.60000000000000003e142

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

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

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

          Alternative 8: 69.7% accurate, 5.2× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1500000:\\ \;\;\;\;1 + x\\ \mathbf{elif}\;y \leq 160000:\\ \;\;\;\;\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 -1500000.0)
             (+ 1.0 x)
             (if (<= y 160000.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 <= -1500000.0) {
          		tmp = 1.0 + x;
          	} else if (y <= 160000.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 <= -1500000.0)
          		tmp = Float64(1.0 + x);
          	elseif (y <= 160000.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, -1500000.0], N[(1.0 + x), $MachinePrecision], If[LessEqual[y, 160000.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 -1500000:\\
          \;\;\;\;1 + x\\
          
          \mathbf{elif}\;y \leq 160000:\\
          \;\;\;\;\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.5e6 or 1.6e5 < y

            1. Initial program 99.8%

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

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

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

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

            if -1.5e6 < y < 1.6e5

            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-+.f64100.0

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

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

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

            1. Initial program 99.8%

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

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

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

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

            if -4.3999999999999997e35 < y < 1.8e21

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

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

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

          Alternative 10: 61.6% accurate, 15.1× speedup?

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

            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-+.f6464.6

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

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

            if 1.89999999999999999e214 < 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(-z\right)} \cdot \sin y \]
              5. lower-sin.f6480.0

                \[\leadsto \left(-z\right) \cdot \color{blue}{\sin y} \]
            5. Applied rewrites80.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 rewrites34.6%

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

            Alternative 11: 61.2% 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-+.f6459.9

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

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

            Alternative 12: 21.6% 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-+.f6459.9

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

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

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

                \[\leadsto 1 \]
              2. Add Preprocessing

              Reproduce

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