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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 98.7% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t\_0 \leq 40000:\\
\;\;\;\;\mathsf{fma}\left(1, z, \mathsf{fma}\left(x, \frac{\sin y}{x}, x\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 (+.f64 x (sin.f64 y)) (*.f64 z (cos.f64 y))) < -4.99999999999999973e33 or 4e4 < (+.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. Step-by-step derivation
      1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

      if -4.99999999999999973e33 < (+.f64 (+.f64 x (sin.f64 y)) (*.f64 z (cos.f64 y))) < 4e4

      1. Initial program 100.0%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\cos y, z, \color{blue}{x \cdot \left(1 + \frac{\sin y}{x}\right)}\right) \]
      6. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \mathsf{fma}\left(\cos y, z, x \cdot \color{blue}{\left(\frac{\sin y}{x} + 1\right)}\right) \]
        2. distribute-lft-inN/A

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

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

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

          \[\leadsto \mathsf{fma}\left(\cos y, z, \mathsf{fma}\left(x, \color{blue}{\frac{\sin y}{x}}, x\right)\right) \]
        6. sin-lowering-sin.f6499.8

          \[\leadsto \mathsf{fma}\left(\cos y, z, \mathsf{fma}\left(x, \frac{\color{blue}{\sin y}}{x}, x\right)\right) \]
      7. Simplified99.8%

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

        \[\leadsto \mathsf{fma}\left(\color{blue}{1}, z, \mathsf{fma}\left(x, \frac{\sin y}{x}, x\right)\right) \]
      9. Step-by-step derivation
        1. Simplified99.8%

          \[\leadsto \mathsf{fma}\left(\color{blue}{1}, z, \mathsf{fma}\left(x, \frac{\sin y}{x}, x\right)\right) \]
      10. Recombined 2 regimes into one program.
      11. Final simplification99.8%

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

      Alternative 3: 66.6% accurate, 0.5× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \cos y \cdot z + \left(x + \sin y\right)\\ \mathbf{if}\;t\_0 \leq -0.001:\\ \;\;\;\;z + x\\ \mathbf{elif}\;t\_0 \leq 4 \cdot 10^{-6}:\\ \;\;\;\;y + x\\ \mathbf{else}:\\ \;\;\;\;z + x\\ \end{array} \end{array} \]
      (FPCore (x y z)
       :precision binary64
       (let* ((t_0 (+ (* (cos y) z) (+ x (sin y)))))
         (if (<= t_0 -0.001) (+ z x) (if (<= t_0 4e-6) (+ y x) (+ z x)))))
      double code(double x, double y, double z) {
      	double t_0 = (cos(y) * z) + (x + sin(y));
      	double tmp;
      	if (t_0 <= -0.001) {
      		tmp = z + x;
      	} else if (t_0 <= 4e-6) {
      		tmp = y + x;
      	} 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) :: t_0
          real(8) :: tmp
          t_0 = (cos(y) * z) + (x + sin(y))
          if (t_0 <= (-0.001d0)) then
              tmp = z + x
          else if (t_0 <= 4d-6) then
              tmp = y + x
          else
              tmp = z + x
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z) {
      	double t_0 = (Math.cos(y) * z) + (x + Math.sin(y));
      	double tmp;
      	if (t_0 <= -0.001) {
      		tmp = z + x;
      	} else if (t_0 <= 4e-6) {
      		tmp = y + x;
      	} else {
      		tmp = z + x;
      	}
      	return tmp;
      }
      
      def code(x, y, z):
      	t_0 = (math.cos(y) * z) + (x + math.sin(y))
      	tmp = 0
      	if t_0 <= -0.001:
      		tmp = z + x
      	elif t_0 <= 4e-6:
      		tmp = y + x
      	else:
      		tmp = z + x
      	return tmp
      
      function code(x, y, z)
      	t_0 = Float64(Float64(cos(y) * z) + Float64(x + sin(y)))
      	tmp = 0.0
      	if (t_0 <= -0.001)
      		tmp = Float64(z + x);
      	elseif (t_0 <= 4e-6)
      		tmp = Float64(y + x);
      	else
      		tmp = Float64(z + x);
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z)
      	t_0 = (cos(y) * z) + (x + sin(y));
      	tmp = 0.0;
      	if (t_0 <= -0.001)
      		tmp = z + x;
      	elseif (t_0 <= 4e-6)
      		tmp = y + x;
      	else
      		tmp = z + x;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_] := Block[{t$95$0 = N[(N[(N[Cos[y], $MachinePrecision] * z), $MachinePrecision] + N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -0.001], N[(z + x), $MachinePrecision], If[LessEqual[t$95$0, 4e-6], N[(y + x), $MachinePrecision], N[(z + x), $MachinePrecision]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := \cos y \cdot z + \left(x + \sin y\right)\\
      \mathbf{if}\;t\_0 \leq -0.001:\\
      \;\;\;\;z + x\\
      
      \mathbf{elif}\;t\_0 \leq 4 \cdot 10^{-6}:\\
      \;\;\;\;y + x\\
      
      \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))) < -1e-3 or 3.99999999999999982e-6 < (+.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. +-lowering-+.f6469.5

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

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

        if -1e-3 < (+.f64 (+.f64 x (sin.f64 y)) (*.f64 z (cos.f64 y))) < 3.99999999999999982e-6

        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 \left(x + z\right) + y \cdot \color{blue}{\left(\frac{-1}{2} \cdot \left(y \cdot z\right) + 1\right)} \]
          3. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto y + \color{blue}{\mathsf{fma}\left(z, \frac{-1}{2} \cdot {y}^{2} + 1, x\right)} \]
        5. Simplified99.3%

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

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

            \[\leadsto y + \color{blue}{x} \]
        8. Recombined 2 regimes into one program.
        9. Final simplification71.0%

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

        Alternative 4: 83.7% accurate, 1.7× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \cos y \cdot z\\ \mathbf{if}\;z \leq -8 \cdot 10^{+71}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 4.9 \cdot 10^{-29}:\\ \;\;\;\;x + \sin y\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{+134}:\\ \;\;\;\;z + x\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
        (FPCore (x y z)
         :precision binary64
         (let* ((t_0 (* (cos y) z)))
           (if (<= z -8e+71)
             t_0
             (if (<= z 4.9e-29) (+ x (sin y)) (if (<= z 3.4e+134) (+ z x) t_0)))))
        double code(double x, double y, double z) {
        	double t_0 = cos(y) * z;
        	double tmp;
        	if (z <= -8e+71) {
        		tmp = t_0;
        	} else if (z <= 4.9e-29) {
        		tmp = x + sin(y);
        	} else if (z <= 3.4e+134) {
        		tmp = z + 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 <= (-8d+71)) then
                tmp = t_0
            else if (z <= 4.9d-29) then
                tmp = x + sin(y)
            else if (z <= 3.4d+134) then
                tmp = z + 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 <= -8e+71) {
        		tmp = t_0;
        	} else if (z <= 4.9e-29) {
        		tmp = x + Math.sin(y);
        	} else if (z <= 3.4e+134) {
        		tmp = z + x;
        	} else {
        		tmp = t_0;
        	}
        	return tmp;
        }
        
        def code(x, y, z):
        	t_0 = math.cos(y) * z
        	tmp = 0
        	if z <= -8e+71:
        		tmp = t_0
        	elif z <= 4.9e-29:
        		tmp = x + math.sin(y)
        	elif z <= 3.4e+134:
        		tmp = z + x
        	else:
        		tmp = t_0
        	return tmp
        
        function code(x, y, z)
        	t_0 = Float64(cos(y) * z)
        	tmp = 0.0
        	if (z <= -8e+71)
        		tmp = t_0;
        	elseif (z <= 4.9e-29)
        		tmp = Float64(x + sin(y));
        	elseif (z <= 3.4e+134)
        		tmp = Float64(z + 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 <= -8e+71)
        		tmp = t_0;
        	elseif (z <= 4.9e-29)
        		tmp = x + sin(y);
        	elseif (z <= 3.4e+134)
        		tmp = z + 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, -8e+71], t$95$0, If[LessEqual[z, 4.9e-29], N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.4e+134], N[(z + x), $MachinePrecision], t$95$0]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := \cos y \cdot z\\
        \mathbf{if}\;z \leq -8 \cdot 10^{+71}:\\
        \;\;\;\;t\_0\\
        
        \mathbf{elif}\;z \leq 4.9 \cdot 10^{-29}:\\
        \;\;\;\;x + \sin y\\
        
        \mathbf{elif}\;z \leq 3.4 \cdot 10^{+134}:\\
        \;\;\;\;z + x\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_0\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if z < -8.0000000000000003e71 or 3.40000000000000018e134 < z

          1. Initial program 99.9%

            \[\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. +-rgt-identityN/A

              \[\leadsto \color{blue}{z \cdot \cos y + 0} \]
            2. accelerator-lowering-fma.f64N/A

              \[\leadsto \color{blue}{\mathsf{fma}\left(z, \cos y, 0\right)} \]
            3. cos-lowering-cos.f6480.7

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

            \[\leadsto \color{blue}{\mathsf{fma}\left(z, \cos y, 0\right)} \]
          6. Step-by-step derivation
            1. +-rgt-identityN/A

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

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

              \[\leadsto \color{blue}{\cos y \cdot z} \]
            4. cos-lowering-cos.f6480.7

              \[\leadsto \color{blue}{\cos y} \cdot z \]
          7. Applied egg-rr80.7%

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

          if -8.0000000000000003e71 < z < 4.8999999999999998e-29

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

              \[\leadsto \color{blue}{\sin y + x} \]
            3. sin-lowering-sin.f6492.0

              \[\leadsto \color{blue}{\sin y} + x \]
          5. Simplified92.0%

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

          if 4.8999999999999998e-29 < z < 3.40000000000000018e134

          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. +-lowering-+.f6490.7

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

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8 \cdot 10^{+71}:\\ \;\;\;\;\cos y \cdot z\\ \mathbf{elif}\;z \leq 4.9 \cdot 10^{-29}:\\ \;\;\;\;x + \sin y\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{+134}:\\ \;\;\;\;z + x\\ \mathbf{else}:\\ \;\;\;\;\cos y \cdot z\\ \end{array} \]
        5. Add Preprocessing

        Alternative 5: 95.3% accurate, 1.8× speedup?

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

          1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

            if -8.500000000000001e-5 < z < 6.60000000000000055e-29

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

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

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

              \[\leadsto \color{blue}{\sin y + x} \]
          7. Recombined 2 regimes into one program.
          8. Final simplification98.4%

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

          Alternative 6: 81.3% accurate, 1.8× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := x + \sin y\\ \mathbf{if}\;y \leq -650000000000:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq 2 \cdot 10^{-6}:\\ \;\;\;\;y + \mathsf{fma}\left(z, \mathsf{fma}\left(y, y \cdot -0.5, 1\right), x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
          (FPCore (x y z)
           :precision binary64
           (let* ((t_0 (+ x (sin y))))
             (if (<= y -650000000000.0)
               t_0
               (if (<= y 2e-6) (+ y (fma z (fma y (* y -0.5) 1.0) x)) t_0))))
          double code(double x, double y, double z) {
          	double t_0 = x + sin(y);
          	double tmp;
          	if (y <= -650000000000.0) {
          		tmp = t_0;
          	} else if (y <= 2e-6) {
          		tmp = y + fma(z, fma(y, (y * -0.5), 1.0), x);
          	} else {
          		tmp = t_0;
          	}
          	return tmp;
          }
          
          function code(x, y, z)
          	t_0 = Float64(x + sin(y))
          	tmp = 0.0
          	if (y <= -650000000000.0)
          		tmp = t_0;
          	elseif (y <= 2e-6)
          		tmp = Float64(y + fma(z, fma(y, Float64(y * -0.5), 1.0), x));
          	else
          		tmp = t_0;
          	end
          	return tmp
          end
          
          code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -650000000000.0], t$95$0, If[LessEqual[y, 2e-6], N[(y + N[(z * N[(y * N[(y * -0.5), $MachinePrecision] + 1.0), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], t$95$0]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := x + \sin y\\
          \mathbf{if}\;y \leq -650000000000:\\
          \;\;\;\;t\_0\\
          
          \mathbf{elif}\;y \leq 2 \cdot 10^{-6}:\\
          \;\;\;\;y + \mathsf{fma}\left(z, \mathsf{fma}\left(y, y \cdot -0.5, 1\right), 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 + \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. +-lowering-+.f64N/A

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

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

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

            if -6.5e11 < y < 1.99999999999999991e-6

            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 \left(x + z\right) + y \cdot \color{blue}{\left(\frac{-1}{2} \cdot \left(y \cdot z\right) + 1\right)} \]
              3. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          Alternative 7: 71.1% accurate, 5.4× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -980000000000:\\ \;\;\;\;z + x\\ \mathbf{elif}\;y \leq 132000000:\\ \;\;\;\;x + \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, -0.16666666666666666, z \cdot -0.5\right), 1\right), z\right)\\ \mathbf{else}:\\ \;\;\;\;z + x\\ \end{array} \end{array} \]
          (FPCore (x y z)
           :precision binary64
           (if (<= y -980000000000.0)
             (+ z x)
             (if (<= y 132000000.0)
               (+ x (fma y (fma y (fma y -0.16666666666666666 (* z -0.5)) 1.0) z))
               (+ z x))))
          double code(double x, double y, double z) {
          	double tmp;
          	if (y <= -980000000000.0) {
          		tmp = z + x;
          	} else if (y <= 132000000.0) {
          		tmp = x + fma(y, fma(y, fma(y, -0.16666666666666666, (z * -0.5)), 1.0), z);
          	} else {
          		tmp = z + x;
          	}
          	return tmp;
          }
          
          function code(x, y, z)
          	tmp = 0.0
          	if (y <= -980000000000.0)
          		tmp = Float64(z + x);
          	elseif (y <= 132000000.0)
          		tmp = Float64(x + fma(y, fma(y, fma(y, -0.16666666666666666, Float64(z * -0.5)), 1.0), z));
          	else
          		tmp = Float64(z + x);
          	end
          	return tmp
          end
          
          code[x_, y_, z_] := If[LessEqual[y, -980000000000.0], N[(z + x), $MachinePrecision], If[LessEqual[y, 132000000.0], N[(x + N[(y * N[(y * N[(y * -0.16666666666666666 + N[(z * -0.5), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision], N[(z + x), $MachinePrecision]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;y \leq -980000000000:\\
          \;\;\;\;z + x\\
          
          \mathbf{elif}\;y \leq 132000000:\\
          \;\;\;\;x + \mathsf{fma}\left(y, \mathsf{fma}\left(y, \mathsf{fma}\left(y, -0.16666666666666666, z \cdot -0.5\right), 1\right), z\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;z + x\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if y < -9.8e11 or 1.32e8 < y

            1. Initial program 99.8%

              \[\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. +-lowering-+.f6445.1

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

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

            if -9.8e11 < y < 1.32e8

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

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

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

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

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

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

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

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

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

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

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

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

          Alternative 8: 70.9% accurate, 6.4× speedup?

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

            1. Initial program 99.8%

              \[\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. +-lowering-+.f6444.5

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

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

            if -8.6e11 < y < 4.60000000000000021e33

            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 \left(x + z\right) + y \cdot \color{blue}{\left(\frac{-1}{2} \cdot \left(y \cdot z\right) + 1\right)} \]
              3. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto y + \color{blue}{\mathsf{fma}\left(z, \frac{-1}{2} \cdot {y}^{2} + 1, x\right)} \]
            5. Simplified98.4%

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

          Alternative 9: 50.0% accurate, 9.6× speedup?

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

            1. Initial program 99.9%

              \[\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. +-rgt-identityN/A

                \[\leadsto \color{blue}{z \cdot \cos y + 0} \]
              2. accelerator-lowering-fma.f64N/A

                \[\leadsto \color{blue}{\mathsf{fma}\left(z, \cos y, 0\right)} \]
              3. cos-lowering-cos.f6486.9

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

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

              \[\leadsto \color{blue}{z} \]
            7. Step-by-step derivation
              1. Simplified50.1%

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

              if -1.17999999999999997e132 < z < 1.2e-274

              1. Initial program 99.9%

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

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

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

                if 1.2e-274 < z < 3.40000000000000011e138

                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 \left(x + z\right) + y \cdot \color{blue}{\left(\frac{-1}{2} \cdot \left(y \cdot z\right) + 1\right)} \]
                  3. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                Alternative 10: 70.7% accurate, 11.1× speedup?

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

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

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

                  if -2.7e14 < y < 1.4e68

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

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

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

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

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

                      \[\leadsto y + \color{blue}{\left(z + x\right)} \]
                    6. +-lowering-+.f6495.1

                      \[\leadsto y + \color{blue}{\left(z + x\right)} \]
                  5. Simplified95.1%

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

                Alternative 11: 52.0% accurate, 16.3× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -6.1 \cdot 10^{+131}:\\ \;\;\;\;z\\ \mathbf{elif}\;z \leq 2.4 \cdot 10^{+132}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;z\\ \end{array} \end{array} \]
                (FPCore (x y z)
                 :precision binary64
                 (if (<= z -6.1e+131) z (if (<= z 2.4e+132) x z)))
                double code(double x, double y, double z) {
                	double tmp;
                	if (z <= -6.1e+131) {
                		tmp = z;
                	} else if (z <= 2.4e+132) {
                		tmp = x;
                	} else {
                		tmp = 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 <= (-6.1d+131)) then
                        tmp = z
                    else if (z <= 2.4d+132) then
                        tmp = x
                    else
                        tmp = z
                    end if
                    code = tmp
                end function
                
                public static double code(double x, double y, double z) {
                	double tmp;
                	if (z <= -6.1e+131) {
                		tmp = z;
                	} else if (z <= 2.4e+132) {
                		tmp = x;
                	} else {
                		tmp = z;
                	}
                	return tmp;
                }
                
                def code(x, y, z):
                	tmp = 0
                	if z <= -6.1e+131:
                		tmp = z
                	elif z <= 2.4e+132:
                		tmp = x
                	else:
                		tmp = z
                	return tmp
                
                function code(x, y, z)
                	tmp = 0.0
                	if (z <= -6.1e+131)
                		tmp = z;
                	elseif (z <= 2.4e+132)
                		tmp = x;
                	else
                		tmp = z;
                	end
                	return tmp
                end
                
                function tmp_2 = code(x, y, z)
                	tmp = 0.0;
                	if (z <= -6.1e+131)
                		tmp = z;
                	elseif (z <= 2.4e+132)
                		tmp = x;
                	else
                		tmp = z;
                	end
                	tmp_2 = tmp;
                end
                
                code[x_, y_, z_] := If[LessEqual[z, -6.1e+131], z, If[LessEqual[z, 2.4e+132], x, z]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;z \leq -6.1 \cdot 10^{+131}:\\
                \;\;\;\;z\\
                
                \mathbf{elif}\;z \leq 2.4 \cdot 10^{+132}:\\
                \;\;\;\;x\\
                
                \mathbf{else}:\\
                \;\;\;\;z\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if z < -6.0999999999999999e131 or 2.4000000000000001e132 < z

                  1. Initial program 99.9%

                    \[\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. +-rgt-identityN/A

                      \[\leadsto \color{blue}{z \cdot \cos y + 0} \]
                    2. accelerator-lowering-fma.f64N/A

                      \[\leadsto \color{blue}{\mathsf{fma}\left(z, \cos y, 0\right)} \]
                    3. cos-lowering-cos.f6486.9

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

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

                    \[\leadsto \color{blue}{z} \]
                  7. Step-by-step derivation
                    1. Simplified50.1%

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

                    if -6.0999999999999999e131 < z < 2.4000000000000001e132

                    1. Initial program 99.9%

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

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

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

                    Alternative 12: 45.2% accurate, 16.3× speedup?

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

                      1. Initial program 99.9%

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

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

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

                        if -6.50000000000000019e-194 < x < 6.19999999999999999e-93

                        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 + \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 \left(x + z\right) + y \cdot \color{blue}{\left(\frac{-1}{2} \cdot \left(y \cdot z\right) + 1\right)} \]
                          3. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto y + \color{blue}{\mathsf{fma}\left(z, \frac{-1}{2} \cdot {y}^{2} + 1, x\right)} \]
                        5. Simplified55.8%

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

                          \[\leadsto \color{blue}{{y}^{2} \cdot \left(\frac{-1}{2} \cdot z + \frac{1}{y}\right)} \]
                        7. Step-by-step derivation
                          1. distribute-lft-inN/A

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

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

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

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

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

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

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

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

                            \[\leadsto \left(\frac{-1}{2} \cdot \left(y \cdot z\right)\right) \cdot y + \color{blue}{\left(\frac{1}{y} \cdot y\right) \cdot y} \]
                          10. lft-mult-inverseN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto y \cdot \mathsf{fma}\left(z, \color{blue}{y \cdot \frac{-1}{2}}, 1\right) \]
                          25. *-lowering-*.f6423.3

                            \[\leadsto y \cdot \mathsf{fma}\left(z, \color{blue}{y \cdot -0.5}, 1\right) \]
                        8. Simplified23.3%

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

                          \[\leadsto \color{blue}{y} \]
                        10. Step-by-step derivation
                          1. Simplified24.3%

                            \[\leadsto \color{blue}{y} \]
                        11. Recombined 2 regimes into one program.
                        12. Add Preprocessing

                        Alternative 13: 43.2% accurate, 212.0× speedup?

                        \[\begin{array}{l} \\ x \end{array} \]
                        (FPCore (x y z) :precision binary64 x)
                        double code(double x, double y, double z) {
                        	return x;
                        }
                        
                        real(8) function code(x, y, z)
                            real(8), intent (in) :: x
                            real(8), intent (in) :: y
                            real(8), intent (in) :: z
                            code = x
                        end function
                        
                        public static double code(double x, double y, double z) {
                        	return x;
                        }
                        
                        def code(x, y, z):
                        	return x
                        
                        function code(x, y, z)
                        	return x
                        end
                        
                        function tmp = code(x, y, z)
                        	tmp = x;
                        end
                        
                        code[x_, y_, z_] := x
                        
                        \begin{array}{l}
                        
                        \\
                        x
                        \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 inf

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

                            \[\leadsto \color{blue}{x} \]
                          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, C"
                            :precision binary64
                            (+ (+ x (sin y)) (* z (cos y))))