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

Percentage Accurate: 99.9% → 99.9%
Time: 9.4s
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} \\ \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}
Derivation
  1. Initial program 99.9%

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

Alternative 2: 81.6% accurate, 0.2× speedup?

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

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

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

\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-5}:\\
\;\;\;\;y + \left(x + z\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 (+.f64 x (sin.f64 y)) (*.f64 z (cos.f64 y))) < -400 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. +-lowering-+.f6476.8

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

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

    if -400 < (+.f64 (+.f64 x (sin.f64 y)) (*.f64 z (cos.f64 y))) < -0.10000000000000001 or 5.00000000000000024e-5 < (+.f64 (+.f64 x (sin.f64 y)) (*.f64 z (cos.f64 y))) < 1

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

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

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{\cos y}, \sin y\right) \]
      4. sin-lowering-sin.f6496.8

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

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

      \[\leadsto \color{blue}{\sin y} \]
    7. Step-by-step derivation
      1. sin-lowering-sin.f6496.2

        \[\leadsto \color{blue}{\sin y} \]
    8. Simplified96.2%

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

    if -0.10000000000000001 < (+.f64 (+.f64 x (sin.f64 y)) (*.f64 z (cos.f64 y))) < 5.00000000000000024e-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(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-+.f64100.0

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

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

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

Alternative 3: 99.0% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t\_2 \leq 500000:\\
\;\;\;\;t\_0 + z\\

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


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

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

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

      if -1e20 < (+.f64 (+.f64 x (sin.f64 y)) (*.f64 z (cos.f64 y))) < 5e5

      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 \left(x + \sin y\right) + \color{blue}{z} \]
      4. Step-by-step derivation
        1. Simplified99.6%

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

      Alternative 4: 84.9% accurate, 1.6× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := z \cdot \cos y\\ \mathbf{if}\;z \leq -1.6 \cdot 10^{+99}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -3.8 \cdot 10^{-22}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{-71}:\\ \;\;\;\;x + \sin y\\ \mathbf{elif}\;z \leq 3.5 \cdot 10^{+134}:\\ \;\;\;\;x + z\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
      (FPCore (x y z)
       :precision binary64
       (let* ((t_0 (* z (cos y))))
         (if (<= z -1.6e+99)
           t_0
           (if (<= z -3.8e-22)
             (+ x z)
             (if (<= z 7.2e-71) (+ x (sin y)) (if (<= z 3.5e+134) (+ x z) t_0))))))
      double code(double x, double y, double z) {
      	double t_0 = z * cos(y);
      	double tmp;
      	if (z <= -1.6e+99) {
      		tmp = t_0;
      	} else if (z <= -3.8e-22) {
      		tmp = x + z;
      	} else if (z <= 7.2e-71) {
      		tmp = x + sin(y);
      	} else if (z <= 3.5e+134) {
      		tmp = x + z;
      	} else {
      		tmp = t_0;
      	}
      	return tmp;
      }
      
      real(8) function code(x, y, z)
          real(8), intent (in) :: x
          real(8), intent (in) :: y
          real(8), intent (in) :: z
          real(8) :: t_0
          real(8) :: tmp
          t_0 = z * cos(y)
          if (z <= (-1.6d+99)) then
              tmp = t_0
          else if (z <= (-3.8d-22)) then
              tmp = x + z
          else if (z <= 7.2d-71) then
              tmp = x + sin(y)
          else if (z <= 3.5d+134) then
              tmp = x + z
          else
              tmp = t_0
          end if
          code = tmp
      end function
      
      public static double code(double x, double y, double z) {
      	double t_0 = z * Math.cos(y);
      	double tmp;
      	if (z <= -1.6e+99) {
      		tmp = t_0;
      	} else if (z <= -3.8e-22) {
      		tmp = x + z;
      	} else if (z <= 7.2e-71) {
      		tmp = x + Math.sin(y);
      	} else if (z <= 3.5e+134) {
      		tmp = x + z;
      	} else {
      		tmp = t_0;
      	}
      	return tmp;
      }
      
      def code(x, y, z):
      	t_0 = z * math.cos(y)
      	tmp = 0
      	if z <= -1.6e+99:
      		tmp = t_0
      	elif z <= -3.8e-22:
      		tmp = x + z
      	elif z <= 7.2e-71:
      		tmp = x + math.sin(y)
      	elif z <= 3.5e+134:
      		tmp = x + z
      	else:
      		tmp = t_0
      	return tmp
      
      function code(x, y, z)
      	t_0 = Float64(z * cos(y))
      	tmp = 0.0
      	if (z <= -1.6e+99)
      		tmp = t_0;
      	elseif (z <= -3.8e-22)
      		tmp = Float64(x + z);
      	elseif (z <= 7.2e-71)
      		tmp = Float64(x + sin(y));
      	elseif (z <= 3.5e+134)
      		tmp = Float64(x + z);
      	else
      		tmp = t_0;
      	end
      	return tmp
      end
      
      function tmp_2 = code(x, y, z)
      	t_0 = z * cos(y);
      	tmp = 0.0;
      	if (z <= -1.6e+99)
      		tmp = t_0;
      	elseif (z <= -3.8e-22)
      		tmp = x + z;
      	elseif (z <= 7.2e-71)
      		tmp = x + sin(y);
      	elseif (z <= 3.5e+134)
      		tmp = x + z;
      	else
      		tmp = t_0;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[Cos[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.6e+99], t$95$0, If[LessEqual[z, -3.8e-22], N[(x + z), $MachinePrecision], If[LessEqual[z, 7.2e-71], N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.5e+134], N[(x + z), $MachinePrecision], t$95$0]]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := z \cdot \cos y\\
      \mathbf{if}\;z \leq -1.6 \cdot 10^{+99}:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;z \leq -3.8 \cdot 10^{-22}:\\
      \;\;\;\;x + z\\
      
      \mathbf{elif}\;z \leq 7.2 \cdot 10^{-71}:\\
      \;\;\;\;x + \sin y\\
      
      \mathbf{elif}\;z \leq 3.5 \cdot 10^{+134}:\\
      \;\;\;\;x + z\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if z < -1.6e99 or 3.50000000000000003e134 < 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. *-lowering-*.f64N/A

            \[\leadsto \color{blue}{z \cdot \cos y} \]
          2. cos-lowering-cos.f6482.0

            \[\leadsto z \cdot \color{blue}{\cos y} \]
        5. Simplified82.0%

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

        if -1.6e99 < z < -3.80000000000000023e-22 or 7.2e-71 < z < 3.50000000000000003e134

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

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

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

        if -3.80000000000000023e-22 < z < 7.2e-71

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

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.6 \cdot 10^{+99}:\\ \;\;\;\;z \cdot \cos y\\ \mathbf{elif}\;z \leq -3.8 \cdot 10^{-22}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{-71}:\\ \;\;\;\;x + \sin y\\ \mathbf{elif}\;z \leq 3.5 \cdot 10^{+134}:\\ \;\;\;\;x + z\\ \mathbf{else}:\\ \;\;\;\;z \cdot \cos y\\ \end{array} \]
      5. Add Preprocessing

      Alternative 5: 89.5% accurate, 1.8× speedup?

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

            \[\leadsto \color{blue}{z \cdot \cos y} \]
          2. cos-lowering-cos.f6482.0

            \[\leadsto z \cdot \color{blue}{\cos y} \]
        5. Simplified82.0%

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

        if -3.60000000000000001e104 < z < 3.59999999999999978e133

        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 \left(x + \sin y\right) + \color{blue}{z} \]
        4. Step-by-step derivation
          1. Simplified95.5%

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

        Alternative 6: 81.5% accurate, 1.8× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := x + \sin y\\ \mathbf{if}\;y \leq -52000000:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq 0.025:\\ \;\;\;\;z + \mathsf{fma}\left(y, \mathsf{fma}\left(y, z \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 -52000000.0)
             t_0
             (if (<= y 0.025) (+ z (fma y (fma y (* z -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 <= -52000000.0) {
        		tmp = t_0;
        	} else if (y <= 0.025) {
        		tmp = z + fma(y, fma(y, (z * -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 <= -52000000.0)
        		tmp = t_0;
        	elseif (y <= 0.025)
        		tmp = Float64(z + fma(y, fma(y, Float64(z * -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, -52000000.0], t$95$0, If[LessEqual[y, 0.025], N[(z + N[(y * N[(y * N[(z * -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 -52000000:\\
        \;\;\;\;t\_0\\
        
        \mathbf{elif}\;y \leq 0.025:\\
        \;\;\;\;z + \mathsf{fma}\left(y, \mathsf{fma}\left(y, z \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 < -5.2e7 or 0.025000000000000001 < 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. +-lowering-+.f64N/A

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

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

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

          if -5.2e7 < y < 0.025000000000000001

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 7: 69.5% accurate, 6.4× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -4.7:\\ \;\;\;\;x + z\\ \mathbf{elif}\;y \leq 2.5 \cdot 10^{-64}:\\ \;\;\;\;z + \mathsf{fma}\left(y, \mathsf{fma}\left(y, z \cdot -0.5, 1\right), x\right)\\ \mathbf{else}:\\ \;\;\;\;x + z\\ \end{array} \end{array} \]
        (FPCore (x y z)
         :precision binary64
         (if (<= y -4.7)
           (+ x z)
           (if (<= y 2.5e-64) (+ z (fma y (fma y (* z -0.5) 1.0) x)) (+ x z))))
        double code(double x, double y, double z) {
        	double tmp;
        	if (y <= -4.7) {
        		tmp = x + z;
        	} else if (y <= 2.5e-64) {
        		tmp = z + fma(y, fma(y, (z * -0.5), 1.0), x);
        	} else {
        		tmp = x + z;
        	}
        	return tmp;
        }
        
        function code(x, y, z)
        	tmp = 0.0
        	if (y <= -4.7)
        		tmp = Float64(x + z);
        	elseif (y <= 2.5e-64)
        		tmp = Float64(z + fma(y, fma(y, Float64(z * -0.5), 1.0), x));
        	else
        		tmp = Float64(x + z);
        	end
        	return tmp
        end
        
        code[x_, y_, z_] := If[LessEqual[y, -4.7], N[(x + z), $MachinePrecision], If[LessEqual[y, 2.5e-64], N[(z + N[(y * N[(y * N[(z * -0.5), $MachinePrecision] + 1.0), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(x + z), $MachinePrecision]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;y \leq -4.7:\\
        \;\;\;\;x + z\\
        
        \mathbf{elif}\;y \leq 2.5 \cdot 10^{-64}:\\
        \;\;\;\;z + \mathsf{fma}\left(y, \mathsf{fma}\left(y, z \cdot -0.5, 1\right), x\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;x + z\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if y < -4.70000000000000018 or 2.50000000000000017e-64 < 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-+.f6448.6

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

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

          if -4.70000000000000018 < y < 2.50000000000000017e-64

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 8: 70.3% accurate, 11.1× speedup?

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

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

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

          if -2.0500000000000001e27 < y < 9e90

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

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

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.05 \cdot 10^{+27}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;y \leq 9 \cdot 10^{+90}:\\ \;\;\;\;y + \left(x + z\right)\\ \mathbf{else}:\\ \;\;\;\;x + z\\ \end{array} \]
        5. Add Preprocessing

        Alternative 9: 68.1% accurate, 13.2× speedup?

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

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

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

          if -5.79999999999999995e-72 < x < 3.60000000000000003e-171

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

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

              \[\leadsto \mathsf{fma}\left(z, \color{blue}{\cos y}, \sin y\right) \]
            4. sin-lowering-sin.f6498.8

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

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

            \[\leadsto \color{blue}{y + z} \]
          7. Step-by-step derivation
            1. +-lowering-+.f6451.1

              \[\leadsto \color{blue}{y + z} \]
          8. Simplified51.1%

            \[\leadsto \color{blue}{y + z} \]
        3. Recombined 2 regimes into one program.
        4. Final simplification69.9%

          \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5.8 \cdot 10^{-72}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;x \leq 3.6 \cdot 10^{-171}:\\ \;\;\;\;y + z\\ \mathbf{else}:\\ \;\;\;\;x + z\\ \end{array} \]
        5. Add Preprocessing

        Alternative 10: 57.9% accurate, 13.2× speedup?

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

          1. Initial program 100.0%

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

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

            if -6.0000000000000002e-62 < x < 5.4999999999999999e-64

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

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

                \[\leadsto \mathsf{fma}\left(z, \color{blue}{\cos y}, \sin y\right) \]
              4. sin-lowering-sin.f6497.1

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

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

              \[\leadsto \color{blue}{y + z} \]
            7. Step-by-step derivation
              1. +-lowering-+.f6448.8

                \[\leadsto \color{blue}{y + z} \]
            8. Simplified48.8%

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

          Alternative 11: 54.6% accurate, 16.3× speedup?

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

            1. Initial program 100.0%

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

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

              if -5.50000000000000022e-62 < x < 5.4999999999999999e-64

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

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

                  \[\leadsto z \cdot \color{blue}{\cos y} \]
              5. Simplified58.4%

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

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

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

              Alternative 12: 44.6% accurate, 16.3× speedup?

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

                1. Initial program 100.0%

                  \[\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. Simplified58.5%

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

                  if -8.0000000000000004e-114 < x < 4.99999999999999992e-171

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

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

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

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

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

                    \[\leadsto \color{blue}{\sin y} \]
                  7. Step-by-step derivation
                    1. sin-lowering-sin.f6442.9

                      \[\leadsto \color{blue}{\sin y} \]
                  8. Simplified42.9%

                    \[\leadsto \color{blue}{\sin y} \]
                  9. Taylor expanded in y around 0

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

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

                  Alternative 13: 42.3% 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. Simplified43.3%

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

                    Reproduce

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