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

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

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 12 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 99.9% accurate, 1.0× speedup?

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

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

Alternative 1: 99.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(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: 83.4% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := z \cdot \cos y\\ \mathbf{if}\;z \leq -7.2 \cdot 10^{+41}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq 1.85 \cdot 10^{-40}:\\ \;\;\;\;x + \sin y\\ \mathbf{elif}\;z \leq 3.3 \cdot 10^{+165}:\\ \;\;\;\;x + z\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* z (cos y))))
   (if (<= z -7.2e+41)
     t_0
     (if (<= z 1.85e-40) (+ x (sin y)) (if (<= z 3.3e+165) (+ x z) t_0)))))
double code(double x, double y, double z) {
	double t_0 = z * cos(y);
	double tmp;
	if (z <= -7.2e+41) {
		tmp = t_0;
	} else if (z <= 1.85e-40) {
		tmp = x + sin(y);
	} else if (z <= 3.3e+165) {
		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 <= (-7.2d+41)) then
        tmp = t_0
    else if (z <= 1.85d-40) then
        tmp = x + sin(y)
    else if (z <= 3.3d+165) 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 <= -7.2e+41) {
		tmp = t_0;
	} else if (z <= 1.85e-40) {
		tmp = x + Math.sin(y);
	} else if (z <= 3.3e+165) {
		tmp = x + z;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = z * math.cos(y)
	tmp = 0
	if z <= -7.2e+41:
		tmp = t_0
	elif z <= 1.85e-40:
		tmp = x + math.sin(y)
	elif z <= 3.3e+165:
		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 <= -7.2e+41)
		tmp = t_0;
	elseif (z <= 1.85e-40)
		tmp = Float64(x + sin(y));
	elseif (z <= 3.3e+165)
		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 <= -7.2e+41)
		tmp = t_0;
	elseif (z <= 1.85e-40)
		tmp = x + sin(y);
	elseif (z <= 3.3e+165)
		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, -7.2e+41], t$95$0, If[LessEqual[z, 1.85e-40], N[(x + N[Sin[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.3e+165], N[(x + z), $MachinePrecision], t$95$0]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := z \cdot \cos y\\
\mathbf{if}\;z \leq -7.2 \cdot 10^{+41}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq 1.85 \cdot 10^{-40}:\\
\;\;\;\;x + \sin y\\

\mathbf{elif}\;z \leq 3.3 \cdot 10^{+165}:\\
\;\;\;\;x + z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -7.20000000000000051e41 or 3.2999999999999999e165 < 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 \mathsf{*.f64}\left(z, \color{blue}{\cos y}\right) \]
      2. cos-lowering-cos.f6483.9%

        \[\leadsto \mathsf{*.f64}\left(z, \mathsf{cos.f64}\left(y\right)\right) \]
    5. Simplified83.9%

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

    if -7.20000000000000051e41 < z < 1.84999999999999999e-40

    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 \sin y + \color{blue}{x} \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\sin y, \color{blue}{x}\right) \]
      3. sin-lowering-sin.f6488.6%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{sin.f64}\left(y\right), x\right) \]
    5. Simplified88.6%

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

    if 1.84999999999999999e-40 < z < 3.2999999999999999e165

    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 z + \color{blue}{x} \]
      2. +-lowering-+.f6480.9%

        \[\leadsto \mathsf{+.f64}\left(z, \color{blue}{x}\right) \]
    5. Simplified80.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.2 \cdot 10^{+41}:\\ \;\;\;\;z \cdot \cos y\\ \mathbf{elif}\;z \leq 1.85 \cdot 10^{-40}:\\ \;\;\;\;x + \sin y\\ \mathbf{elif}\;z \leq 3.3 \cdot 10^{+165}:\\ \;\;\;\;x + z\\ \mathbf{else}:\\ \;\;\;\;z \cdot \cos y\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 69.8% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := z \cdot \cos y\\ \mathbf{if}\;z \leq -4 \cdot 10^{+43}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;z \leq -7.8 \cdot 10^{-162}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{+164}:\\ \;\;\;\;y + \left(x + z\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (* z (cos y))))
   (if (<= z -4e+43)
     t_0
     (if (<= z -7.8e-162) (+ x z) (if (<= z 4.5e+164) (+ y (+ x z)) t_0)))))
