
(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 10 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 (fma z (- (sin y)) (* x (cos y))))
double code(double x, double y, double z) {
return fma(z, -sin(y), (x * cos(y)));
}
function code(x, y, z) return fma(z, Float64(-sin(y)), Float64(x * cos(y))) end
code[x_, y_, z_] := N[(z * (-N[Sin[y], $MachinePrecision]) + N[(x * N[Cos[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(z, -\sin y, x \cdot \cos y\right)
\end{array}
Initial program 99.7%
cancel-sign-sub-inv99.7%
+-commutative99.7%
distribute-lft-neg-out99.7%
distribute-rgt-neg-in99.7%
sin-neg99.7%
fma-define99.7%
sin-neg99.7%
Simplified99.7%
(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.7%
(FPCore (x y z)
:precision binary64
(if (or (<= x -9.5e+183)
(and (not (<= x -2.65e+129))
(or (<= x -2.6e+22) (not (<= x 7.4e-13)))))
(* x (cos y))
(- x (* z (sin y)))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -9.5e+183) || (!(x <= -2.65e+129) && ((x <= -2.6e+22) || !(x <= 7.4e-13)))) {
tmp = x * cos(y);
} else {
tmp = x - (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 <= (-9.5d+183)) .or. (.not. (x <= (-2.65d+129))) .and. (x <= (-2.6d+22)) .or. (.not. (x <= 7.4d-13))) then
tmp = x * cos(y)
else
tmp = x - (z * sin(y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -9.5e+183) || (!(x <= -2.65e+129) && ((x <= -2.6e+22) || !(x <= 7.4e-13)))) {
tmp = x * Math.cos(y);
} else {
tmp = x - (z * Math.sin(y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -9.5e+183) or (not (x <= -2.65e+129) and ((x <= -2.6e+22) or not (x <= 7.4e-13))): tmp = x * math.cos(y) else: tmp = x - (z * math.sin(y)) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -9.5e+183) || (!(x <= -2.65e+129) && ((x <= -2.6e+22) || !(x <= 7.4e-13)))) tmp = Float64(x * cos(y)); else tmp = Float64(x - Float64(z * sin(y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -9.5e+183) || (~((x <= -2.65e+129)) && ((x <= -2.6e+22) || ~((x <= 7.4e-13))))) tmp = x * cos(y); else tmp = x - (z * sin(y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -9.5e+183], And[N[Not[LessEqual[x, -2.65e+129]], $MachinePrecision], Or[LessEqual[x, -2.6e+22], N[Not[LessEqual[x, 7.4e-13]], $MachinePrecision]]]], N[(x * N[Cos[y], $MachinePrecision]), $MachinePrecision], N[(x - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.5 \cdot 10^{+183} \lor \neg \left(x \leq -2.65 \cdot 10^{+129}\right) \land \left(x \leq -2.6 \cdot 10^{+22} \lor \neg \left(x \leq 7.4 \cdot 10^{-13}\right)\right):\\
\;\;\;\;x \cdot \cos y\\
\mathbf{else}:\\
\;\;\;\;x - z \cdot \sin y\\
\end{array}
\end{array}
if x < -9.5000000000000003e183 or -2.6499999999999999e129 < x < -2.6e22 or 7.39999999999999977e-13 < x Initial program 99.7%
Taylor expanded in x around inf 91.7%
if -9.5000000000000003e183 < x < -2.6499999999999999e129 or -2.6e22 < x < 7.39999999999999977e-13Initial program 99.7%
add-cbrt-cube64.7%
pow364.7%
Applied egg-rr64.7%
Taylor expanded in y around 0 59.7%
rem-cbrt-cube93.6%
*-commutative93.6%
Applied egg-rr93.6%
Final simplification92.8%
(FPCore (x y z)
:precision binary64
(if (or (<= x -6.8e+183)
(not (or (<= x -5e+135) (and (not (<= x -1.75e+21)) (<= x 1e-11)))))
(* x (cos y))
(- x (* z (sin y)))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -6.8e+183) || !((x <= -5e+135) || (!(x <= -1.75e+21) && (x <= 1e-11)))) {
tmp = x * cos(y);
} else {
tmp = x - (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 <= (-6.8d+183)) .or. (.not. (x <= (-5d+135)) .or. (.not. (x <= (-1.75d+21))) .and. (x <= 1d-11))) then
tmp = x * cos(y)
else
tmp = x - (z * sin(y))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -6.8e+183) || !((x <= -5e+135) || (!(x <= -1.75e+21) && (x <= 1e-11)))) {
tmp = x * Math.cos(y);
} else {
tmp = x - (z * Math.sin(y));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -6.8e+183) or not ((x <= -5e+135) or (not (x <= -1.75e+21) and (x <= 1e-11))): tmp = x * math.cos(y) else: tmp = x - (z * math.sin(y)) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -6.8e+183) || !((x <= -5e+135) || (!(x <= -1.75e+21) && (x <= 1e-11)))) tmp = Float64(x * cos(y)); else tmp = Float64(x - Float64(z * sin(y))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -6.8e+183) || ~(((x <= -5e+135) || (~((x <= -1.75e+21)) && (x <= 1e-11))))) tmp = x * cos(y); else tmp = x - (z * sin(y)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -6.8e+183], N[Not[Or[LessEqual[x, -5e+135], And[N[Not[LessEqual[x, -1.75e+21]], $MachinePrecision], LessEqual[x, 1e-11]]]], $MachinePrecision]], N[(x * N[Cos[y], $MachinePrecision]), $MachinePrecision], N[(x - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.8 \cdot 10^{+183} \lor \neg \left(x \leq -5 \cdot 10^{+135} \lor \neg \left(x \leq -1.75 \cdot 10^{+21}\right) \land x \leq 10^{-11}\right):\\
\;\;\;\;x \cdot \cos y\\
\mathbf{else}:\\
\;\;\;\;x - z \cdot \sin y\\
\end{array}
\end{array}
if x < -6.8e183 or -5.00000000000000029e135 < x < -1.75e21 or 9.99999999999999939e-12 < x Initial program 99.7%
Taylor expanded in x around inf 91.7%
if -6.8e183 < x < -5.00000000000000029e135 or -1.75e21 < x < 9.99999999999999939e-12Initial program 99.7%
Taylor expanded in y around 0 93.6%
Final simplification92.8%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (cos y))) (t_1 (* z (- (sin y)))))
(if (<= x -4.5e-29)
t_0
(if (<= x -4.4e-92)
t_1
(if (<= x -2e-141) (fma (- y) z x) (if (<= x 2.1e-108) t_1 t_0))))))
double code(double x, double y, double z) {
double t_0 = x * cos(y);
double t_1 = z * -sin(y);
double tmp;
if (x <= -4.5e-29) {
tmp = t_0;
} else if (x <= -4.4e-92) {
tmp = t_1;
} else if (x <= -2e-141) {
tmp = fma(-y, z, x);
} else if (x <= 2.1e-108) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y, z) t_0 = Float64(x * cos(y)) t_1 = Float64(z * Float64(-sin(y))) tmp = 0.0 if (x <= -4.5e-29) tmp = t_0; elseif (x <= -4.4e-92) tmp = t_1; elseif (x <= -2e-141) tmp = fma(Float64(-y), z, x); elseif (x <= 2.1e-108) tmp = t_1; else tmp = t_0; end return 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[x, -4.5e-29], t$95$0, If[LessEqual[x, -4.4e-92], t$95$1, If[LessEqual[x, -2e-141], N[((-y) * z + x), $MachinePrecision], If[LessEqual[x, 2.1e-108], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \cos y\\
t_1 := z \cdot \left(-\sin y\right)\\
\mathbf{if}\;x \leq -4.5 \cdot 10^{-29}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -4.4 \cdot 10^{-92}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -2 \cdot 10^{-141}:\\
\;\;\;\;\mathsf{fma}\left(-y, z, x\right)\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{-108}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -4.4999999999999998e-29 or 2.0999999999999999e-108 < x Initial program 99.7%
Taylor expanded in x around inf 82.9%
if -4.4999999999999998e-29 < x < -4.39999999999999974e-92 or -2.0000000000000001e-141 < x < 2.0999999999999999e-108Initial program 99.7%
Taylor expanded in x around 0 76.5%
neg-mul-176.5%
distribute-rgt-neg-in76.5%
Simplified76.5%
if -4.39999999999999974e-92 < x < -2.0000000000000001e-141Initial program 99.9%
Taylor expanded in y around 0 84.5%
+-commutative84.5%
associate-*r*84.5%
fma-define84.5%
mul-1-neg84.5%
Simplified84.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* x (cos y))) (t_1 (* z (- (sin y)))))
(if (<= x -1.45e-28)
t_0
(if (<= x -4.8e-92)
t_1
(if (<= x -6.2e-154) (- x (* z y)) (if (<= x 3.3e-109) t_1 t_0))))))
double code(double x, double y, double z) {
double t_0 = x * cos(y);
double t_1 = z * -sin(y);
double tmp;
if (x <= -1.45e-28) {
tmp = t_0;
} else if (x <= -4.8e-92) {
tmp = t_1;
} else if (x <= -6.2e-154) {
tmp = x - (z * y);
} else if (x <= 3.3e-109) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_0 = x * cos(y)
t_1 = z * -sin(y)
if (x <= (-1.45d-28)) then
tmp = t_0
else if (x <= (-4.8d-92)) then
tmp = t_1
else if (x <= (-6.2d-154)) then
tmp = x - (z * y)
else if (x <= 3.3d-109) then
tmp = t_1
else
tmp = t_0
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 (x <= -1.45e-28) {
tmp = t_0;
} else if (x <= -4.8e-92) {
tmp = t_1;
} else if (x <= -6.2e-154) {
tmp = x - (z * y);
} else if (x <= 3.3e-109) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x * math.cos(y) t_1 = z * -math.sin(y) tmp = 0 if x <= -1.45e-28: tmp = t_0 elif x <= -4.8e-92: tmp = t_1 elif x <= -6.2e-154: tmp = x - (z * y) elif x <= 3.3e-109: tmp = t_1 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x * cos(y)) t_1 = Float64(z * Float64(-sin(y))) tmp = 0.0 if (x <= -1.45e-28) tmp = t_0; elseif (x <= -4.8e-92) tmp = t_1; elseif (x <= -6.2e-154) tmp = Float64(x - Float64(z * y)); elseif (x <= 3.3e-109) tmp = t_1; else tmp = t_0; 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 (x <= -1.45e-28) tmp = t_0; elseif (x <= -4.8e-92) tmp = t_1; elseif (x <= -6.2e-154) tmp = x - (z * y); elseif (x <= 3.3e-109) tmp = t_1; else tmp = t_0; 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[x, -1.45e-28], t$95$0, If[LessEqual[x, -4.8e-92], t$95$1, If[LessEqual[x, -6.2e-154], N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.3e-109], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \cos y\\
t_1 := z \cdot \left(-\sin y\right)\\
\mathbf{if}\;x \leq -1.45 \cdot 10^{-28}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -4.8 \cdot 10^{-92}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -6.2 \cdot 10^{-154}:\\
\;\;\;\;x - z \cdot y\\
\mathbf{elif}\;x \leq 3.3 \cdot 10^{-109}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.45000000000000006e-28 or 3.2999999999999999e-109 < x Initial program 99.7%
Taylor expanded in x around inf 82.9%
if -1.45000000000000006e-28 < x < -4.8000000000000002e-92 or -6.19999999999999963e-154 < x < 3.2999999999999999e-109Initial program 99.7%
Taylor expanded in x around 0 76.5%
neg-mul-176.5%
distribute-rgt-neg-in76.5%
Simplified76.5%
if -4.8000000000000002e-92 < x < -6.19999999999999963e-154Initial program 99.9%
Taylor expanded in y around 0 84.5%
mul-1-neg84.5%
unsub-neg84.5%
Simplified84.5%
Final simplification80.7%
(FPCore (x y z) :precision binary64 (if (or (<= y -0.00075) (not (<= y 33000.0))) (* x (cos y)) (+ x (* y (- (* y (+ (* x -0.5) (* (* z y) 0.16666666666666666))) z)))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -0.00075) || !(y <= 33000.0)) {
tmp = x * cos(y);
} else {
tmp = x + (y * ((y * ((x * -0.5) + ((z * y) * 0.16666666666666666))) - 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.00075d0)) .or. (.not. (y <= 33000.0d0))) then
tmp = x * cos(y)
else
tmp = x + (y * ((y * ((x * (-0.5d0)) + ((z * y) * 0.16666666666666666d0))) - z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -0.00075) || !(y <= 33000.0)) {
tmp = x * Math.cos(y);
} else {
tmp = x + (y * ((y * ((x * -0.5) + ((z * y) * 0.16666666666666666))) - z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -0.00075) or not (y <= 33000.0): tmp = x * math.cos(y) else: tmp = x + (y * ((y * ((x * -0.5) + ((z * y) * 0.16666666666666666))) - z)) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -0.00075) || !(y <= 33000.0)) tmp = Float64(x * cos(y)); else tmp = Float64(x + Float64(y * Float64(Float64(y * Float64(Float64(x * -0.5) + Float64(Float64(z * y) * 0.16666666666666666))) - z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -0.00075) || ~((y <= 33000.0))) tmp = x * cos(y); else tmp = x + (y * ((y * ((x * -0.5) + ((z * y) * 0.16666666666666666))) - z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -0.00075], N[Not[LessEqual[y, 33000.0]], $MachinePrecision]], N[(x * N[Cos[y], $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(N[(y * N[(N[(x * -0.5), $MachinePrecision] + N[(N[(z * y), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.00075 \lor \neg \left(y \leq 33000\right):\\
\;\;\;\;x \cdot \cos y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(y \cdot \left(x \cdot -0.5 + \left(z \cdot y\right) \cdot 0.16666666666666666\right) - z\right)\\
\end{array}
\end{array}
if y < -7.5000000000000002e-4 or 33000 < y Initial program 99.5%
Taylor expanded in x around inf 53.9%
if -7.5000000000000002e-4 < y < 33000Initial program 100.0%
Taylor expanded in y around 0 99.3%
Final simplification76.1%
(FPCore (x y z) :precision binary64 (if (or (<= z -2.5e+212) (not (<= z 3.9e+119))) (* z (- y)) x))
double code(double x, double y, double z) {
double tmp;
if ((z <= -2.5e+212) || !(z <= 3.9e+119)) {
tmp = z * -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 ((z <= (-2.5d+212)) .or. (.not. (z <= 3.9d+119))) then
tmp = z * -y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -2.5e+212) || !(z <= 3.9e+119)) {
tmp = z * -y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -2.5e+212) or not (z <= 3.9e+119): tmp = z * -y else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -2.5e+212) || !(z <= 3.9e+119)) tmp = Float64(z * Float64(-y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -2.5e+212) || ~((z <= 3.9e+119))) tmp = z * -y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -2.5e+212], N[Not[LessEqual[z, 3.9e+119]], $MachinePrecision]], N[(z * (-y)), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{+212} \lor \neg \left(z \leq 3.9 \cdot 10^{+119}\right):\\
\;\;\;\;z \cdot \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.49999999999999996e212 or 3.8999999999999998e119 < z Initial program 99.7%
Taylor expanded in y around 0 50.7%
mul-1-neg50.7%
unsub-neg50.7%
Simplified50.7%
Taylor expanded in x around 0 41.7%
associate-*r*41.7%
neg-mul-141.7%
*-commutative41.7%
Simplified41.7%
if -2.49999999999999996e212 < z < 3.8999999999999998e119Initial program 99.7%
Taylor expanded in y around 0 51.7%
mul-1-neg51.7%
unsub-neg51.7%
Simplified51.7%
Taylor expanded in x around inf 44.2%
Final simplification43.7%
(FPCore (x y z) :precision binary64 (- x (* z y)))
double code(double x, double y, double z) {
return x - (z * 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 - (z * y)
end function
public static double code(double x, double y, double z) {
return x - (z * y);
}
def code(x, y, z): return x - (z * y)
function code(x, y, z) return Float64(x - Float64(z * y)) end
function tmp = code(x, y, z) tmp = x - (z * y); end
code[x_, y_, z_] := N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - z \cdot y
\end{array}
Initial program 99.7%
Taylor expanded in y around 0 51.5%
mul-1-neg51.5%
unsub-neg51.5%
Simplified51.5%
Final simplification51.5%
(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.7%
Taylor expanded in y around 0 51.5%
mul-1-neg51.5%
unsub-neg51.5%
Simplified51.5%
Taylor expanded in x around inf 37.7%
herbie shell --seed 2024103
(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))))