
(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}
\\
x \cdot \cos y - z \cdot \sin y
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(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}
\\
x \cdot \cos y - 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}
\\
x \cdot \cos y - z \cdot \sin y
\end{array}
Initial program 99.8%
(FPCore (x y z)
:precision binary64
(if (<= z -1.9e+164)
(* (sin y) (- z))
(if (or (<= z -2e-34) (not (<= z 1.4e-11)))
(* x (- 1.0 (/ (* z (sin y)) x)))
(* x (cos y)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.9e+164) {
tmp = sin(y) * -z;
} else if ((z <= -2e-34) || !(z <= 1.4e-11)) {
tmp = x * (1.0 - ((z * sin(y)) / x));
} 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 <= (-1.9d+164)) then
tmp = sin(y) * -z
else if ((z <= (-2d-34)) .or. (.not. (z <= 1.4d-11))) then
tmp = x * (1.0d0 - ((z * sin(y)) / x))
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 <= -1.9e+164) {
tmp = Math.sin(y) * -z;
} else if ((z <= -2e-34) || !(z <= 1.4e-11)) {
tmp = x * (1.0 - ((z * Math.sin(y)) / x));
} else {
tmp = x * Math.cos(y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.9e+164: tmp = math.sin(y) * -z elif (z <= -2e-34) or not (z <= 1.4e-11): tmp = x * (1.0 - ((z * math.sin(y)) / x)) else: tmp = x * math.cos(y) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.9e+164) tmp = Float64(sin(y) * Float64(-z)); elseif ((z <= -2e-34) || !(z <= 1.4e-11)) tmp = Float64(x * Float64(1.0 - Float64(Float64(z * sin(y)) / x))); else tmp = Float64(x * cos(y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.9e+164) tmp = sin(y) * -z; elseif ((z <= -2e-34) || ~((z <= 1.4e-11))) tmp = x * (1.0 - ((z * sin(y)) / x)); else tmp = x * cos(y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.9e+164], N[(N[Sin[y], $MachinePrecision] * (-z)), $MachinePrecision], If[Or[LessEqual[z, -2e-34], N[Not[LessEqual[z, 1.4e-11]], $MachinePrecision]], N[(x * N[(1.0 - N[(N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[Cos[y], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+164}:\\
\;\;\;\;\sin y \cdot \left(-z\right)\\
\mathbf{elif}\;z \leq -2 \cdot 10^{-34} \lor \neg \left(z \leq 1.4 \cdot 10^{-11}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{z \cdot \sin y}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \cos y\\
\end{array}
\end{array}
if z < -1.90000000000000011e164Initial program 99.8%
Taylor expanded in x around 0 82.7%
associate-*r*82.7%
neg-mul-182.7%
Simplified82.7%
if -1.90000000000000011e164 < z < -1.99999999999999986e-34 or 1.4e-11 < z Initial program 99.8%
log1p-expm1-u99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 91.2%
Taylor expanded in x around inf 82.5%
associate-*r/82.5%
neg-mul-182.5%
distribute-lft-neg-in82.5%
*-commutative82.5%
Simplified82.5%
if -1.99999999999999986e-34 < z < 1.4e-11Initial program 99.9%
Taylor expanded in x around inf 92.3%
Final simplification87.3%
(FPCore (x y z)
:precision binary64
(if (<= z -1.8e+164)
(* (sin y) (- z))
(if (or (<= z -1.7e-34) (not (<= z 1.1e-11)))
(* x (- 1.0 (* z (/ (sin y) x))))
(* x (cos y)))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.8e+164) {
tmp = sin(y) * -z;
} else if ((z <= -1.7e-34) || !(z <= 1.1e-11)) {
tmp = x * (1.0 - (z * (sin(y) / x)));
} 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 <= (-1.8d+164)) then
tmp = sin(y) * -z
else if ((z <= (-1.7d-34)) .or. (.not. (z <= 1.1d-11))) then
tmp = x * (1.0d0 - (z * (sin(y) / x)))
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 <= -1.8e+164) {
tmp = Math.sin(y) * -z;
} else if ((z <= -1.7e-34) || !(z <= 1.1e-11)) {
tmp = x * (1.0 - (z * (Math.sin(y) / x)));
} else {
tmp = x * Math.cos(y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.8e+164: tmp = math.sin(y) * -z elif (z <= -1.7e-34) or not (z <= 1.1e-11): tmp = x * (1.0 - (z * (math.sin(y) / x))) else: tmp = x * math.cos(y) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.8e+164) tmp = Float64(sin(y) * Float64(-z)); elseif ((z <= -1.7e-34) || !(z <= 1.1e-11)) tmp = Float64(x * Float64(1.0 - Float64(z * Float64(sin(y) / x)))); else tmp = Float64(x * cos(y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.8e+164) tmp = sin(y) * -z; elseif ((z <= -1.7e-34) || ~((z <= 1.1e-11))) tmp = x * (1.0 - (z * (sin(y) / x))); else tmp = x * cos(y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.8e+164], N[(N[Sin[y], $MachinePrecision] * (-z)), $MachinePrecision], If[Or[LessEqual[z, -1.7e-34], N[Not[LessEqual[z, 1.1e-11]], $MachinePrecision]], N[(x * N[(1.0 - N[(z * N[(N[Sin[y], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[Cos[y], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{+164}:\\
\;\;\;\;\sin y \cdot \left(-z\right)\\
\mathbf{elif}\;z \leq -1.7 \cdot 10^{-34} \lor \neg \left(z \leq 1.1 \cdot 10^{-11}\right):\\
\;\;\;\;x \cdot \left(1 - z \cdot \frac{\sin y}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \cos y\\
\end{array}
\end{array}
if z < -1.79999999999999995e164Initial program 99.8%
Taylor expanded in x around 0 82.7%
associate-*r*82.7%
neg-mul-182.7%
Simplified82.7%
if -1.79999999999999995e164 < z < -1.7e-34 or 1.1000000000000001e-11 < z Initial program 99.8%
log1p-expm1-u99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 91.2%
Taylor expanded in x around inf 82.5%
mul-1-neg82.5%
unsub-neg82.5%
associate-/l*82.3%
Simplified82.3%
if -1.7e-34 < z < 1.1000000000000001e-11Initial program 99.9%
Taylor expanded in x around inf 92.3%
Final simplification87.2%
(FPCore (x y z)
:precision binary64
(if (<= z -9.5e+163)
(* (sin y) (- z))
(if (<= z -3.6e-33)
(* x (- 1.0 (/ z (/ x (sin y)))))
(if (<= z 9.5e-12) (* x (cos y)) (* x (- 1.0 (* z (/ (sin y) x))))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -9.5e+163) {
tmp = sin(y) * -z;
} else if (z <= -3.6e-33) {
tmp = x * (1.0 - (z / (x / sin(y))));
} else if (z <= 9.5e-12) {
tmp = x * cos(y);
} else {
tmp = x * (1.0 - (z * (sin(y) / x)));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-9.5d+163)) then
tmp = sin(y) * -z
else if (z <= (-3.6d-33)) then
tmp = x * (1.0d0 - (z / (x / sin(y))))
else if (z <= 9.5d-12) then
tmp = x * cos(y)
else
tmp = x * (1.0d0 - (z * (sin(y) / x)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -9.5e+163) {
tmp = Math.sin(y) * -z;
} else if (z <= -3.6e-33) {
tmp = x * (1.0 - (z / (x / Math.sin(y))));
} else if (z <= 9.5e-12) {
tmp = x * Math.cos(y);
} else {
tmp = x * (1.0 - (z * (Math.sin(y) / x)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -9.5e+163: tmp = math.sin(y) * -z elif z <= -3.6e-33: tmp = x * (1.0 - (z / (x / math.sin(y)))) elif z <= 9.5e-12: tmp = x * math.cos(y) else: tmp = x * (1.0 - (z * (math.sin(y) / x))) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -9.5e+163) tmp = Float64(sin(y) * Float64(-z)); elseif (z <= -3.6e-33) tmp = Float64(x * Float64(1.0 - Float64(z / Float64(x / sin(y))))); elseif (z <= 9.5e-12) tmp = Float64(x * cos(y)); else tmp = Float64(x * Float64(1.0 - Float64(z * Float64(sin(y) / x)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -9.5e+163) tmp = sin(y) * -z; elseif (z <= -3.6e-33) tmp = x * (1.0 - (z / (x / sin(y)))); elseif (z <= 9.5e-12) tmp = x * cos(y); else tmp = x * (1.0 - (z * (sin(y) / x))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -9.5e+163], N[(N[Sin[y], $MachinePrecision] * (-z)), $MachinePrecision], If[LessEqual[z, -3.6e-33], N[(x * N[(1.0 - N[(z / N[(x / N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.5e-12], N[(x * N[Cos[y], $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(z * N[(N[Sin[y], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{+163}:\\
\;\;\;\;\sin y \cdot \left(-z\right)\\
\mathbf{elif}\;z \leq -3.6 \cdot 10^{-33}:\\
\;\;\;\;x \cdot \left(1 - \frac{z}{\frac{x}{\sin y}}\right)\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-12}:\\
\;\;\;\;x \cdot \cos y\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - z \cdot \frac{\sin y}{x}\right)\\
\end{array}
\end{array}
if z < -9.50000000000000053e163Initial program 99.8%
Taylor expanded in x around 0 82.7%
associate-*r*82.7%
neg-mul-182.7%
Simplified82.7%
if -9.50000000000000053e163 < z < -3.60000000000000034e-33Initial program 99.8%
log1p-expm1-u99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 95.6%
Taylor expanded in x around inf 89.6%
mul-1-neg89.6%
unsub-neg89.6%
associate-/l*89.3%
Simplified89.3%
clear-num89.3%
un-div-inv89.4%
Applied egg-rr89.4%
if -3.60000000000000034e-33 < z < 9.4999999999999995e-12Initial program 99.9%
Taylor expanded in x around inf 92.3%
if 9.4999999999999995e-12 < z Initial program 99.8%
log1p-expm1-u99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 87.8%
Taylor expanded in x around inf 77.1%
mul-1-neg77.1%
unsub-neg77.1%
associate-/l*76.8%
Simplified76.8%
Final simplification87.2%
(FPCore (x y z) :precision binary64 (if (or (<= z -94000.0) (not (<= z 9.5e+45))) (* (sin y) (- z)) (* x (cos y))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -94000.0) || !(z <= 9.5e+45)) {
tmp = sin(y) * -z;
} 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 <= (-94000.0d0)) .or. (.not. (z <= 9.5d+45))) then
tmp = sin(y) * -z
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 <= -94000.0) || !(z <= 9.5e+45)) {
tmp = Math.sin(y) * -z;
} else {
tmp = x * Math.cos(y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -94000.0) or not (z <= 9.5e+45): tmp = math.sin(y) * -z else: tmp = x * math.cos(y) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -94000.0) || !(z <= 9.5e+45)) tmp = Float64(sin(y) * Float64(-z)); else tmp = Float64(x * cos(y)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -94000.0) || ~((z <= 9.5e+45))) tmp = sin(y) * -z; else tmp = x * cos(y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -94000.0], N[Not[LessEqual[z, 9.5e+45]], $MachinePrecision]], N[(N[Sin[y], $MachinePrecision] * (-z)), $MachinePrecision], N[(x * N[Cos[y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -94000 \lor \neg \left(z \leq 9.5 \cdot 10^{+45}\right):\\
\;\;\;\;\sin y \cdot \left(-z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \cos y\\
\end{array}
\end{array}
if z < -94000 or 9.4999999999999998e45 < z Initial program 99.8%
Taylor expanded in x around 0 70.5%
associate-*r*70.5%
neg-mul-170.5%
Simplified70.5%
if -94000 < z < 9.4999999999999998e45Initial program 99.9%
Taylor expanded in x around inf 89.4%
Final simplification80.8%
(FPCore (x y z) :precision binary64 (if (or (<= y -0.0142) (not (<= y 0.00041))) (* x (cos y)) (+ x (* y (- (* y (+ (* x -0.5) (* 0.16666666666666666 (* y z)))) z)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -0.0142) || !(y <= 0.00041)) {
tmp = x * cos(y);
} else {
tmp = x + (y * ((y * ((x * -0.5) + (0.16666666666666666 * (y * z)))) - 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.0142d0)) .or. (.not. (y <= 0.00041d0))) then
tmp = x * cos(y)
else
tmp = x + (y * ((y * ((x * (-0.5d0)) + (0.16666666666666666d0 * (y * z)))) - z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -0.0142) || !(y <= 0.00041)) {
tmp = x * Math.cos(y);
} else {
tmp = x + (y * ((y * ((x * -0.5) + (0.16666666666666666 * (y * z)))) - z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -0.0142) or not (y <= 0.00041): tmp = x * math.cos(y) else: tmp = x + (y * ((y * ((x * -0.5) + (0.16666666666666666 * (y * z)))) - z)) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -0.0142) || !(y <= 0.00041)) tmp = Float64(x * cos(y)); else tmp = Float64(x + Float64(y * Float64(Float64(y * Float64(Float64(x * -0.5) + Float64(0.16666666666666666 * Float64(y * z)))) - z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -0.0142) || ~((y <= 0.00041))) tmp = x * cos(y); else tmp = x + (y * ((y * ((x * -0.5) + (0.16666666666666666 * (y * z)))) - z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -0.0142], N[Not[LessEqual[y, 0.00041]], $MachinePrecision]], N[(x * N[Cos[y], $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(N[(y * N[(N[(x * -0.5), $MachinePrecision] + N[(0.16666666666666666 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.0142 \lor \neg \left(y \leq 0.00041\right):\\
\;\;\;\;x \cdot \cos y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(y \cdot \left(x \cdot -0.5 + 0.16666666666666666 \cdot \left(y \cdot z\right)\right) - z\right)\\
\end{array}
\end{array}
if y < -0.014200000000000001 or 4.0999999999999999e-4 < y Initial program 99.7%
Taylor expanded in x around inf 55.1%
if -0.014200000000000001 < y < 4.0999999999999999e-4Initial program 100.0%
Taylor expanded in y around 0 100.0%
Final simplification77.7%
(FPCore (x y z) :precision binary64 (if (<= x -5.1e-204) x (if (<= x 1.25e-207) (* y (- z)) x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -5.1e-204) {
tmp = x;
} else if (x <= 1.25e-207) {
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 <= (-5.1d-204)) then
tmp = x
else if (x <= 1.25d-207) 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 <= -5.1e-204) {
tmp = x;
} else if (x <= 1.25e-207) {
tmp = y * -z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -5.1e-204: tmp = x elif x <= 1.25e-207: tmp = y * -z else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -5.1e-204) tmp = x; elseif (x <= 1.25e-207) tmp = Float64(y * Float64(-z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -5.1e-204) tmp = x; elseif (x <= 1.25e-207) tmp = y * -z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -5.1e-204], x, If[LessEqual[x, 1.25e-207], N[(y * (-z)), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.1 \cdot 10^{-204}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.25 \cdot 10^{-207}:\\
\;\;\;\;y \cdot \left(-z\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -5.10000000000000027e-204 or 1.25000000000000004e-207 < x Initial program 99.8%
Taylor expanded in y around 0 43.4%
if -5.10000000000000027e-204 < x < 1.25000000000000004e-207Initial program 99.9%
Taylor expanded in y around 0 55.0%
mul-1-neg55.0%
unsub-neg55.0%
*-commutative55.0%
Simplified55.0%
Taylor expanded in x around 0 45.3%
mul-1-neg45.3%
Applied egg-rr45.3%
Final simplification43.6%
(FPCore (x y z) :precision binary64 (- x (* y z)))
double code(double x, double y, double z) {
return x - (y * z);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x - (y * z)
end function
public static double code(double x, double y, double z) {
return x - (y * z);
}
def code(x, y, z): return x - (y * z)
function code(x, y, z) return Float64(x - Float64(y * z)) end
function tmp = code(x, y, z) tmp = x - (y * z); end
code[x_, y_, z_] := N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - y \cdot z
\end{array}
Initial program 99.8%
Taylor expanded in y around 0 53.8%
mul-1-neg53.8%
unsub-neg53.8%
*-commutative53.8%
Simplified53.8%
Final simplification53.8%
(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}
Initial program 99.8%
Taylor expanded in y around 0 39.3%
herbie shell --seed 2024148
(FPCore (x y z)
:name "Diagrams.ThreeD.Transform:aboutX from diagrams-lib-1.3.0.3, A"
:precision binary64
(- (* x (cos y)) (* z (sin y))))