double code(double x, double y, double z) {
	double t_0 = z * cos(y);
	double tmp;
	if (z <= -4e+43) {
		tmp = t_0;
	} else if (z <= -7.8e-162) {
		tmp = x + z;
	} else if (z <= 4.5e+164) {
		tmp = y + (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 <= (-4d+43)) then
        tmp = t_0
    else if (z <= (-7.8d-162)) then
        tmp = x + z
    else if (z <= 4.5d+164) then
        tmp = y + (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 <= -4e+43) {
		tmp = t_0;
	} else if (z <= -7.8e-162) {
		tmp = x + z;
	} else if (z <= 4.5e+164) {
		tmp = y + (x + z);
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = z * math.cos(y)
	tmp = 0
	if z <= -4e+43:
		tmp = t_0
	elif z <= -7.8e-162:
		tmp = x + z
	elif z <= 4.5e+164:
		tmp = y + (x + z)
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = Float64(z * cos(y))
	tmp = 0.0
	if (z <= -4e+43)
		tmp = t_0;
	elseif (z <= -7.8e-162)
		tmp = Float64(x + z);
	elseif (z <= 4.5e+164)
		tmp = Float64(y + 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 <= -4e+43)
		tmp = t_0;
	elseif (z <= -7.8e-162)
		tmp = x + z;
	elseif (z <= 4.5e+164)
		tmp = y + (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, -4e+43], t$95$0, If[LessEqual[z, -7.8e-162], N[(x + z), $MachinePrecision], If[LessEqual[z, 4.5e+164], N[(y + N[(x + z), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := z \cdot \cos y\\
\mathbf{if}\;z \leq -4 \cdot 10^{+43}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq -7.8 \cdot 10^{-162}:\\
\;\;\;\;x + z\\

\mathbf{elif}\;z \leq 4.5 \cdot 10^{+164}:\\
\;\;\;\;y + \left(x + z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.00000000000000006e43 or 4.49999999999999975e164 < 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 \mathsf{*.f64}\left(z, \color{blue}{\cos y}\right) \]
      2. cos-lowering-cos.f6483.9%

        \[\leadsto \mathsf{*.f64}\left(z, \mathsf{cos.f64}\left(y\right)\right) \]
    5. Simplified83.9%

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

    if -4.00000000000000006e43 < z < -7.7999999999999999e-162

    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 z + \color{blue}{x} \]
      2. +-lowering-+.f6476.0%

        \[\leadsto \mathsf{+.f64}\left(z, \color{blue}{x}\right) \]
    5. Simplified76.0%

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

    if -7.7999999999999999e-162 < z < 4.49999999999999975e164

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

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

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

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

        \[\leadsto \mathsf{+.f64}\left(y, \left(z + \color{blue}{x}\right)\right) \]
      6. +-lowering-+.f6475.5%

        \[\leadsto \mathsf{+.f64}\left(y, \mathsf{+.f64}\left(z, \color{blue}{x}\right)\right) \]
    5. Simplified75.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4 \cdot 10^{+43}:\\ \;\;\;\;z \cdot \cos y\\ \mathbf{elif}\;z \leq -7.8 \cdot 10^{-162}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{+164}:\\ \;\;\;\;y + \left(x + z\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \cos y\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 99.4% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
t_0 := x + z \cdot \cos y\\
\mathbf{if}\;z \leq -0.8:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;z \leq 0.75:\\
\;\;\;\;\left(x + \sin y\right) + z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -0.80000000000000004 or 0.75 < z

    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 \mathsf{+.f64}\left(\color{blue}{x}, \mathsf{*.f64}\left(z, \mathsf{cos.f64}\left(y\right)\right)\right) \]
    4. Step-by-step derivation
      1. Simplified98.6%

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

      if -0.80000000000000004 < z < 0.75

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

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

      Alternative 5: 94.5% accurate, 1.8× speedup?

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

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

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

          if -4.59999999999999988e-97 < z < 7.99999999999999962e-44

          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 \sin y + \color{blue}{x} \]
            2. +-lowering-+.f64N/A

              \[\leadsto \mathsf{+.f64}\left(\sin y, \color{blue}{x}\right) \]
            3. sin-lowering-sin.f6493.1%

              \[\leadsto \mathsf{+.f64}\left(\mathsf{sin.f64}\left(y\right), x\right) \]
          5. Simplified93.1%

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.6 \cdot 10^{-97}:\\ \;\;\;\;x + z \cdot \cos y\\ \mathbf{elif}\;z \leq 8 \cdot 10^{-44}:\\ \;\;\;\;x + \sin y\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot \cos y\\ \end{array} \]
        7. Add Preprocessing

        Alternative 6: 70.4% accurate, 7.7× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.3 \cdot 10^{+26}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;y \leq 4.8:\\ \;\;\;\;\left(x + z\right) + y \cdot \left(1 + y \cdot \left(z \cdot -0.5 + y \cdot -0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x + z\\ \end{array} \end{array} \]
        (FPCore (x y z)
         :precision binary64
         (if (<= y -1.3e+26)
           (+ x z)
           (if (<= y 4.8)
             (+ (+ x z) (* y (+ 1.0 (* y (+ (* z -0.5) (* y -0.16666666666666666))))))
             (+ x z))))
        double code(double x, double y, double z) {
        	double tmp;
        	if (y <= -1.3e+26) {
        		tmp = x + z;
        	} else if (y <= 4.8) {
        		tmp = (x + z) + (y * (1.0 + (y * ((z * -0.5) + (y * -0.16666666666666666)))));
        	} 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 <= (-1.3d+26)) then
                tmp = x + z
            else if (y <= 4.8d0) then
                tmp = (x + z) + (y * (1.0d0 + (y * ((z * (-0.5d0)) + (y * (-0.16666666666666666d0))))))
            else
                tmp = x + z
            end if
            code = tmp
        end function
        
        public static double code(double x, double y, double z) {
        	double tmp;
        	if (y <= -1.3e+26) {
        		tmp = x + z;
        	} else if (y <= 4.8) {
        		tmp = (x + z) + (y * (1.0 + (y * ((z * -0.5) + (y * -0.16666666666666666)))));
        	} else {
        		tmp = x + z;
        	}
        	return tmp;
        }
        
        def code(x, y, z):
        	tmp = 0
        	if y <= -1.3e+26:
        		tmp = x + z
        	elif y <= 4.8:
        		tmp = (x + z) + (y * (1.0 + (y * ((z * -0.5) + (y * -0.16666666666666666)))))
        	else:
        		tmp = x + z
        	return tmp
        
        function code(x, y, z)
        	tmp = 0.0
        	if (y <= -1.3e+26)
        		tmp = Float64(x + z);
        	elseif (y <= 4.8)
        		tmp = Float64(Float64(x + z) + Float64(y * Float64(1.0 + Float64(y * Float64(Float64(z * -0.5) + Float64(y * -0.16666666666666666))))));
        	else
        		tmp = Float64(x + z);
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y, z)
        	tmp = 0.0;
        	if (y <= -1.3e+26)
        		tmp = x + z;
        	elseif (y <= 4.8)
        		tmp = (x + z) + (y * (1.0 + (y * ((z * -0.5) + (y * -0.16666666666666666)))));
        	else
        		tmp = x + z;
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_, z_] := If[LessEqual[y, -1.3e+26], N[(x + z), $MachinePrecision], If[LessEqual[y, 4.8], N[(N[(x + z), $MachinePrecision] + N[(y * N[(1.0 + N[(y * N[(N[(z * -0.5), $MachinePrecision] + N[(y * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + z), $MachinePrecision]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;y \leq -1.3 \cdot 10^{+26}:\\
        \;\;\;\;x + z\\
        
        \mathbf{elif}\;y \leq 4.8:\\
        \;\;\;\;\left(x + z\right) + y \cdot \left(1 + y \cdot \left(z \cdot -0.5 + y \cdot -0.16666666666666666\right)\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;x + z\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if y < -1.30000000000000001e26 or 4.79999999999999982 < 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 z + \color{blue}{x} \]
            2. +-lowering-+.f6441.8%

              \[\leadsto \mathsf{+.f64}\left(z, \color{blue}{x}\right) \]
          5. Simplified41.8%

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

          if -1.30000000000000001e26 < y < 4.79999999999999982

          1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(z, x\right), \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\mathsf{*.f64}\left(z, \frac{-1}{2}\right), \left(y \cdot \color{blue}{\frac{-1}{6}}\right)\right)\right)\right)\right)\right) \]
            12. *-lowering-*.f6498.7%

              \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(z, x\right), \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(y, \mathsf{+.f64}\left(\mathsf{*.f64}\left(z, \frac{-1}{2}\right), \mathsf{*.f64}\left(y, \color{blue}{\frac{-1}{6}}\right)\right)\right)\right)\right)\right) \]
          5. Simplified98.7%

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.3 \cdot 10^{+26}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;y \leq 4.8:\\ \;\;\;\;\left(x + z\right) + y \cdot \left(1 + y \cdot \left(z \cdot -0.5 + y \cdot -0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x + z\\ \end{array} \]
        5. Add Preprocessing

        Alternative 7: 70.4% accurate, 13.8× speedup?

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

              \[\leadsto \mathsf{+.f64}\left(z, \color{blue}{x}\right) \]
          5. Simplified43.1%

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

          if -5.8000000000000004e46 < y < 340

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

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

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

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

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

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

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

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

        Alternative 8: 67.5% accurate, 15.9× speedup?

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

          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 z + \color{blue}{x} \]
            2. +-lowering-+.f6478.8%

              \[\leadsto \mathsf{+.f64}\left(z, \color{blue}{x}\right) \]
          5. Simplified78.8%

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

          if -3.4000000000000001e-189 < x < 8.19999999999999998e-61

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

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

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

              \[\leadsto \mathsf{+.f64}\left(\mathsf{sin.f64}\left(y\right), \mathsf{*.f64}\left(z, \color{blue}{\cos y}\right)\right) \]
            4. cos-lowering-cos.f6498.5%

              \[\leadsto \mathsf{+.f64}\left(\mathsf{sin.f64}\left(y\right), \mathsf{*.f64}\left(z, \mathsf{cos.f64}\left(y\right)\right)\right) \]
          5. Simplified98.5%

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

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

              \[\leadsto \mathsf{+.f64}\left(y, \color{blue}{z}\right) \]
          8. Simplified52.9%

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.4 \cdot 10^{-189}:\\ \;\;\;\;x + z\\ \mathbf{elif}\;x \leq 8.2 \cdot 10^{-61}:\\ \;\;\;\;y + z\\ \mathbf{else}:\\ \;\;\;\;x + z\\ \end{array} \]
        5. Add Preprocessing

        Alternative 9: 58.2% accurate, 15.9× speedup?

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

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

            if -3.1e12 < x < 2.50000000000000001e-42

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

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

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

                \[\leadsto \mathsf{+.f64}\left(\mathsf{sin.f64}\left(y\right), \mathsf{*.f64}\left(z, \color{blue}{\cos y}\right)\right) \]
              4. cos-lowering-cos.f6493.9%

                \[\leadsto \mathsf{+.f64}\left(\mathsf{sin.f64}\left(y\right), \mathsf{*.f64}\left(z, \mathsf{cos.f64}\left(y\right)\right)\right) \]
            5. Simplified93.9%

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

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

                \[\leadsto \mathsf{+.f64}\left(y, \color{blue}{z}\right) \]
            8. Simplified48.2%

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

          Alternative 10: 55.0% accurate, 18.8× speedup?

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

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

              if -2.55e14 < x < 4.00000000000000031e-43

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

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

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

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{sin.f64}\left(y\right), \mathsf{*.f64}\left(z, \color{blue}{\cos y}\right)\right) \]
                4. cos-lowering-cos.f6494.0%

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{sin.f64}\left(y\right), \mathsf{*.f64}\left(z, \mathsf{cos.f64}\left(y\right)\right)\right) \]
              5. Simplified94.0%

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

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

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

              Alternative 11: 44.2% accurate, 18.8× speedup?

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

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

                  if -7.49999999999999989e-132 < x < 2.04999999999999996e-44

                  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. distribute-rgt-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{+.f64}\left(y, x\right), \mathsf{*.f64}\left(z, \mathsf{+.f64}\left(1, \left(\frac{-1}{2} \cdot \left(y \cdot \color{blue}{y}\right)\right)\right)\right)\right) \]
                  5. Simplified47.9%

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

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

                      \[\leadsto y + \color{blue}{x} \]
                    2. +-lowering-+.f6417.4%

                      \[\leadsto \mathsf{+.f64}\left(y, \color{blue}{x}\right) \]
                  8. Simplified17.4%

                    \[\leadsto \color{blue}{y + x} \]
                  9. Taylor expanded in y around inf

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

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

                  Alternative 12: 42.8% accurate, 207.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. Simplified46.1%

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

                    Reproduce

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