
(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 8 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%
Final simplification99.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (cos y))) (t_1 (* z (- (sin y)))))
(if (<= y -5.5e+230)
t_0
(if (<= y -4.1e+207)
t_1
(if (<= y -1.5e+166)
t_0
(if (<= y -1.2e+58)
t_1
(if (<= y -1.25e+19)
t_0
(if (or (<= y -0.12) (not (<= y 0.0048)))
t_1
(+ x (- (* x (* (* y y) -0.5)) (* y z)))))))))))
double code(double x, double y, double z) {
double t_0 = x * cos(y);
double t_1 = z * -sin(y);
double tmp;
if (y <= -5.5e+230) {
tmp = t_0;
} else if (y <= -4.1e+207) {
tmp = t_1;
} else if (y <= -1.5e+166) {
tmp = t_0;
} else if (y <= -1.2e+58) {
tmp = t_1;
} else if (y <= -1.25e+19) {
tmp = t_0;
} else if ((y <= -0.12) || !(y <= 0.0048)) {
tmp = t_1;
} else {
tmp = x + ((x * ((y * y) * -0.5)) - (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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x * cos(y)
t_1 = z * -sin(y)
if (y <= (-5.5d+230)) then
tmp = t_0
else if (y <= (-4.1d+207)) then
tmp = t_1
else if (y <= (-1.5d+166)) then
tmp = t_0
else if (y <= (-1.2d+58)) then
tmp = t_1
else if (y <= (-1.25d+19)) then
tmp = t_0
else if ((y <= (-0.12d0)) .or. (.not. (y <= 0.0048d0))) then
tmp = t_1
else
tmp = x + ((x * ((y * y) * (-0.5d0))) - (y * z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x * Math.cos(y);
double t_1 = z * -Math.sin(y);
double tmp;
if (y <= -5.5e+230) {
tmp = t_0;
} else if (y <= -4.1e+207) {
tmp = t_1;
} else if (y <= -1.5e+166) {
tmp = t_0;
} else if (y <= -1.2e+58) {
tmp = t_1;
} else if (y <= -1.25e+19) {
tmp = t_0;
} else if ((y <= -0.12) || !(y <= 0.0048)) {
tmp = t_1;
} else {
tmp = x + ((x * ((y * y) * -0.5)) - (y * z));
}
return tmp;
}
def code(x, y, z): t_0 = x * math.cos(y) t_1 = z * -math.sin(y) tmp = 0 if y <= -5.5e+230: tmp = t_0 elif y <= -4.1e+207: tmp = t_1 elif y <= -1.5e+166: tmp = t_0 elif y <= -1.2e+58: tmp = t_1 elif y <= -1.25e+19: tmp = t_0 elif (y <= -0.12) or not (y <= 0.0048): tmp = t_1 else: tmp = x + ((x * ((y * y) * -0.5)) - (y * z)) return tmp
function code(x, y, z) t_0 = Float64(x * cos(y)) t_1 = Float64(z * Float64(-sin(y))) tmp = 0.0 if (y <= -5.5e+230) tmp = t_0; elseif (y <= -4.1e+207) tmp = t_1; elseif (y <= -1.5e+166) tmp = t_0; elseif (y <= -1.2e+58) tmp = t_1; elseif (y <= -1.25e+19) tmp = t_0; elseif ((y <= -0.12) || !(y <= 0.0048)) tmp = t_1; else tmp = Float64(x + Float64(Float64(x * Float64(Float64(y * y) * -0.5)) - Float64(y * z))); end return tmp end
function tmp_2 = code(x, y, z) t_0 = x * cos(y); t_1 = z * -sin(y); tmp = 0.0; if (y <= -5.5e+230) tmp = t_0; elseif (y <= -4.1e+207) tmp = t_1; elseif (y <= -1.5e+166) tmp = t_0; elseif (y <= -1.2e+58) tmp = t_1; elseif (y <= -1.25e+19) tmp = t_0; elseif ((y <= -0.12) || ~((y <= 0.0048))) tmp = t_1; else tmp = x + ((x * ((y * y) * -0.5)) - (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[Cos[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(z * (-N[Sin[y], $MachinePrecision])), $MachinePrecision]}, If[LessEqual[y, -5.5e+230], t$95$0, If[LessEqual[y, -4.1e+207], t$95$1, If[LessEqual[y, -1.5e+166], t$95$0, If[LessEqual[y, -1.2e+58], t$95$1, If[LessEqual[y, -1.25e+19], t$95$0, If[Or[LessEqual[y, -0.12], N[Not[LessEqual[y, 0.0048]], $MachinePrecision]], t$95$1, N[(x + N[(N[(x * N[(N[(y * y), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \cos y\\
t_1 := z \cdot \left(-\sin y\right)\\
\mathbf{if}\;y \leq -5.5 \cdot 10^{+230}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -4.1 \cdot 10^{+207}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.5 \cdot 10^{+166}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -1.2 \cdot 10^{+58}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.25 \cdot 10^{+19}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -0.12 \lor \neg \left(y \leq 0.0048\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + \left(x \cdot \left(\left(y \cdot y\right) \cdot -0.5\right) - y \cdot z\right)\\
\end{array}
\end{array}
if y < -5.49999999999999979e230 or -4.1e207 < y < -1.49999999999999999e166 or -1.2e58 < y < -1.25e19Initial program 99.6%
Taylor expanded in x around inf 78.7%
if -5.49999999999999979e230 < y < -4.1e207 or -1.49999999999999999e166 < y < -1.2e58 or -1.25e19 < y < -0.12 or 0.00479999999999999958 < y Initial program 99.7%
Taylor expanded in x around 0 72.3%
associate-*r*72.3%
neg-mul-172.3%
Simplified72.3%
if -0.12 < y < 0.00479999999999999958Initial program 100.0%
Taylor expanded in y around 0 99.7%
+-commutative99.7%
mul-1-neg99.7%
unsub-neg99.7%
*-commutative99.7%
associate-*l*99.7%
unpow299.7%
Simplified99.7%
Final simplification86.5%
(FPCore (x y z) :precision binary64 (if (or (<= z -4.8e-152) (not (<= z 2.5e-64))) (- x (* z (sin y))) (* x (cos y))))
double code(double x, double y, double z) {
double tmp;
if ((z <= -4.8e-152) || !(z <= 2.5e-64)) {
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 <= (-4.8d-152)) .or. (.not. (z <= 2.5d-64))) 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 <= -4.8e-152) || !(z <= 2.5e-64)) {
tmp = x - (z * Math.sin(y));
} else {
tmp = x * Math.cos(y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -4.8e-152) or not (z <= 2.5e-64): tmp = x - (z * math.sin(y)) else: tmp = x * math.cos(y) return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -4.8e-152) || !(z <= 2.5e-64)) 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 <= -4.8e-152) || ~((z <= 2.5e-64))) tmp = x - (z * sin(y)); else tmp = x * cos(y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -4.8e-152], N[Not[LessEqual[z, 2.5e-64]], $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 -4.8 \cdot 10^{-152} \lor \neg \left(z \leq 2.5 \cdot 10^{-64}\right):\\
\;\;\;\;x - z \cdot \sin y\\
\mathbf{else}:\\
\;\;\;\;x \cdot \cos y\\
\end{array}
\end{array}
if z < -4.8e-152 or 2.50000000000000017e-64 < z Initial program 99.8%
Taylor expanded in y around 0 90.1%
if -4.8e-152 < z < 2.50000000000000017e-64Initial program 99.8%
Taylor expanded in x around inf 90.0%
Final simplification90.1%
(FPCore (x y z) :precision binary64 (if (or (<= y -0.00205) (not (<= y 420000.0))) (* x (cos y)) (+ x (- (* x (* (* y y) -0.5)) (* y z)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -0.00205) || !(y <= 420000.0)) {
tmp = x * cos(y);
} else {
tmp = x + ((x * ((y * y) * -0.5)) - (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 <= (-0.00205d0)) .or. (.not. (y <= 420000.0d0))) then
tmp = x * cos(y)
else
tmp = x + ((x * ((y * y) * (-0.5d0))) - (y * z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -0.00205) || !(y <= 420000.0)) {
tmp = x * Math.cos(y);
} else {
tmp = x + ((x * ((y * y) * -0.5)) - (y * z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -0.00205) or not (y <= 420000.0): tmp = x * math.cos(y) else: tmp = x + ((x * ((y * y) * -0.5)) - (y * z)) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -0.00205) || !(y <= 420000.0)) tmp = Float64(x * cos(y)); else tmp = Float64(x + Float64(Float64(x * Float64(Float64(y * y) * -0.5)) - Float64(y * z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -0.00205) || ~((y <= 420000.0))) tmp = x * cos(y); else tmp = x + ((x * ((y * y) * -0.5)) - (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -0.00205], N[Not[LessEqual[y, 420000.0]], $MachinePrecision]], N[(x * N[Cos[y], $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(x * N[(N[(y * y), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.00205 \lor \neg \left(y \leq 420000\right):\\
\;\;\;\;x \cdot \cos y\\
\mathbf{else}:\\
\;\;\;\;x + \left(x \cdot \left(\left(y \cdot y\right) \cdot -0.5\right) - y \cdot z\right)\\
\end{array}
\end{array}
if y < -0.00205000000000000017 or 4.2e5 < y Initial program 99.7%
Taylor expanded in x around inf 45.7%
if -0.00205000000000000017 < y < 4.2e5Initial program 100.0%
Taylor expanded in y around 0 97.1%
+-commutative97.1%
mul-1-neg97.1%
unsub-neg97.1%
*-commutative97.1%
associate-*l*97.1%
unpow297.1%
Simplified97.1%
Final simplification71.4%
(FPCore (x y z)
:precision binary64
(if (<= x -1.25e+18)
x
(if (or (<= x -1.22e-29) (and (not (<= x -1.62e-199)) (<= x 1.7e-145)))
(* y (- z))
x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.25e+18) {
tmp = x;
} else if ((x <= -1.22e-29) || (!(x <= -1.62e-199) && (x <= 1.7e-145))) {
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 <= (-1.25d+18)) then
tmp = x
else if ((x <= (-1.22d-29)) .or. (.not. (x <= (-1.62d-199))) .and. (x <= 1.7d-145)) 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 <= -1.25e+18) {
tmp = x;
} else if ((x <= -1.22e-29) || (!(x <= -1.62e-199) && (x <= 1.7e-145))) {
tmp = y * -z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.25e+18: tmp = x elif (x <= -1.22e-29) or (not (x <= -1.62e-199) and (x <= 1.7e-145)): tmp = y * -z else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.25e+18) tmp = x; elseif ((x <= -1.22e-29) || (!(x <= -1.62e-199) && (x <= 1.7e-145))) tmp = Float64(y * Float64(-z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.25e+18) tmp = x; elseif ((x <= -1.22e-29) || (~((x <= -1.62e-199)) && (x <= 1.7e-145))) tmp = y * -z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.25e+18], x, If[Or[LessEqual[x, -1.22e-29], And[N[Not[LessEqual[x, -1.62e-199]], $MachinePrecision], LessEqual[x, 1.7e-145]]], N[(y * (-z)), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.25 \cdot 10^{+18}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -1.22 \cdot 10^{-29} \lor \neg \left(x \leq -1.62 \cdot 10^{-199}\right) \land x \leq 1.7 \cdot 10^{-145}:\\
\;\;\;\;y \cdot \left(-z\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.25e18 or -1.21999999999999996e-29 < x < -1.62000000000000008e-199 or 1.6999999999999999e-145 < x Initial program 99.8%
Taylor expanded in y around 0 51.5%
mul-1-neg51.5%
unsub-neg51.5%
Simplified51.5%
Taylor expanded in x around inf 44.3%
if -1.25e18 < x < -1.21999999999999996e-29 or -1.62000000000000008e-199 < x < 1.6999999999999999e-145Initial program 99.8%
Taylor expanded in y around 0 50.0%
mul-1-neg50.0%
unsub-neg50.0%
Simplified50.0%
Taylor expanded in x around 0 43.1%
Final simplification44.0%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* y (- z))))
(if (<= x -1.25e+18)
x
(if (<= x -2.5e-29)
t_0
(if (<= x -6.6e-196) (+ x (* y z)) (if (<= x 1.8e-142) t_0 x))))))
double code(double x, double y, double z) {
double t_0 = y * -z;
double tmp;
if (x <= -1.25e+18) {
tmp = x;
} else if (x <= -2.5e-29) {
tmp = t_0;
} else if (x <= -6.6e-196) {
tmp = x + (y * z);
} else if (x <= 1.8e-142) {
tmp = t_0;
} 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) :: t_0
real(8) :: tmp
t_0 = y * -z
if (x <= (-1.25d+18)) then
tmp = x
else if (x <= (-2.5d-29)) then
tmp = t_0
else if (x <= (-6.6d-196)) then
tmp = x + (y * z)
else if (x <= 1.8d-142) then
tmp = t_0
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = y * -z;
double tmp;
if (x <= -1.25e+18) {
tmp = x;
} else if (x <= -2.5e-29) {
tmp = t_0;
} else if (x <= -6.6e-196) {
tmp = x + (y * z);
} else if (x <= 1.8e-142) {
tmp = t_0;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): t_0 = y * -z tmp = 0 if x <= -1.25e+18: tmp = x elif x <= -2.5e-29: tmp = t_0 elif x <= -6.6e-196: tmp = x + (y * z) elif x <= 1.8e-142: tmp = t_0 else: tmp = x return tmp
function code(x, y, z) t_0 = Float64(y * Float64(-z)) tmp = 0.0 if (x <= -1.25e+18) tmp = x; elseif (x <= -2.5e-29) tmp = t_0; elseif (x <= -6.6e-196) tmp = Float64(x + Float64(y * z)); elseif (x <= 1.8e-142) tmp = t_0; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) t_0 = y * -z; tmp = 0.0; if (x <= -1.25e+18) tmp = x; elseif (x <= -2.5e-29) tmp = t_0; elseif (x <= -6.6e-196) tmp = x + (y * z); elseif (x <= 1.8e-142) tmp = t_0; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(y * (-z)), $MachinePrecision]}, If[LessEqual[x, -1.25e+18], x, If[LessEqual[x, -2.5e-29], t$95$0, If[LessEqual[x, -6.6e-196], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.8e-142], t$95$0, x]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(-z\right)\\
\mathbf{if}\;x \leq -1.25 \cdot 10^{+18}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -2.5 \cdot 10^{-29}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -6.6 \cdot 10^{-196}:\\
\;\;\;\;x + y \cdot z\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{-142}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.25e18 or 1.8e-142 < x Initial program 99.8%
Taylor expanded in y around 0 51.7%
mul-1-neg51.7%
unsub-neg51.7%
Simplified51.7%
Taylor expanded in x around inf 45.7%
if -1.25e18 < x < -2.49999999999999993e-29 or -6.59999999999999997e-196 < x < 1.8e-142Initial program 99.8%
Taylor expanded in y around 0 50.0%
mul-1-neg50.0%
unsub-neg50.0%
Simplified50.0%
Taylor expanded in x around 0 43.1%
if -2.49999999999999993e-29 < x < -6.59999999999999997e-196Initial program 99.9%
Taylor expanded in y around 0 50.7%
mul-1-neg50.7%
unsub-neg50.7%
Simplified50.7%
sub-neg50.7%
+-commutative50.7%
*-commutative50.7%
distribute-lft-neg-in50.7%
add-sqr-sqrt37.8%
sqrt-unprod45.5%
sqr-neg45.5%
sqrt-unprod10.6%
add-sqr-sqrt38.3%
Applied egg-rr38.3%
Final simplification44.0%
(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 51.1%
mul-1-neg51.1%
unsub-neg51.1%
Simplified51.1%
Final simplification51.1%
(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 51.1%
mul-1-neg51.1%
unsub-neg51.1%
Simplified51.1%
Taylor expanded in x around inf 35.3%
Final simplification35.3%
herbie shell --seed 2023290
(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))))