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

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

\\
\mathsf{fma}\left(0 - \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. sub-negN/A

      \[\leadsto \color{blue}{\left(x + \cos y\right) + \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) + \left(x + \cos y\right)} \]
    3. *-commutativeN/A

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

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

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

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

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

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

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

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

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

Alternative 2: 98.5% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_0 := x + \cos y\\
t_1 := \sin y \cdot z\\
t_2 := t\_0 - t\_1\\
t_3 := x - t\_1\\
\mathbf{if}\;t\_2 \leq -4000000000:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;t\_2 \leq 400000000000:\\
\;\;\;\;t\_0\\

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


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

      \[\leadsto \color{blue}{x} - z \cdot \sin y \]
    4. Step-by-step derivation
      1. Simplified99.6%

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

      if -4e9 < (-.f64 (+.f64 x (cos.f64 y)) (*.f64 z (sin.f64 y))) < 4e11

      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. +-lowering-+.f64N/A

          \[\leadsto \color{blue}{\cos y + x} \]
        3. cos-lowering-cos.f6498.1

          \[\leadsto \color{blue}{\cos y} + x \]
      5. Simplified98.1%

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

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

    Alternative 3: 73.2% accurate, 0.4× speedup?

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

      1. Initial program 99.9%

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

        \[\leadsto \color{blue}{x} \]
      4. Step-by-step derivation
        1. Simplified69.2%

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

        if -4e9 < (-.f64 (+.f64 x (cos.f64 y)) (*.f64 z (sin.f64 y))) < 0.97999999999999998

        1. Initial program 100.0%

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

            \[\leadsto \color{blue}{\left(x + \cos y\right) + \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) + \left(x + \cos y\right)} \]
          3. *-commutativeN/A

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(0 - \sin y, z, \color{blue}{\cos y}\right) \]
        6. Step-by-step derivation
          1. cos-lowering-cos.f6496.0

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

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

          \[\leadsto \color{blue}{\cos y} \]
        9. Step-by-step derivation
          1. cos-lowering-cos.f6496.0

            \[\leadsto \color{blue}{\cos y} \]
        10. Simplified96.0%

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

        if 0.97999999999999998 < (-.f64 (+.f64 x (cos.f64 y)) (*.f64 z (sin.f64 y)))

        1. Initial program 99.9%

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

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

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

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

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

            \[\leadsto \color{blue}{x - \left(y \cdot z - 1\right)} \]
          5. --lowering--.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. accelerator-lowering-fma.f6477.1

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

          \[\leadsto \color{blue}{x - \mathsf{fma}\left(y, z, -1\right)} \]
      5. Recombined 3 regimes into one program.
      6. Final simplification76.8%

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

      Alternative 4: 99.9% accurate, 1.0× speedup?

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

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

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

      Alternative 5: 81.3% accurate, 1.8× speedup?

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

        1. Initial program 99.8%

          \[\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. +-lowering-+.f64N/A

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

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

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

        if -6.5e11 < y < 1.99999999999999991e-6

        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. +-lowering-+.f64N/A

            \[\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)} \]
          2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -650000000000:\\ \;\;\;\;x + \cos y\\ \mathbf{elif}\;y \leq 2 \cdot 10^{-6}:\\ \;\;\;\;1 + \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(z, y \cdot 0.16666666666666666, -0.5\right), 0\right) - z, x\right)\\ \mathbf{else}:\\ \;\;\;\;x + \cos y\\ \end{array} \]
      5. Add Preprocessing

      Alternative 6: 70.7% accurate, 5.0× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -750000000000:\\ \;\;\;\;x + 1\\ \mathbf{elif}\;y \leq 240:\\ \;\;\;\;1 + \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(z, y \cdot 0.16666666666666666, -0.5\right), 0\right) - z, x\right)\\ \mathbf{else}:\\ \;\;\;\;x + 1\\ \end{array} \end{array} \]
      (FPCore (x y z)
       :precision binary64
       (if (<= y -750000000000.0)
         (+ x 1.0)
         (if (<= y 240.0)
           (+ 1.0 (fma y (- (fma y (fma z (* y 0.16666666666666666) -0.5) 0.0) z) x))
           (+ x 1.0))))
      double code(double x, double y, double z) {
      	double tmp;
      	if (y <= -750000000000.0) {
      		tmp = x + 1.0;
      	} else if (y <= 240.0) {
      		tmp = 1.0 + fma(y, (fma(y, fma(z, (y * 0.16666666666666666), -0.5), 0.0) - z), x);
      	} else {
      		tmp = x + 1.0;
      	}
      	return tmp;
      }
      
      function code(x, y, z)
      	tmp = 0.0
      	if (y <= -750000000000.0)
      		tmp = Float64(x + 1.0);
      	elseif (y <= 240.0)
      		tmp = Float64(1.0 + fma(y, Float64(fma(y, fma(z, Float64(y * 0.16666666666666666), -0.5), 0.0) - z), x));
      	else
      		tmp = Float64(x + 1.0);
      	end
      	return tmp
      end
      
      code[x_, y_, z_] := If[LessEqual[y, -750000000000.0], N[(x + 1.0), $MachinePrecision], If[LessEqual[y, 240.0], N[(1.0 + N[(y * N[(N[(y * N[(z * N[(y * 0.16666666666666666), $MachinePrecision] + -0.5), $MachinePrecision] + 0.0), $MachinePrecision] - z), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(x + 1.0), $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;y \leq -750000000000:\\
      \;\;\;\;x + 1\\
      
      \mathbf{elif}\;y \leq 240:\\
      \;\;\;\;1 + \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(z, y \cdot 0.16666666666666666, -0.5\right), 0\right) - z, x\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;x + 1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if y < -7.5e11 or 240 < 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. +-commutativeN/A

            \[\leadsto \color{blue}{x + 1} \]
          2. +-lowering-+.f6444.2

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

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

        if -7.5e11 < y < 240

        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. +-lowering-+.f64N/A

            \[\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)} \]
          2. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 7: 69.8% accurate, 9.6× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -3.6 \cdot 10^{+114}:\\ \;\;\;\;x + 1\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{+68}:\\ \;\;\;\;x - \mathsf{fma}\left(y, z, -1\right)\\ \mathbf{else}:\\ \;\;\;\;x + 1\\ \end{array} \end{array} \]
      (FPCore (x y z)
       :precision binary64
       (if (<= y -3.6e+114)
         (+ x 1.0)
         (if (<= y 1.05e+68) (- x (fma y z -1.0)) (+ x 1.0))))
      double code(double x, double y, double z) {
      	double tmp;
      	if (y <= -3.6e+114) {
      		tmp = x + 1.0;
      	} else if (y <= 1.05e+68) {
      		tmp = x - fma(y, z, -1.0);
      	} else {
      		tmp = x + 1.0;
      	}
      	return tmp;
      }
      
      function code(x, y, z)
      	tmp = 0.0
      	if (y <= -3.6e+114)
      		tmp = Float64(x + 1.0);
      	elseif (y <= 1.05e+68)
      		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, -3.6e+114], N[(x + 1.0), $MachinePrecision], If[LessEqual[y, 1.05e+68], N[(x - N[(y * z + -1.0), $MachinePrecision]), $MachinePrecision], N[(x + 1.0), $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;y \leq -3.6 \cdot 10^{+114}:\\
      \;\;\;\;x + 1\\
      
      \mathbf{elif}\;y \leq 1.05 \cdot 10^{+68}:\\
      \;\;\;\;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 < -3.6000000000000001e114 or 1.05e68 < 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. +-commutativeN/A

            \[\leadsto \color{blue}{x + 1} \]
          2. +-lowering-+.f6446.4

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

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

        if -3.6000000000000001e114 < y < 1.05e68

        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. --lowering--.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. accelerator-lowering-fma.f6489.1

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

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

      Alternative 8: 64.3% accurate, 14.1× speedup?

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

        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. +-lowering-+.f6469.4

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

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

        if 5.19999999999999986e214 < z

        1. Initial program 99.8%

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

          \[\leadsto \color{blue}{x} - z \cdot \sin y \]
        4. Step-by-step derivation
          1. Simplified95.1%

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

            \[\leadsto x - z \cdot \color{blue}{y} \]
          3. Step-by-step derivation
            1. Simplified53.6%

              \[\leadsto x - z \cdot \color{blue}{y} \]
          4. Recombined 2 regimes into one program.
          5. Final simplification68.2%

            \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 5.2 \cdot 10^{+214}:\\ \;\;\;\;x + 1\\ \mathbf{else}:\\ \;\;\;\;x - y \cdot z\\ \end{array} \]
          6. Add Preprocessing

          Alternative 9: 63.3% accurate, 14.1× speedup?

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

            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. +-lowering-+.f6469.4

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

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

            if 2.05e214 < 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 \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. --lowering--.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. accelerator-lowering-fma.f6458.3

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

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

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

                \[\leadsto \color{blue}{1 - y \cdot z} \]
              2. *-lowering-*.f6447.2

                \[\leadsto 1 - \color{blue}{y \cdot z} \]
            8. Simplified47.2%

              \[\leadsto \color{blue}{1 - y \cdot z} \]
          3. Recombined 2 regimes into one program.
          4. Add Preprocessing

          Alternative 10: 62.0% accurate, 16.3× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -0.95:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 1:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
          (FPCore (x y z) :precision binary64 (if (<= x -0.95) x (if (<= x 1.0) 1.0 x)))
          double code(double x, double y, double z) {
          	double tmp;
          	if (x <= -0.95) {
          		tmp = x;
          	} else if (x <= 1.0) {
          		tmp = 1.0;
          	} else {
          		tmp = x;
          	}
          	return tmp;
          }
          
          real(8) function code(x, y, z)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              real(8), intent (in) :: z
              real(8) :: tmp
              if (x <= (-0.95d0)) then
                  tmp = x
              else if (x <= 1.0d0) then
                  tmp = 1.0d0
              else
                  tmp = x
              end if
              code = tmp
          end function
          
          public static double code(double x, double y, double z) {
          	double tmp;
          	if (x <= -0.95) {
          		tmp = x;
          	} else if (x <= 1.0) {
          		tmp = 1.0;
          	} else {
          		tmp = x;
          	}
          	return tmp;
          }
          
          def code(x, y, z):
          	tmp = 0
          	if x <= -0.95:
          		tmp = x
          	elif x <= 1.0:
          		tmp = 1.0
          	else:
          		tmp = x
          	return tmp
          
          function code(x, y, z)
          	tmp = 0.0
          	if (x <= -0.95)
          		tmp = x;
          	elseif (x <= 1.0)
          		tmp = 1.0;
          	else
          		tmp = x;
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z)
          	tmp = 0.0;
          	if (x <= -0.95)
          		tmp = x;
          	elseif (x <= 1.0)
          		tmp = 1.0;
          	else
          		tmp = x;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_] := If[LessEqual[x, -0.95], x, If[LessEqual[x, 1.0], 1.0, x]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;x \leq -0.95:\\
          \;\;\;\;x\\
          
          \mathbf{elif}\;x \leq 1:\\
          \;\;\;\;1\\
          
          \mathbf{else}:\\
          \;\;\;\;x\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if x < -0.94999999999999996 or 1 < x

            1. Initial program 99.9%

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

              \[\leadsto \color{blue}{x} \]
            4. Step-by-step derivation
              1. Simplified82.4%

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

              if -0.94999999999999996 < x < 1

              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. --lowering--.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. accelerator-lowering-fma.f6447.5

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

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

                \[\leadsto x - \color{blue}{-1} \]
              7. Step-by-step derivation
                1. Simplified40.8%

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

                  \[\leadsto \color{blue}{1} \]
                3. Step-by-step derivation
                  1. Simplified40.8%

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

                Alternative 11: 62.8% 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. +-lowering-+.f6465.9

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

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

                Alternative 12: 21.7% 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 + \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. --lowering--.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. accelerator-lowering-fma.f6464.2

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

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

                  \[\leadsto x - \color{blue}{-1} \]
                7. Step-by-step derivation
                  1. Simplified65.9%

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

                    \[\leadsto \color{blue}{1} \]
                  3. Step-by-step derivation
                    1. Simplified18.6%

                      \[\leadsto \color{blue}{1} \]
                    2. Add Preprocessing

                    Reproduce

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