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

Percentage Accurate: 99.9% → 99.9%
Time: 12.8s
Alternatives: 10
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 10 alternatives:

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

Initial Program: 99.9% accurate, 1.0× speedup?

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

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

Alternative 1: 99.9% accurate, 1.0× speedup?

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

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

    \[\left(x + \cos y\right) - z \cdot \sin y \]
  2. Step-by-step derivation
    1. associate--l+99.9%

      \[\leadsto \color{blue}{x + \left(\cos y - z \cdot \sin y\right)} \]
  3. Simplified99.9%

    \[\leadsto \color{blue}{x + \left(\cos y - z \cdot \sin y\right)} \]
  4. Add Preprocessing
  5. Final simplification99.9%

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

Alternative 2: 98.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -3.4 \cdot 10^{-7} \lor \neg \left(x \leq 4 \cdot 10^{-53}\right):\\ \;\;\;\;x + \left(1 - z \cdot \sin y\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(\frac{\cos y}{z} - \sin y\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= x -3.4e-7) (not (<= x 4e-53)))
   (+ x (- 1.0 (* z (sin y))))
   (* z (- (/ (cos y) z) (sin y)))))
double code(double x, double y, double z) {
	double tmp;
	if ((x <= -3.4e-7) || !(x <= 4e-53)) {
		tmp = x + (1.0 - (z * sin(y)));
	} else {
		tmp = z * ((cos(y) / z) - sin(y));
	}
	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-7)) .or. (.not. (x <= 4d-53))) then
        tmp = x + (1.0d0 - (z * sin(y)))
    else
        tmp = z * ((cos(y) / z) - sin(y))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((x <= -3.4e-7) || !(x <= 4e-53)) {
		tmp = x + (1.0 - (z * Math.sin(y)));
	} else {
		tmp = z * ((Math.cos(y) / z) - Math.sin(y));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (x <= -3.4e-7) or not (x <= 4e-53):
		tmp = x + (1.0 - (z * math.sin(y)))
	else:
		tmp = z * ((math.cos(y) / z) - math.sin(y))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((x <= -3.4e-7) || !(x <= 4e-53))
		tmp = Float64(x + Float64(1.0 - Float64(z * sin(y))));
	else
		tmp = Float64(z * Float64(Float64(cos(y) / z) - sin(y)));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((x <= -3.4e-7) || ~((x <= 4e-53)))
		tmp = x + (1.0 - (z * sin(y)));
	else
		tmp = z * ((cos(y) / z) - sin(y));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[x, -3.4e-7], N[Not[LessEqual[x, 4e-53]], $MachinePrecision]], N[(x + N[(1.0 - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(N[(N[Cos[y], $MachinePrecision] / z), $MachinePrecision] - N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.4 \cdot 10^{-7} \lor \neg \left(x \leq 4 \cdot 10^{-53}\right):\\
\;\;\;\;x + \left(1 - z \cdot \sin y\right)\\

\mathbf{else}:\\
\;\;\;\;z \cdot \left(\frac{\cos y}{z} - \sin y\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.39999999999999974e-7 or 4.00000000000000012e-53 < x

    1. Initial program 99.9%

      \[\left(x + \cos y\right) - z \cdot \sin y \]
    2. Step-by-step derivation
      1. associate--l+100.0%

        \[\leadsto \color{blue}{x + \left(\cos y - z \cdot \sin y\right)} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{x + \left(\cos y - z \cdot \sin y\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 99.9%

      \[\leadsto x + \color{blue}{z \cdot \left(\frac{\cos y}{z} - \sin y\right)} \]
    6. Taylor expanded in y around 0 98.8%

      \[\leadsto x + z \cdot \left(\color{blue}{\frac{1}{z}} - \sin y\right) \]
    7. Taylor expanded in z around 0 98.8%

      \[\leadsto x + \color{blue}{\left(1 + -1 \cdot \left(z \cdot \sin y\right)\right)} \]
    8. Step-by-step derivation
      1. mul-1-neg98.8%

        \[\leadsto x + \left(1 + \color{blue}{\left(-z \cdot \sin y\right)}\right) \]
      2. unsub-neg98.8%

        \[\leadsto x + \color{blue}{\left(1 - z \cdot \sin y\right)} \]
    9. Simplified98.8%

      \[\leadsto x + \color{blue}{\left(1 - z \cdot \sin y\right)} \]

    if -3.39999999999999974e-7 < x < 4.00000000000000012e-53

    1. Initial program 99.9%

      \[\left(x + \cos y\right) - z \cdot \sin y \]
    2. Step-by-step derivation
      1. associate--l+99.9%

        \[\leadsto \color{blue}{x + \left(\cos y - z \cdot \sin y\right)} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{x + \left(\cos y - z \cdot \sin y\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 99.8%

      \[\leadsto x + \color{blue}{z \cdot \left(\frac{\cos y}{z} - \sin y\right)} \]
    6. Taylor expanded in x around 0 99.8%

      \[\leadsto \color{blue}{z \cdot \left(\frac{\cos y}{z} - \sin y\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification99.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.4 \cdot 10^{-7} \lor \neg \left(x \leq 4 \cdot 10^{-53}\right):\\ \;\;\;\;x + \left(1 - z \cdot \sin y\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(\frac{\cos y}{z} - \sin y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 99.2% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3000000000 \lor \neg \left(z \leq 3.1 \cdot 10^{-6}\right):\\ \;\;\;\;x + \left(1 - z \cdot \sin y\right)\\ \mathbf{else}:\\ \;\;\;\;x + \cos y\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= z -3000000000.0) (not (<= z 3.1e-6)))
   (+ x (- 1.0 (* z (sin y))))
   (+ x (cos y))))
double code(double x, double y, double z) {
	double tmp;
	if ((z <= -3000000000.0) || !(z <= 3.1e-6)) {
		tmp = x + (1.0 - (z * sin(y)));
	} else {
		tmp = x + cos(y);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((z <= (-3000000000.0d0)) .or. (.not. (z <= 3.1d-6))) then
        tmp = x + (1.0d0 - (z * sin(y)))
    else
        tmp = x + cos(y)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((z <= -3000000000.0) || !(z <= 3.1e-6)) {
		tmp = x + (1.0 - (z * Math.sin(y)));
	} else {
		tmp = x + Math.cos(y);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (z <= -3000000000.0) or not (z <= 3.1e-6):
		tmp = x + (1.0 - (z * math.sin(y)))
	else:
		tmp = x + math.cos(y)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((z <= -3000000000.0) || !(z <= 3.1e-6))
		tmp = Float64(x + Float64(1.0 - Float64(z * sin(y))));
	else
		tmp = Float64(x + cos(y));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((z <= -3000000000.0) || ~((z <= 3.1e-6)))
		tmp = x + (1.0 - (z * sin(y)));
	else
		tmp = x + cos(y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[z, -3000000000.0], N[Not[LessEqual[z, 3.1e-6]], $MachinePrecision]], N[(x + N[(1.0 - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3000000000 \lor \neg \left(z \leq 3.1 \cdot 10^{-6}\right):\\
\;\;\;\;x + \left(1 - z \cdot \sin y\right)\\

\mathbf{else}:\\
\;\;\;\;x + \cos y\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3e9 or 3.1e-6 < z

    1. Initial program 99.8%

      \[\left(x + \cos y\right) - z \cdot \sin y \]
    2. Step-by-step derivation
      1. associate--l+99.8%

        \[\leadsto \color{blue}{x + \left(\cos y - z \cdot \sin y\right)} \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{x + \left(\cos y - z \cdot \sin y\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 99.8%

      \[\leadsto x + \color{blue}{z \cdot \left(\frac{\cos y}{z} - \sin y\right)} \]
    6. Taylor expanded in y around 0 98.6%

      \[\leadsto x + z \cdot \left(\color{blue}{\frac{1}{z}} - \sin y\right) \]
    7. Taylor expanded in z around 0 98.7%

      \[\leadsto x + \color{blue}{\left(1 + -1 \cdot \left(z \cdot \sin y\right)\right)} \]
    8. Step-by-step derivation
      1. mul-1-neg98.7%

        \[\leadsto x + \left(1 + \color{blue}{\left(-z \cdot \sin y\right)}\right) \]
      2. unsub-neg98.7%

        \[\leadsto x + \color{blue}{\left(1 - z \cdot \sin y\right)} \]
    9. Simplified98.7%

      \[\leadsto x + \color{blue}{\left(1 - z \cdot \sin y\right)} \]

    if -3e9 < z < 3.1e-6

    1. Initial program 100.0%

      \[\left(x + \cos y\right) - z \cdot \sin y \]
    2. Step-by-step derivation
      1. associate--l+100.0%

        \[\leadsto \color{blue}{x + \left(\cos y - z \cdot \sin y\right)} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{x + \left(\cos y - z \cdot \sin y\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 99.8%

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

        \[\leadsto \color{blue}{\cos y + x} \]
    7. Simplified99.8%

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

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

Alternative 4: 92.7% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -62000000000 \lor \neg \left(z \leq 3.9 \cdot 10^{+62}\right):\\ \;\;\;\;x - z \cdot \sin y\\ \mathbf{else}:\\ \;\;\;\;x + \cos y\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= z -62000000000.0) (not (<= z 3.9e+62)))
   (- x (* z (sin y)))
   (+ x (cos y))))
double code(double x, double y, double z) {
	double tmp;
	if ((z <= -62000000000.0) || !(z <= 3.9e+62)) {
		tmp = x - (z * sin(y));
	} else {
		tmp = x + cos(y);
	}
	return tmp;
}
real(8) function code(x, y, z)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: tmp
    if ((z <= (-62000000000.0d0)) .or. (.not. (z <= 3.9d+62))) then
        tmp = x - (z * sin(y))
    else
        tmp = x + cos(y)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((z <= -62000000000.0) || !(z <= 3.9e+62)) {
		tmp = x - (z * Math.sin(y));
	} else {
		tmp = x + Math.cos(y);
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (z <= -62000000000.0) or not (z <= 3.9e+62):
		tmp = x - (z * math.sin(y))
	else:
		tmp = x + math.cos(y)
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((z <= -62000000000.0) || !(z <= 3.9e+62))
		tmp = Float64(x - Float64(z * sin(y)));
	else
		tmp = Float64(x + cos(y));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((z <= -62000000000.0) || ~((z <= 3.9e+62)))
		tmp = x - (z * sin(y));
	else
		tmp = x + cos(y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[z, -62000000000.0], N[Not[LessEqual[z, 3.9e+62]], $MachinePrecision]], N[(x - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -62000000000 \lor \neg \left(z \leq 3.9 \cdot 10^{+62}\right):\\
\;\;\;\;x - z \cdot \sin y\\

\mathbf{else}:\\
\;\;\;\;x + \cos y\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.2e10 or 3.9e62 < z

    1. Initial program 99.9%

      \[\left(x + \cos y\right) - z \cdot \sin y \]
    2. Step-by-step derivation
      1. associate--l+99.9%

        \[\leadsto \color{blue}{x + \left(\cos y - z \cdot \sin y\right)} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{x + \left(\cos y - z \cdot \sin y\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 91.1%

      \[\leadsto x + \color{blue}{-1 \cdot \left(z \cdot \sin y\right)} \]
    6. Step-by-step derivation
      1. associate-*r*91.1%

        \[\leadsto x + \color{blue}{\left(-1 \cdot z\right) \cdot \sin y} \]
      2. neg-mul-191.1%

        \[\leadsto x + \color{blue}{\left(-z\right)} \cdot \sin y \]
      3. *-commutative91.1%

        \[\leadsto x + \color{blue}{\sin y \cdot \left(-z\right)} \]
    7. Simplified91.1%

      \[\leadsto x + \color{blue}{\sin y \cdot \left(-z\right)} \]

    if -6.2e10 < z < 3.9e62

    1. Initial program 99.9%

      \[\left(x + \cos y\right) - z \cdot \sin y \]
    2. Step-by-step derivation
      1. associate--l+100.0%

        \[\leadsto \color{blue}{x + \left(\cos y - z \cdot \sin y\right)} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{x + \left(\cos y - z \cdot \sin y\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 96.8%

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

        \[\leadsto \color{blue}{\cos y + x} \]
    7. Simplified96.8%

      \[\leadsto \color{blue}{\cos y + x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification94.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -62000000000 \lor \neg \left(z \leq 3.9 \cdot 10^{+62}\right):\\ \;\;\;\;x - z \cdot \sin y\\ \mathbf{else}:\\ \;\;\;\;x + \cos y\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 80.9% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -0.96 \lor \neg \left(y \leq 16000000\right):\\ \;\;\;\;x + \cos y\\ \mathbf{else}:\\ \;\;\;\;x + \left(1 + y \cdot \left(y \cdot -0.5 - z\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= y -0.96) (not (<= y 16000000.0)))
   (+ x (cos y))
   (+ x (+ 1.0 (* y (- (* y -0.5) z))))))
double code(double x, double y, double z) {
	double tmp;
	if ((y <= -0.96) || !(y <= 16000000.0)) {
		tmp = x + cos(y);
	} else {
		tmp = x + (1.0 + (y * ((y * -0.5) - 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 <= (-0.96d0)) .or. (.not. (y <= 16000000.0d0))) then
        tmp = x + cos(y)
    else
        tmp = x + (1.0d0 + (y * ((y * (-0.5d0)) - z)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((y <= -0.96) || !(y <= 16000000.0)) {
		tmp = x + Math.cos(y);
	} else {
		tmp = x + (1.0 + (y * ((y * -0.5) - z)));
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (y <= -0.96) or not (y <= 16000000.0):
		tmp = x + math.cos(y)
	else:
		tmp = x + (1.0 + (y * ((y * -0.5) - z)))
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((y <= -0.96) || !(y <= 16000000.0))
		tmp = Float64(x + cos(y));
	else
		tmp = Float64(x + Float64(1.0 + Float64(y * Float64(Float64(y * -0.5) - z))));
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((y <= -0.96) || ~((y <= 16000000.0)))
		tmp = x + cos(y);
	else
		tmp = x + (1.0 + (y * ((y * -0.5) - z)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[y, -0.96], N[Not[LessEqual[y, 16000000.0]], $MachinePrecision]], N[(x + N[Cos[y], $MachinePrecision]), $MachinePrecision], N[(x + N[(1.0 + N[(y * N[(N[(y * -0.5), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.96 \lor \neg \left(y \leq 16000000\right):\\
\;\;\;\;x + \cos y\\

\mathbf{else}:\\
\;\;\;\;x + \left(1 + y \cdot \left(y \cdot -0.5 - z\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -0.95999999999999996 or 1.6e7 < y

    1. Initial program 99.8%

      \[\left(x + \cos y\right) - z \cdot \sin y \]
    2. Step-by-step derivation
      1. associate--l+99.8%

        \[\leadsto \color{blue}{x + \left(\cos y - z \cdot \sin y\right)} \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{x + \left(\cos y - z \cdot \sin y\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around 0 52.3%

      \[\leadsto \color{blue}{x + \cos y} \]
    6. Step-by-step derivation
      1. +-commutative52.3%

        \[\leadsto \color{blue}{\cos y + x} \]
    7. Simplified52.3%

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

    if -0.95999999999999996 < y < 1.6e7

    1. Initial program 100.0%

      \[\left(x + \cos y\right) - z \cdot \sin y \]
    2. Step-by-step derivation
      1. associate--l+100.0%

        \[\leadsto \color{blue}{x + \left(\cos y - z \cdot \sin y\right)} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{x + \left(\cos y - z \cdot \sin y\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 99.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -0.96 \lor \neg \left(y \leq 16000000\right):\\ \;\;\;\;x + \cos y\\ \mathbf{else}:\\ \;\;\;\;x + \left(1 + y \cdot \left(y \cdot -0.5 - z\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 67.5% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{-5}:\\
\;\;\;\;x + 1\\

\mathbf{elif}\;y \leq 1.2 \cdot 10^{+141}:\\
\;\;\;\;x + \left(1 - y \cdot z\right)\\

\mathbf{else}:\\
\;\;\;\;\cos y\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -9.00000000000000057e-5

    1. Initial program 99.8%

      \[\left(x + \cos y\right) - z \cdot \sin y \]
    2. Step-by-step derivation
      1. associate--l+99.8%

        \[\leadsto \color{blue}{x + \left(\cos y - z \cdot \sin y\right)} \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{x + \left(\cos y - z \cdot \sin y\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 44.1%

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

    if -9.00000000000000057e-5 < y < 1.19999999999999999e141

    1. Initial program 100.0%

      \[\left(x + \cos y\right) - z \cdot \sin y \]
    2. Step-by-step derivation
      1. associate--l+100.0%

        \[\leadsto \color{blue}{x + \left(\cos y - z \cdot \sin y\right)} \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{x + \left(\cos y - z \cdot \sin y\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 99.9%

      \[\leadsto x + \color{blue}{z \cdot \left(\frac{\cos y}{z} - \sin y\right)} \]
    6. Taylor expanded in y around 0 85.4%

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

        \[\leadsto 1 + \color{blue}{\left(-1 \cdot \left(y \cdot z\right) + x\right)} \]
      2. associate-+r+85.4%

        \[\leadsto \color{blue}{\left(1 + -1 \cdot \left(y \cdot z\right)\right) + x} \]
      3. mul-1-neg85.4%

        \[\leadsto \left(1 + \color{blue}{\left(-y \cdot z\right)}\right) + x \]
      4. *-commutative85.4%

        \[\leadsto \left(1 + \left(-\color{blue}{z \cdot y}\right)\right) + x \]
      5. unsub-neg85.4%

        \[\leadsto \color{blue}{\left(1 - z \cdot y\right)} + x \]
      6. *-commutative85.4%

        \[\leadsto \left(1 - \color{blue}{y \cdot z}\right) + x \]
    8. Simplified85.4%

      \[\leadsto \color{blue}{\left(1 - y \cdot z\right) + x} \]

    if 1.19999999999999999e141 < y

    1. Initial program 99.8%

      \[\left(x + \cos y\right) - z \cdot \sin y \]
    2. Step-by-step derivation
      1. associate--l+99.8%

        \[\leadsto \color{blue}{x + \left(\cos y - z \cdot \sin y\right)} \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{x + \left(\cos y - z \cdot \sin y\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-sqr-sqrt58.5%

        \[\leadsto x + \left(\cos y - \color{blue}{\sqrt{z \cdot \sin y} \cdot \sqrt{z \cdot \sin y}}\right) \]
      2. pow258.5%

        \[\leadsto x + \left(\cos y - \color{blue}{{\left(\sqrt{z \cdot \sin y}\right)}^{2}}\right) \]
    6. Applied egg-rr58.5%

      \[\leadsto x + \left(\cos y - \color{blue}{{\left(\sqrt{z \cdot \sin y}\right)}^{2}}\right) \]
    7. Step-by-step derivation
      1. add-log-exp22.8%

        \[\leadsto \color{blue}{\log \left(e^{x + \left(\cos y - {\left(\sqrt{z \cdot \sin y}\right)}^{2}\right)}\right)} \]
      2. +-commutative22.8%

        \[\leadsto \log \left(e^{\color{blue}{\left(\cos y - {\left(\sqrt{z \cdot \sin y}\right)}^{2}\right) + x}}\right) \]
      3. sub-neg22.8%

        \[\leadsto \log \left(e^{\color{blue}{\left(\cos y + \left(-{\left(\sqrt{z \cdot \sin y}\right)}^{2}\right)\right)} + x}\right) \]
      4. associate-+l+22.8%

        \[\leadsto \log \left(e^{\color{blue}{\cos y + \left(\left(-{\left(\sqrt{z \cdot \sin y}\right)}^{2}\right) + x\right)}}\right) \]
      5. unpow222.8%

        \[\leadsto \log \left(e^{\cos y + \left(\left(-\color{blue}{\sqrt{z \cdot \sin y} \cdot \sqrt{z \cdot \sin y}}\right) + x\right)}\right) \]
      6. add-sqr-sqrt35.9%

        \[\leadsto \log \left(e^{\cos y + \left(\left(-\color{blue}{z \cdot \sin y}\right) + x\right)}\right) \]
      7. distribute-lft-neg-in35.9%

        \[\leadsto \log \left(e^{\cos y + \left(\color{blue}{\left(-z\right) \cdot \sin y} + x\right)}\right) \]
      8. add-sqr-sqrt23.2%

        \[\leadsto \log \left(e^{\cos y + \left(\color{blue}{\left(\sqrt{-z} \cdot \sqrt{-z}\right)} \cdot \sin y + x\right)}\right) \]
      9. sqrt-unprod35.0%

        \[\leadsto \log \left(e^{\cos y + \left(\color{blue}{\sqrt{\left(-z\right) \cdot \left(-z\right)}} \cdot \sin y + x\right)}\right) \]
      10. sqr-neg35.0%

        \[\leadsto \log \left(e^{\cos y + \left(\sqrt{\color{blue}{z \cdot z}} \cdot \sin y + x\right)}\right) \]
      11. sqrt-unprod11.8%

        \[\leadsto \log \left(e^{\cos y + \left(\color{blue}{\left(\sqrt{z} \cdot \sqrt{z}\right)} \cdot \sin y + x\right)}\right) \]
      12. add-sqr-sqrt32.5%

        \[\leadsto \log \left(e^{\cos y + \left(\color{blue}{z} \cdot \sin y + x\right)}\right) \]
    8. Applied egg-rr32.5%

      \[\leadsto \color{blue}{\log \left(e^{\cos y + \left(z \cdot \sin y + x\right)}\right)} \]
    9. Taylor expanded in z around 0 34.1%

      \[\leadsto \log \color{blue}{\left(e^{x + \cos y}\right)} \]
    10. Taylor expanded in x around 0 34.0%

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

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

Alternative 7: 65.5% accurate, 13.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -5.9 \cdot 10^{+150} \lor \neg \left(z \leq 8.2 \cdot 10^{+155}\right):\\ \;\;\;\;x - y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x + 1\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (if (or (<= z -5.9e+150) (not (<= z 8.2e+155))) (- x (* y z)) (+ x 1.0)))
double code(double x, double y, double z) {
	double tmp;
	if ((z <= -5.9e+150) || !(z <= 8.2e+155)) {
		tmp = x - (y * z);
	} else {
		tmp = x + 1.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) :: tmp
    if ((z <= (-5.9d+150)) .or. (.not. (z <= 8.2d+155))) then
        tmp = x - (y * z)
    else
        tmp = x + 1.0d0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double tmp;
	if ((z <= -5.9e+150) || !(z <= 8.2e+155)) {
		tmp = x - (y * z);
	} else {
		tmp = x + 1.0;
	}
	return tmp;
}
def code(x, y, z):
	tmp = 0
	if (z <= -5.9e+150) or not (z <= 8.2e+155):
		tmp = x - (y * z)
	else:
		tmp = x + 1.0
	return tmp
function code(x, y, z)
	tmp = 0.0
	if ((z <= -5.9e+150) || !(z <= 8.2e+155))
		tmp = Float64(x - Float64(y * z));
	else
		tmp = Float64(x + 1.0);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	tmp = 0.0;
	if ((z <= -5.9e+150) || ~((z <= 8.2e+155)))
		tmp = x - (y * z);
	else
		tmp = x + 1.0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := If[Or[LessEqual[z, -5.9e+150], N[Not[LessEqual[z, 8.2e+155]], $MachinePrecision]], N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x + 1.0), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.9 \cdot 10^{+150} \lor \neg \left(z \leq 8.2 \cdot 10^{+155}\right):\\
\;\;\;\;x - y \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.90000000000000023e150 or 8.1999999999999996e155 < z

    1. Initial program 99.9%

      \[\left(x + \cos y\right) - z \cdot \sin y \]
    2. Step-by-step derivation
      1. associate--l+99.9%

        \[\leadsto \color{blue}{x + \left(\cos y - z \cdot \sin y\right)} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{x + \left(\cos y - z \cdot \sin y\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 97.1%

      \[\leadsto x + \color{blue}{-1 \cdot \left(z \cdot \sin y\right)} \]
    6. Step-by-step derivation
      1. associate-*r*97.1%

        \[\leadsto x + \color{blue}{\left(-1 \cdot z\right) \cdot \sin y} \]
      2. neg-mul-197.1%

        \[\leadsto x + \color{blue}{\left(-z\right)} \cdot \sin y \]
      3. *-commutative97.1%

        \[\leadsto x + \color{blue}{\sin y \cdot \left(-z\right)} \]
    7. Simplified97.1%

      \[\leadsto x + \color{blue}{\sin y \cdot \left(-z\right)} \]
    8. Taylor expanded in y around 0 53.5%

      \[\leadsto x + \color{blue}{-1 \cdot \left(y \cdot z\right)} \]
    9. Step-by-step derivation
      1. mul-1-neg53.5%

        \[\leadsto x + \color{blue}{\left(-y \cdot z\right)} \]
      2. *-commutative53.5%

        \[\leadsto x + \left(-\color{blue}{z \cdot y}\right) \]
      3. distribute-rgt-neg-in53.5%

        \[\leadsto x + \color{blue}{z \cdot \left(-y\right)} \]
    10. Simplified53.5%

      \[\leadsto x + \color{blue}{z \cdot \left(-y\right)} \]

    if -5.90000000000000023e150 < z < 8.1999999999999996e155

    1. Initial program 99.9%

      \[\left(x + \cos y\right) - z \cdot \sin y \]
    2. Step-by-step derivation
      1. associate--l+99.9%

        \[\leadsto \color{blue}{x + \left(\cos y - z \cdot \sin y\right)} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{x + \left(\cos y - z \cdot \sin y\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 70.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.9 \cdot 10^{+150} \lor \neg \left(z \leq 8.2 \cdot 10^{+155}\right):\\ \;\;\;\;x - y \cdot z\\ \mathbf{else}:\\ \;\;\;\;x + 1\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 67.2% accurate, 17.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{-5}:\\
\;\;\;\;x + 1\\

\mathbf{else}:\\
\;\;\;\;x + \left(1 - y \cdot z\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -9.00000000000000057e-5

    1. Initial program 99.8%

      \[\left(x + \cos y\right) - z \cdot \sin y \]
    2. Step-by-step derivation
      1. associate--l+99.8%

        \[\leadsto \color{blue}{x + \left(\cos y - z \cdot \sin y\right)} \]
    3. Simplified99.8%

      \[\leadsto \color{blue}{x + \left(\cos y - z \cdot \sin y\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in y around 0 44.1%

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

    if -9.00000000000000057e-5 < y

    1. Initial program 99.9%

      \[\left(x + \cos y\right) - z \cdot \sin y \]
    2. Step-by-step derivation
      1. associate--l+99.9%

        \[\leadsto \color{blue}{x + \left(\cos y - z \cdot \sin y\right)} \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{x + \left(\cos y - z \cdot \sin y\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 99.9%

      \[\leadsto x + \color{blue}{z \cdot \left(\frac{\cos y}{z} - \sin y\right)} \]
    6. Taylor expanded in y around 0 72.6%

      \[\leadsto \color{blue}{1 + \left(x + -1 \cdot \left(y \cdot z\right)\right)} \]
    7. Step-by-step derivation
      1. +-commutative72.6%

        \[\leadsto 1 + \color{blue}{\left(-1 \cdot \left(y \cdot z\right) + x\right)} \]
      2. associate-+r+72.6%

        \[\leadsto \color{blue}{\left(1 + -1 \cdot \left(y \cdot z\right)\right) + x} \]
      3. mul-1-neg72.6%

        \[\leadsto \left(1 + \color{blue}{\left(-y \cdot z\right)}\right) + x \]
      4. *-commutative72.6%

        \[\leadsto \left(1 + \left(-\color{blue}{z \cdot y}\right)\right) + x \]
      5. unsub-neg72.6%

        \[\leadsto \color{blue}{\left(1 - z \cdot y\right)} + x \]
      6. *-commutative72.6%

        \[\leadsto \left(1 - \color{blue}{y \cdot z}\right) + x \]
    8. Simplified72.6%

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

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

Alternative 9: 61.6% accurate, 69.0× speedup?

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

\\
x + 1
\end{array}
Derivation
  1. Initial program 99.9%

    \[\left(x + \cos y\right) - z \cdot \sin y \]
  2. Step-by-step derivation
    1. associate--l+99.9%

      \[\leadsto \color{blue}{x + \left(\cos y - z \cdot \sin y\right)} \]
  3. Simplified99.9%

    \[\leadsto \color{blue}{x + \left(\cos y - z \cdot \sin y\right)} \]
  4. Add Preprocessing
  5. Taylor expanded in y around 0 57.8%

    \[\leadsto x + \color{blue}{1} \]
  6. Final simplification57.8%

    \[\leadsto x + 1 \]
  7. Add Preprocessing

Alternative 10: 42.6% 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 + \cos y\right) - z \cdot \sin y \]
  2. Step-by-step derivation
    1. associate--l+99.9%

      \[\leadsto \color{blue}{x + \left(\cos y - z \cdot \sin y\right)} \]
  3. Simplified99.9%

    \[\leadsto \color{blue}{x + \left(\cos y - z \cdot \sin y\right)} \]
  4. Add Preprocessing
  5. Taylor expanded in x around inf 38.1%

    \[\leadsto \color{blue}{x} \]
  6. Final simplification38.1%

    \[\leadsto x \]
  7. Add Preprocessing

Reproduce

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