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

Percentage Accurate: 99.9% → 99.9%
Time: 7.7s
Alternatives: 12
Speedup: 1.0×

Specification

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

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

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

Alternative 1: 99.9% accurate, 1.0× speedup?

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

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

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

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

Alternative 2: 80.9% accurate, 0.2× speedup?

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

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

\mathbf{elif}\;t\_0 \leq -0.1:\\
\;\;\;\;\sin y\\

\mathbf{elif}\;t\_0 \leq 10^{-20}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666 \cdot y, y, 1\right), y, z + x\right)\\

\mathbf{elif}\;t\_0 \leq 1:\\
\;\;\;\;\sin y\\

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


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

    1. Initial program 99.9%

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

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

        \[\leadsto \color{blue}{z + x} \]
      2. lower-+.f6479.6

        \[\leadsto \color{blue}{z + x} \]
    5. Applied rewrites79.6%

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

    if -50 < (+.f64 (+.f64 x (sin.f64 y)) (*.f64 z (cos.f64 y))) < -0.10000000000000001 or 9.99999999999999945e-21 < (+.f64 (+.f64 x (sin.f64 y)) (*.f64 z (cos.f64 y))) < 1

    1. Initial program 100.0%

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

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

        \[\leadsto \color{blue}{z \cdot \cos y + \sin y} \]
      2. *-commutativeN/A

        \[\leadsto \color{blue}{\cos y \cdot z} + \sin y \]
      3. lower-fma.f64N/A

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

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

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

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

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

        \[\leadsto \sin y \]

      if -0.10000000000000001 < (+.f64 (+.f64 x (sin.f64 y)) (*.f64 z (cos.f64 y))) < 9.99999999999999945e-21

      1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 3: 70.3% accurate, 0.5× speedup?

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

        1. Initial program 99.9%

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

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

            \[\leadsto \color{blue}{z + x} \]
          2. lower-+.f6468.5

            \[\leadsto \color{blue}{z + x} \]
        5. Applied rewrites68.5%

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

        if -0.10000000000000001 < (+.f64 (+.f64 x (sin.f64 y)) (*.f64 z (cos.f64 y))) < 5.0000000000000001e-4

        1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 4: 89.2% accurate, 1.0× speedup?

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

          1. Initial program 100.0%

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

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

              \[\leadsto \color{blue}{z + x} \]
            2. lower-+.f6492.7

              \[\leadsto \color{blue}{z + x} \]
          5. Applied rewrites92.7%

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

          if -5.99999999999999966e-18 < x < 2.05e9

          1. Initial program 99.9%

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

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

              \[\leadsto \color{blue}{z \cdot \cos y + \sin y} \]
            2. *-commutativeN/A

              \[\leadsto \color{blue}{\cos y \cdot z} + \sin y \]
            3. lower-fma.f64N/A

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

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

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

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

        Alternative 5: 84.3% accurate, 1.7× speedup?

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

          1. Initial program 99.8%

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

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

              \[\leadsto \color{blue}{\cos y \cdot z} \]
            2. lower-*.f64N/A

              \[\leadsto \color{blue}{\cos y \cdot z} \]
            3. lower-cos.f6482.8

              \[\leadsto \color{blue}{\cos y} \cdot z \]
          5. Applied rewrites82.8%

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

          if -9.99999999999999921e133 < z < -3.80000000000000015e-7

          1. Initial program 100.0%

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

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

              \[\leadsto \color{blue}{z + x} \]
            2. lower-+.f6488.0

              \[\leadsto \color{blue}{z + x} \]
          5. Applied rewrites88.0%

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

          if -3.80000000000000015e-7 < z < 3.8000000000000001e31

          1. Initial program 100.0%

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

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

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

              \[\leadsto \color{blue}{\sin y + x} \]
            3. lower-sin.f6491.8

              \[\leadsto \color{blue}{\sin y} + x \]
          5. Applied rewrites91.8%

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

        Alternative 6: 79.6% accurate, 1.8× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin y + x\\ \mathbf{if}\;y \leq -1.65 \cdot 10^{+43}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq 1.1 \cdot 10^{+28}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, y, -0.5 \cdot z\right), y, 1\right), y, z + x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
        (FPCore (x y z)
         :precision binary64
         (let* ((t_0 (+ (sin y) x)))
           (if (<= y -1.65e+43)
             t_0
             (if (<= y 1.1e+28)
               (fma (fma (fma -0.16666666666666666 y (* -0.5 z)) y 1.0) y (+ z x))
               t_0))))
        double code(double x, double y, double z) {
        	double t_0 = sin(y) + x;
        	double tmp;
        	if (y <= -1.65e+43) {
        		tmp = t_0;
        	} else if (y <= 1.1e+28) {
        		tmp = fma(fma(fma(-0.16666666666666666, y, (-0.5 * z)), y, 1.0), y, (z + x));
        	} else {
        		tmp = t_0;
        	}
        	return tmp;
        }
        
        function code(x, y, z)
        	t_0 = Float64(sin(y) + x)
        	tmp = 0.0
        	if (y <= -1.65e+43)
        		tmp = t_0;
        	elseif (y <= 1.1e+28)
        		tmp = fma(fma(fma(-0.16666666666666666, y, Float64(-0.5 * z)), y, 1.0), y, Float64(z + x));
        	else
        		tmp = t_0;
        	end
        	return tmp
        end
        
        code[x_, y_, z_] := Block[{t$95$0 = N[(N[Sin[y], $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[y, -1.65e+43], t$95$0, If[LessEqual[y, 1.1e+28], N[(N[(N[(-0.16666666666666666 * y + N[(-0.5 * z), $MachinePrecision]), $MachinePrecision] * y + 1.0), $MachinePrecision] * y + N[(z + x), $MachinePrecision]), $MachinePrecision], t$95$0]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := \sin y + x\\
        \mathbf{if}\;y \leq -1.65 \cdot 10^{+43}:\\
        \;\;\;\;t\_0\\
        
        \mathbf{elif}\;y \leq 1.1 \cdot 10^{+28}:\\
        \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, y, -0.5 \cdot z\right), y, 1\right), y, z + x\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_0\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if y < -1.6500000000000001e43 or 1.09999999999999993e28 < y

          1. Initial program 99.9%

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

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

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

              \[\leadsto \color{blue}{\sin y + x} \]
            3. lower-sin.f6471.1

              \[\leadsto \color{blue}{\sin y} + x \]
          5. Applied rewrites71.1%

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

          if -1.6500000000000001e43 < y < 1.09999999999999993e28

          1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 7: 70.1% accurate, 5.4× speedup?

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

          1. Initial program 99.9%

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

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

              \[\leadsto \color{blue}{z + x} \]
            2. lower-+.f6444.3

              \[\leadsto \color{blue}{z + x} \]
          5. Applied rewrites44.3%

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

          if -1.6500000000000001e43 < y < 17.5

          1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 8: 69.9% accurate, 6.4× speedup?

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

          1. Initial program 99.9%

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

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

              \[\leadsto \color{blue}{z + x} \]
            2. lower-+.f6445.2

              \[\leadsto \color{blue}{z + x} \]
          5. Applied rewrites45.2%

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

          if -1.7500000000000001e43 < y < 3.5999999999999999e46

          1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 9: 69.6% accurate, 11.1× speedup?

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

          1. Initial program 99.9%

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

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

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

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

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

          if -2.79999999999999998e113 < y < 1.35e67

          1. Initial program 100.0%

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

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

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

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

              \[\leadsto \color{blue}{\left(y + x\right)} + z \]
            4. lower-+.f6490.2

              \[\leadsto \color{blue}{\left(y + x\right)} + z \]
          5. Applied rewrites90.2%

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

        Alternative 10: 68.1% accurate, 13.2× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.15 \cdot 10^{-129}:\\ \;\;\;\;z + x\\ \mathbf{elif}\;x \leq 3.7 \cdot 10^{-144}:\\ \;\;\;\;z + y\\ \mathbf{else}:\\ \;\;\;\;z + x\\ \end{array} \end{array} \]
        (FPCore (x y z)
         :precision binary64
         (if (<= x -2.15e-129) (+ z x) (if (<= x 3.7e-144) (+ z y) (+ z x))))
        double code(double x, double y, double z) {
        	double tmp;
        	if (x <= -2.15e-129) {
        		tmp = z + x;
        	} else if (x <= 3.7e-144) {
        		tmp = z + y;
        	} else {
        		tmp = z + 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 <= (-2.15d-129)) then
                tmp = z + x
            else if (x <= 3.7d-144) then
                tmp = z + y
            else
                tmp = z + x
            end if
            code = tmp
        end function
        
        public static double code(double x, double y, double z) {
        	double tmp;
        	if (x <= -2.15e-129) {
        		tmp = z + x;
        	} else if (x <= 3.7e-144) {
        		tmp = z + y;
        	} else {
        		tmp = z + x;
        	}
        	return tmp;
        }
        
        def code(x, y, z):
        	tmp = 0
        	if x <= -2.15e-129:
        		tmp = z + x
        	elif x <= 3.7e-144:
        		tmp = z + y
        	else:
        		tmp = z + x
        	return tmp
        
        function code(x, y, z)
        	tmp = 0.0
        	if (x <= -2.15e-129)
        		tmp = Float64(z + x);
        	elseif (x <= 3.7e-144)
        		tmp = Float64(z + y);
        	else
        		tmp = Float64(z + x);
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y, z)
        	tmp = 0.0;
        	if (x <= -2.15e-129)
        		tmp = z + x;
        	elseif (x <= 3.7e-144)
        		tmp = z + y;
        	else
        		tmp = z + x;
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_, z_] := If[LessEqual[x, -2.15e-129], N[(z + x), $MachinePrecision], If[LessEqual[x, 3.7e-144], N[(z + y), $MachinePrecision], N[(z + x), $MachinePrecision]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;x \leq -2.15 \cdot 10^{-129}:\\
        \;\;\;\;z + x\\
        
        \mathbf{elif}\;x \leq 3.7 \cdot 10^{-144}:\\
        \;\;\;\;z + y\\
        
        \mathbf{else}:\\
        \;\;\;\;z + x\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if x < -2.1499999999999999e-129 or 3.7000000000000003e-144 < x

          1. Initial program 100.0%

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

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

              \[\leadsto \color{blue}{z + x} \]
            2. lower-+.f6477.3

              \[\leadsto \color{blue}{z + x} \]
          5. Applied rewrites77.3%

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

          if -2.1499999999999999e-129 < x < 3.7000000000000003e-144

          1. Initial program 99.9%

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

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

              \[\leadsto \color{blue}{z \cdot \cos y + \sin y} \]
            2. *-commutativeN/A

              \[\leadsto \color{blue}{\cos y \cdot z} + \sin y \]
            3. lower-fma.f64N/A

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

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

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

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

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

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

          Alternative 11: 49.8% accurate, 13.2× speedup?

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

            1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto x + \color{blue}{y} \]
            7. Step-by-step derivation
              1. Applied rewrites65.0%

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

              if -3e-11 < x < 9.99999999999999983e72

              1. Initial program 99.9%

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

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

                  \[\leadsto \color{blue}{z \cdot \cos y + \sin y} \]
                2. *-commutativeN/A

                  \[\leadsto \color{blue}{\cos y \cdot z} + \sin y \]
                3. lower-fma.f64N/A

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

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

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

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

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

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

              Alternative 12: 29.5% accurate, 53.0× speedup?

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

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

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

                  \[\leadsto \color{blue}{z \cdot \cos y + \sin y} \]
                2. *-commutativeN/A

                  \[\leadsto \color{blue}{\cos y \cdot z} + \sin y \]
                3. lower-fma.f64N/A

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

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

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

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

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

                  \[\leadsto z + \color{blue}{y} \]
                2. Add Preprocessing

                Reproduce

                ?
                herbie shell --seed 2024278 
                (FPCore (x y z)
                  :name "Graphics.Rasterific.Svg.PathConverter:segmentToBezier from rasterific-svg-0.2.3.1, C"
                  :precision binary64
                  (+ (+ x (sin y)) (* z (cos y))))