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

Percentage Accurate: 99.9% → 99.9%
Time: 10.3s
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} \\ \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 2: 73.5% accurate, 0.4× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;x + 1\\


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

    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. metadata-evalN/A

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

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

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

    if -1e6 < (-.f64 (+.f64 x (cos.f64 y)) (*.f64 z (sin.f64 y))) < 0.99950000000000006

    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.f6496.9

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

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

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

        \[\leadsto \cos y \]

      if 0.99950000000000006 < (-.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 + x} \]
      4. Step-by-step derivation
        1. +-commutativeN/A

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

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

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

    Alternative 3: 99.2% accurate, 1.7× speedup?

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

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

        if -3e15 < z < 0.94999999999999996

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

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

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

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

      Alternative 4: 82.2% accurate, 1.8× speedup?

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

        1. Initial program 99.8%

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

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

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

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

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

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

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

        if -3.50000000000000016e118 < z < 1.6e111

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

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

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

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

      Alternative 5: 81.0% accurate, 1.8× speedup?

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

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

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

        if -23000 < y < 3.90000000000000026e-15

        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 + \frac{-1}{6} \cdot \left({y}^{2} \cdot z\right)\right)} \]
          3. Step-by-step derivation
            1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 6: 69.8% accurate, 7.1× speedup?

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

          1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if -2.20000000000000002e24 < y < 3.1e6

              1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

              if 3.1e6 < 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. +-commutativeN/A

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

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

                \[\leadsto \color{blue}{x + 1} \]
            4. Recombined 3 regimes into one program.
            5. Final simplification70.7%

              \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.2 \cdot 10^{+24}:\\ \;\;\;\;x + \frac{-1}{\mathsf{fma}\left(y, -z, -1\right)}\\ \mathbf{elif}\;y \leq 3100000:\\ \;\;\;\;\mathsf{fma}\left(y, y \cdot -0.5 - z, x + 1\right)\\ \mathbf{else}:\\ \;\;\;\;x + 1\\ \end{array} \]
            6. Add Preprocessing

            Alternative 7: 70.0% accurate, 7.1× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -2.2 \cdot 10^{+24}:\\ \;\;\;\;x + 1\\ \mathbf{elif}\;y \leq 3100000:\\ \;\;\;\;\mathsf{fma}\left(y, y \cdot -0.5 - z, x + 1\right)\\ \mathbf{else}:\\ \;\;\;\;x + 1\\ \end{array} \end{array} \]
            (FPCore (x y z)
             :precision binary64
             (if (<= y -2.2e+24)
               (+ x 1.0)
               (if (<= y 3100000.0) (fma y (- (* y -0.5) z) (+ x 1.0)) (+ x 1.0))))
            double code(double x, double y, double z) {
            	double tmp;
            	if (y <= -2.2e+24) {
            		tmp = x + 1.0;
            	} else if (y <= 3100000.0) {
            		tmp = fma(y, ((y * -0.5) - z), (x + 1.0));
            	} else {
            		tmp = x + 1.0;
            	}
            	return tmp;
            }
            
            function code(x, y, z)
            	tmp = 0.0
            	if (y <= -2.2e+24)
            		tmp = Float64(x + 1.0);
            	elseif (y <= 3100000.0)
            		tmp = fma(y, Float64(Float64(y * -0.5) - z), Float64(x + 1.0));
            	else
            		tmp = Float64(x + 1.0);
            	end
            	return tmp
            end
            
            code[x_, y_, z_] := If[LessEqual[y, -2.2e+24], N[(x + 1.0), $MachinePrecision], If[LessEqual[y, 3100000.0], N[(y * N[(N[(y * -0.5), $MachinePrecision] - z), $MachinePrecision] + N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(x + 1.0), $MachinePrecision]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;y \leq -2.2 \cdot 10^{+24}:\\
            \;\;\;\;x + 1\\
            
            \mathbf{elif}\;y \leq 3100000:\\
            \;\;\;\;\mathsf{fma}\left(y, y \cdot -0.5 - z, x + 1\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;x + 1\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if y < -2.20000000000000002e24 or 3.1e6 < 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. +-commutativeN/A

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

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

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

              if -2.20000000000000002e24 < y < 3.1e6

              1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

            Alternative 8: 70.0% accurate, 9.6× speedup?

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

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

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

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

              if -1.24e42 < y < 1.75e6

              1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

            Alternative 9: 64.7% accurate, 10.1× speedup?

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

              1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

                if -1.30000000000000006e-19 < x < 4.20000000000000039e-9

                1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

                  if 4.20000000000000039e-9 < x

                  1. Initial program 100.0%

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

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

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

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

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

                Alternative 10: 67.2% accurate, 10.1× speedup?

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

                  1. Initial program 100.0%

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

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

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

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

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

                  if -2.99999999999999974e-4 < x < 4.20000000000000039e-9

                  1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

                  Alternative 11: 61.9% accurate, 53.0× speedup?

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

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

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

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

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

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

                  Alternative 12: 21.4% accurate, 212.0× speedup?

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

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

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

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

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

                    \[\leadsto \color{blue}{x + 1} \]
                  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 2024222 
                    (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))))