
(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:
Herbie found 17 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}
\\
\left(x + \cos y\right) - z \cdot \sin y
\end{array}
(FPCore (x y z) :precision binary64 (+ (cos y) (fma z (- (sin y)) x)))
double code(double x, double y, double z) {
return cos(y) + fma(z, -sin(y), x);
}
function code(x, y, z) return Float64(cos(y) + fma(z, Float64(-sin(y)), x)) end
code[x_, y_, z_] := N[(N[Cos[y], $MachinePrecision] + N[(z * (-N[Sin[y], $MachinePrecision]) + x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\cos y + \mathsf{fma}\left(z, -\sin y, x\right)
\end{array}
Initial program 99.9%
cancel-sign-sub-inv99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
sin-neg99.9%
fma-define99.9%
sin-neg99.9%
Simplified99.9%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (sin y))))
(if (<= x -1.8e-8)
(- (+ x 1.0) t_0)
(if (<= x 1.55e-22) (- (cos y) t_0) (+ (fma z (- (sin y)) x) 1.0)))))
double code(double x, double y, double z) {
double t_0 = z * sin(y);
double tmp;
if (x <= -1.8e-8) {
tmp = (x + 1.0) - t_0;
} else if (x <= 1.55e-22) {
tmp = cos(y) - t_0;
} else {
tmp = fma(z, -sin(y), x) + 1.0;
}
return tmp;
}
function code(x, y, z) t_0 = Float64(z * sin(y)) tmp = 0.0 if (x <= -1.8e-8) tmp = Float64(Float64(x + 1.0) - t_0); elseif (x <= 1.55e-22) tmp = Float64(cos(y) - t_0); else tmp = Float64(fma(z, Float64(-sin(y)), x) + 1.0); end return tmp end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.8e-8], N[(N[(x + 1.0), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[x, 1.55e-22], N[(N[Cos[y], $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(z * (-N[Sin[y], $MachinePrecision]) + x), $MachinePrecision] + 1.0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \sin y\\
\mathbf{if}\;x \leq -1.8 \cdot 10^{-8}:\\
\;\;\;\;\left(x + 1\right) - t\_0\\
\mathbf{elif}\;x \leq 1.55 \cdot 10^{-22}:\\
\;\;\;\;\cos y - t\_0\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, -\sin y, x\right) + 1\\
\end{array}
\end{array}
if x < -1.79999999999999991e-8Initial program 100.0%
Taylor expanded in y around 0 98.6%
if -1.79999999999999991e-8 < x < 1.55000000000000006e-22Initial program 99.9%
cancel-sign-sub-inv99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
sin-neg99.9%
fma-define99.9%
sin-neg99.9%
Simplified99.9%
Taylor expanded in x around 0 99.4%
neg-mul-199.4%
sub-neg99.4%
Simplified99.4%
if 1.55000000000000006e-22 < x Initial program 99.9%
cancel-sign-sub-inv99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
sin-neg99.9%
fma-define100.0%
sin-neg100.0%
Simplified100.0%
Taylor expanded in y around 0 99.9%
Final simplification99.4%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* z (sin y))))
(if (or (<= x -3.2e-7) (not (<= x 1.55e-22)))
(- (+ x 1.0) t_0)
(- (cos y) t_0))))
double code(double x, double y, double z) {
double t_0 = z * sin(y);
double tmp;
if ((x <= -3.2e-7) || !(x <= 1.55e-22)) {
tmp = (x + 1.0) - t_0;
} else {
tmp = cos(y) - t_0;
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = z * sin(y)
if ((x <= (-3.2d-7)) .or. (.not. (x <= 1.55d-22))) then
tmp = (x + 1.0d0) - t_0
else
tmp = cos(y) - t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = z * Math.sin(y);
double tmp;
if ((x <= -3.2e-7) || !(x <= 1.55e-22)) {
tmp = (x + 1.0) - t_0;
} else {
tmp = Math.cos(y) - t_0;
}
return tmp;
}
def code(x, y, z): t_0 = z * math.sin(y) tmp = 0 if (x <= -3.2e-7) or not (x <= 1.55e-22): tmp = (x + 1.0) - t_0 else: tmp = math.cos(y) - t_0 return tmp
function code(x, y, z) t_0 = Float64(z * sin(y)) tmp = 0.0 if ((x <= -3.2e-7) || !(x <= 1.55e-22)) tmp = Float64(Float64(x + 1.0) - t_0); else tmp = Float64(cos(y) - t_0); end return tmp end
function tmp_2 = code(x, y, z) t_0 = z * sin(y); tmp = 0.0; if ((x <= -3.2e-7) || ~((x <= 1.55e-22))) tmp = (x + 1.0) - t_0; else tmp = cos(y) - t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[x, -3.2e-7], N[Not[LessEqual[x, 1.55e-22]], $MachinePrecision]], N[(N[(x + 1.0), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[Cos[y], $MachinePrecision] - t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := z \cdot \sin y\\
\mathbf{if}\;x \leq -3.2 \cdot 10^{-7} \lor \neg \left(x \leq 1.55 \cdot 10^{-22}\right):\\
\;\;\;\;\left(x + 1\right) - t\_0\\
\mathbf{else}:\\
\;\;\;\;\cos y - t\_0\\
\end{array}
\end{array}
if x < -3.2000000000000001e-7 or 1.55000000000000006e-22 < x Initial program 100.0%
Taylor expanded in y around 0 99.3%
if -3.2000000000000001e-7 < x < 1.55000000000000006e-22Initial program 99.9%
cancel-sign-sub-inv99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
sin-neg99.9%
fma-define99.9%
sin-neg99.9%
Simplified99.9%
Taylor expanded in x around 0 99.4%
neg-mul-199.4%
sub-neg99.4%
Simplified99.4%
Final simplification99.4%
(FPCore (x y z) :precision binary64 (- (+ (cos y) x) (* z (sin y))))
double code(double x, double y, double z) {
return (cos(y) + x) - (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 = (cos(y) + x) - (z * sin(y))
end function
public static double code(double x, double y, double z) {
return (Math.cos(y) + x) - (z * Math.sin(y));
}
def code(x, y, z): return (math.cos(y) + x) - (z * math.sin(y))
function code(x, y, z) return Float64(Float64(cos(y) + x) - Float64(z * sin(y))) end
function tmp = code(x, y, z) tmp = (cos(y) + x) - (z * sin(y)); end
code[x_, y_, z_] := N[(N[(N[Cos[y], $MachinePrecision] + x), $MachinePrecision] - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\cos y + x\right) - z \cdot \sin y
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y z)
:precision binary64
(if (<= z -1.95e+160)
(* (sin y) (- z))
(if (or (<= z -3.2e+60) (not (<= z 2.8e+34)))
(+ 1.0 (- x (* y z)))
(+ (cos y) x))))
double code(double x, double y, double z) {
double tmp;
if (z <= -1.95e+160) {
tmp = sin(y) * -z;
} else if ((z <= -3.2e+60) || !(z <= 2.8e+34)) {
tmp = 1.0 + (x - (y * z));
} else {
tmp = cos(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 <= (-1.95d+160)) then
tmp = sin(y) * -z
else if ((z <= (-3.2d+60)) .or. (.not. (z <= 2.8d+34))) then
tmp = 1.0d0 + (x - (y * z))
else
tmp = cos(y) + x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -1.95e+160) {
tmp = Math.sin(y) * -z;
} else if ((z <= -3.2e+60) || !(z <= 2.8e+34)) {
tmp = 1.0 + (x - (y * z));
} else {
tmp = Math.cos(y) + x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -1.95e+160: tmp = math.sin(y) * -z elif (z <= -3.2e+60) or not (z <= 2.8e+34): tmp = 1.0 + (x - (y * z)) else: tmp = math.cos(y) + x return tmp
function code(x, y, z) tmp = 0.0 if (z <= -1.95e+160) tmp = Float64(sin(y) * Float64(-z)); elseif ((z <= -3.2e+60) || !(z <= 2.8e+34)) tmp = Float64(1.0 + Float64(x - Float64(y * z))); else tmp = Float64(cos(y) + x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -1.95e+160) tmp = sin(y) * -z; elseif ((z <= -3.2e+60) || ~((z <= 2.8e+34))) tmp = 1.0 + (x - (y * z)); else tmp = cos(y) + x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -1.95e+160], N[(N[Sin[y], $MachinePrecision] * (-z)), $MachinePrecision], If[Or[LessEqual[z, -3.2e+60], N[Not[LessEqual[z, 2.8e+34]], $MachinePrecision]], N[(1.0 + N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[y], $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.95 \cdot 10^{+160}:\\
\;\;\;\;\sin y \cdot \left(-z\right)\\
\mathbf{elif}\;z \leq -3.2 \cdot 10^{+60} \lor \neg \left(z \leq 2.8 \cdot 10^{+34}\right):\\
\;\;\;\;1 + \left(x - y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;\cos y + x\\
\end{array}
\end{array}
if z < -1.95000000000000004e160Initial program 99.8%
cancel-sign-sub-inv99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
sin-neg99.8%
fma-define99.9%
sin-neg99.9%
Simplified99.9%
Taylor expanded in z around inf 85.1%
neg-mul-185.1%
distribute-rgt-neg-in85.1%
Simplified85.1%
if -1.95000000000000004e160 < z < -3.19999999999999991e60 or 2.80000000000000008e34 < z Initial program 99.9%
cancel-sign-sub-inv99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
sin-neg99.9%
fma-define99.9%
sin-neg99.9%
Simplified99.9%
Taylor expanded in y around 0 70.6%
mul-1-neg70.6%
unsub-neg70.6%
Simplified70.6%
if -3.19999999999999991e60 < z < 2.80000000000000008e34Initial program 100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
sin-neg100.0%
fma-define100.0%
sin-neg100.0%
Simplified100.0%
Taylor expanded in z around 0 94.6%
Final simplification86.4%
(FPCore (x y z) :precision binary64 (if (or (<= z -48000000.0) (not (<= z 1e-30))) (- (+ x 1.0) (* z (sin y))) (+ (cos y) x)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -48000000.0) || !(z <= 1e-30)) {
tmp = (x + 1.0) - (z * sin(y));
} else {
tmp = cos(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 <= (-48000000.0d0)) .or. (.not. (z <= 1d-30))) then
tmp = (x + 1.0d0) - (z * sin(y))
else
tmp = cos(y) + x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -48000000.0) || !(z <= 1e-30)) {
tmp = (x + 1.0) - (z * Math.sin(y));
} else {
tmp = Math.cos(y) + x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -48000000.0) or not (z <= 1e-30): tmp = (x + 1.0) - (z * math.sin(y)) else: tmp = math.cos(y) + x return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -48000000.0) || !(z <= 1e-30)) tmp = Float64(Float64(x + 1.0) - Float64(z * sin(y))); else tmp = Float64(cos(y) + x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -48000000.0) || ~((z <= 1e-30))) tmp = (x + 1.0) - (z * sin(y)); else tmp = cos(y) + x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -48000000.0], N[Not[LessEqual[z, 1e-30]], $MachinePrecision]], N[(N[(x + 1.0), $MachinePrecision] - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[y], $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -48000000 \lor \neg \left(z \leq 10^{-30}\right):\\
\;\;\;\;\left(x + 1\right) - z \cdot \sin y\\
\mathbf{else}:\\
\;\;\;\;\cos y + x\\
\end{array}
\end{array}
if z < -4.8e7 or 1e-30 < z Initial program 99.9%
Taylor expanded in y around 0 99.1%
if -4.8e7 < z < 1e-30Initial program 100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
sin-neg100.0%
fma-define100.0%
sin-neg100.0%
Simplified100.0%
Taylor expanded in z around 0 99.0%
Final simplification99.0%
(FPCore (x y z) :precision binary64 (if (or (<= z -215000000.0) (not (<= z 2.35e+88))) (- x (* z (sin y))) (+ (cos y) x)))
double code(double x, double y, double z) {
double tmp;
if ((z <= -215000000.0) || !(z <= 2.35e+88)) {
tmp = x - (z * sin(y));
} else {
tmp = cos(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 <= (-215000000.0d0)) .or. (.not. (z <= 2.35d+88))) then
tmp = x - (z * sin(y))
else
tmp = cos(y) + x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((z <= -215000000.0) || !(z <= 2.35e+88)) {
tmp = x - (z * Math.sin(y));
} else {
tmp = Math.cos(y) + x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (z <= -215000000.0) or not (z <= 2.35e+88): tmp = x - (z * math.sin(y)) else: tmp = math.cos(y) + x return tmp
function code(x, y, z) tmp = 0.0 if ((z <= -215000000.0) || !(z <= 2.35e+88)) tmp = Float64(x - Float64(z * sin(y))); else tmp = Float64(cos(y) + x); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((z <= -215000000.0) || ~((z <= 2.35e+88))) tmp = x - (z * sin(y)); else tmp = cos(y) + x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[z, -215000000.0], N[Not[LessEqual[z, 2.35e+88]], $MachinePrecision]], N[(x - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[y], $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -215000000 \lor \neg \left(z \leq 2.35 \cdot 10^{+88}\right):\\
\;\;\;\;x - z \cdot \sin y\\
\mathbf{else}:\\
\;\;\;\;\cos y + x\\
\end{array}
\end{array}
if z < -2.15e8 or 2.35000000000000004e88 < z Initial program 99.9%
log1p-expm1-u99.9%
Applied egg-rr99.9%
Taylor expanded in x around inf 91.3%
if -2.15e8 < z < 2.35000000000000004e88Initial program 99.9%
cancel-sign-sub-inv99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
sin-neg99.9%
fma-define99.9%
sin-neg99.9%
Simplified99.9%
Taylor expanded in z around 0 95.5%
Final simplification93.7%
(FPCore (x y z) :precision binary64 (if (or (<= y -0.00076) (not (<= y 48.0))) (+ (cos y) x) (+ 1.0 (+ x (* y (- (* y (* y (* z 0.16666666666666666))) z))))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -0.00076) || !(y <= 48.0)) {
tmp = cos(y) + x;
} else {
tmp = 1.0 + (x + (y * ((y * (y * (z * 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.00076d0)) .or. (.not. (y <= 48.0d0))) then
tmp = cos(y) + x
else
tmp = 1.0d0 + (x + (y * ((y * (y * (z * 0.16666666666666666d0))) - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -0.00076) || !(y <= 48.0)) {
tmp = Math.cos(y) + x;
} else {
tmp = 1.0 + (x + (y * ((y * (y * (z * 0.16666666666666666))) - z)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -0.00076) or not (y <= 48.0): tmp = math.cos(y) + x else: tmp = 1.0 + (x + (y * ((y * (y * (z * 0.16666666666666666))) - z))) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -0.00076) || !(y <= 48.0)) tmp = Float64(cos(y) + x); else tmp = Float64(1.0 + Float64(x + Float64(y * Float64(Float64(y * Float64(y * Float64(z * 0.16666666666666666))) - z)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -0.00076) || ~((y <= 48.0))) tmp = cos(y) + x; else tmp = 1.0 + (x + (y * ((y * (y * (z * 0.16666666666666666))) - z))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -0.00076], N[Not[LessEqual[y, 48.0]], $MachinePrecision]], N[(N[Cos[y], $MachinePrecision] + x), $MachinePrecision], N[(1.0 + N[(x + N[(y * N[(N[(y * N[(y * N[(z * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.00076 \lor \neg \left(y \leq 48\right):\\
\;\;\;\;\cos y + x\\
\mathbf{else}:\\
\;\;\;\;1 + \left(x + y \cdot \left(y \cdot \left(y \cdot \left(z \cdot 0.16666666666666666\right)\right) - z\right)\right)\\
\end{array}
\end{array}
if y < -7.6000000000000004e-4 or 48 < y Initial program 99.8%
cancel-sign-sub-inv99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
sin-neg99.8%
fma-define99.8%
sin-neg99.8%
Simplified99.8%
Taylor expanded in z around 0 63.2%
if -7.6000000000000004e-4 < y < 48Initial program 100.0%
Taylor expanded in y around 0 98.8%
Taylor expanded in y around inf 98.8%
*-commutative98.8%
associate-*r*98.8%
Simplified98.8%
Final simplification82.3%
(FPCore (x y z) :precision binary64 (if (<= z -2.5e+59) (- 1.0 (* z (sin y))) (if (<= z 5.5e+34) (+ (cos y) x) (+ 1.0 (- x (* y z))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -2.5e+59) {
tmp = 1.0 - (z * sin(y));
} else if (z <= 5.5e+34) {
tmp = cos(y) + x;
} else {
tmp = 1.0 + (x - (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 (z <= (-2.5d+59)) then
tmp = 1.0d0 - (z * sin(y))
else if (z <= 5.5d+34) then
tmp = cos(y) + x
else
tmp = 1.0d0 + (x - (y * z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -2.5e+59) {
tmp = 1.0 - (z * Math.sin(y));
} else if (z <= 5.5e+34) {
tmp = Math.cos(y) + x;
} else {
tmp = 1.0 + (x - (y * z));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -2.5e+59: tmp = 1.0 - (z * math.sin(y)) elif z <= 5.5e+34: tmp = math.cos(y) + x else: tmp = 1.0 + (x - (y * z)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -2.5e+59) tmp = Float64(1.0 - Float64(z * sin(y))); elseif (z <= 5.5e+34) tmp = Float64(cos(y) + x); else tmp = Float64(1.0 + Float64(x - Float64(y * z))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -2.5e+59) tmp = 1.0 - (z * sin(y)); elseif (z <= 5.5e+34) tmp = cos(y) + x; else tmp = 1.0 + (x - (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -2.5e+59], N[(1.0 - N[(z * N[Sin[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.5e+34], N[(N[Cos[y], $MachinePrecision] + x), $MachinePrecision], N[(1.0 + N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{+59}:\\
\;\;\;\;1 - z \cdot \sin y\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{+34}:\\
\;\;\;\;\cos y + x\\
\mathbf{else}:\\
\;\;\;\;1 + \left(x - y \cdot z\right)\\
\end{array}
\end{array}
if z < -2.4999999999999999e59Initial program 99.8%
cancel-sign-sub-inv99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
sin-neg99.8%
fma-define99.8%
sin-neg99.8%
Simplified99.8%
Taylor expanded in x around 0 78.0%
neg-mul-178.0%
sub-neg78.0%
Simplified78.0%
Taylor expanded in y around 0 78.0%
if -2.4999999999999999e59 < z < 5.4999999999999996e34Initial program 100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
sin-neg100.0%
fma-define100.0%
sin-neg100.0%
Simplified100.0%
Taylor expanded in z around 0 94.6%
if 5.4999999999999996e34 < z Initial program 99.9%
cancel-sign-sub-inv99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
sin-neg99.9%
fma-define99.9%
sin-neg99.9%
Simplified99.9%
Taylor expanded in y around 0 71.1%
mul-1-neg71.1%
unsub-neg71.1%
Simplified71.1%
Final simplification86.3%
(FPCore (x y z) :precision binary64 (if (or (<= x -2.7e-9) (not (<= x 1.55e-22))) (+ x 1.0) (cos y)))
double code(double x, double y, double z) {
double tmp;
if ((x <= -2.7e-9) || !(x <= 1.55e-22)) {
tmp = x + 1.0;
} 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 ((x <= (-2.7d-9)) .or. (.not. (x <= 1.55d-22))) then
tmp = x + 1.0d0
else
tmp = cos(y)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -2.7e-9) || !(x <= 1.55e-22)) {
tmp = x + 1.0;
} else {
tmp = Math.cos(y);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -2.7e-9) or not (x <= 1.55e-22): tmp = x + 1.0 else: tmp = math.cos(y) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -2.7e-9) || !(x <= 1.55e-22)) tmp = Float64(x + 1.0); else tmp = cos(y); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -2.7e-9) || ~((x <= 1.55e-22))) tmp = x + 1.0; else tmp = cos(y); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -2.7e-9], N[Not[LessEqual[x, 1.55e-22]], $MachinePrecision]], N[(x + 1.0), $MachinePrecision], N[Cos[y], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.7 \cdot 10^{-9} \lor \neg \left(x \leq 1.55 \cdot 10^{-22}\right):\\
\;\;\;\;x + 1\\
\mathbf{else}:\\
\;\;\;\;\cos y\\
\end{array}
\end{array}
if x < -2.7000000000000002e-9 or 1.55000000000000006e-22 < x Initial program 100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
sin-neg100.0%
fma-define100.0%
sin-neg100.0%
Simplified100.0%
Taylor expanded in y around 0 85.4%
if -2.7000000000000002e-9 < x < 1.55000000000000006e-22Initial program 99.9%
cancel-sign-sub-inv99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
sin-neg99.9%
fma-define99.9%
sin-neg99.9%
Simplified99.9%
Taylor expanded in z around 0 60.9%
Taylor expanded in x around 0 60.5%
Final simplification72.8%
(FPCore (x y z) :precision binary64 (if (or (<= y -500000000000.0) (not (<= y 54.0))) (+ x 1.0) (+ 1.0 (+ x (* y (- (* y (- (* (* y z) 0.16666666666666666) 0.5)) z))))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -500000000000.0) || !(y <= 54.0)) {
tmp = x + 1.0;
} else {
tmp = 1.0 + (x + (y * ((y * (((y * z) * 0.16666666666666666) - 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 <= (-500000000000.0d0)) .or. (.not. (y <= 54.0d0))) then
tmp = x + 1.0d0
else
tmp = 1.0d0 + (x + (y * ((y * (((y * z) * 0.16666666666666666d0) - 0.5d0)) - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((y <= -500000000000.0) || !(y <= 54.0)) {
tmp = x + 1.0;
} else {
tmp = 1.0 + (x + (y * ((y * (((y * z) * 0.16666666666666666) - 0.5)) - z)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -500000000000.0) or not (y <= 54.0): tmp = x + 1.0 else: tmp = 1.0 + (x + (y * ((y * (((y * z) * 0.16666666666666666) - 0.5)) - z))) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -500000000000.0) || !(y <= 54.0)) tmp = Float64(x + 1.0); else tmp = Float64(1.0 + Float64(x + Float64(y * Float64(Float64(y * Float64(Float64(Float64(y * z) * 0.16666666666666666) - 0.5)) - z)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -500000000000.0) || ~((y <= 54.0))) tmp = x + 1.0; else tmp = 1.0 + (x + (y * ((y * (((y * z) * 0.16666666666666666) - 0.5)) - z))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -500000000000.0], N[Not[LessEqual[y, 54.0]], $MachinePrecision]], N[(x + 1.0), $MachinePrecision], N[(1.0 + N[(x + N[(y * N[(N[(y * N[(N[(N[(y * z), $MachinePrecision] * 0.16666666666666666), $MachinePrecision] - 0.5), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -500000000000 \lor \neg \left(y \leq 54\right):\\
\;\;\;\;x + 1\\
\mathbf{else}:\\
\;\;\;\;1 + \left(x + y \cdot \left(y \cdot \left(\left(y \cdot z\right) \cdot 0.16666666666666666 - 0.5\right) - z\right)\right)\\
\end{array}
\end{array}
if y < -5e11 or 54 < y Initial program 99.8%
cancel-sign-sub-inv99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
sin-neg99.8%
fma-define99.8%
sin-neg99.8%
Simplified99.8%
Taylor expanded in y around 0 37.3%
if -5e11 < y < 54Initial program 100.0%
Taylor expanded in y around 0 98.1%
Final simplification70.8%
(FPCore (x y z) :precision binary64 (if (or (<= y -1600.0) (not (<= y 53000000000000.0))) (+ x 1.0) (+ 1.0 (+ x (* y (- (* y -0.5) z))))))
double code(double x, double y, double z) {
double tmp;
if ((y <= -1600.0) || !(y <= 53000000000000.0)) {
tmp = x + 1.0;
} else {
tmp = 1.0 + (x + (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 <= (-1600.0d0)) .or. (.not. (y <= 53000000000000.0d0))) then
tmp = x + 1.0d0
else
tmp = 1.0d0 + (x + (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 <= -1600.0) || !(y <= 53000000000000.0)) {
tmp = x + 1.0;
} else {
tmp = 1.0 + (x + (y * ((y * -0.5) - z)));
}
return tmp;
}
def code(x, y, z): tmp = 0 if (y <= -1600.0) or not (y <= 53000000000000.0): tmp = x + 1.0 else: tmp = 1.0 + (x + (y * ((y * -0.5) - z))) return tmp
function code(x, y, z) tmp = 0.0 if ((y <= -1600.0) || !(y <= 53000000000000.0)) tmp = Float64(x + 1.0); else tmp = Float64(1.0 + Float64(x + Float64(y * Float64(Float64(y * -0.5) - z)))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((y <= -1600.0) || ~((y <= 53000000000000.0))) tmp = x + 1.0; else tmp = 1.0 + (x + (y * ((y * -0.5) - z))); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[y, -1600.0], N[Not[LessEqual[y, 53000000000000.0]], $MachinePrecision]], N[(x + 1.0), $MachinePrecision], N[(1.0 + N[(x + N[(y * N[(N[(y * -0.5), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1600 \lor \neg \left(y \leq 53000000000000\right):\\
\;\;\;\;x + 1\\
\mathbf{else}:\\
\;\;\;\;1 + \left(x + y \cdot \left(y \cdot -0.5 - z\right)\right)\\
\end{array}
\end{array}
if y < -1600 or 5.3e13 < y Initial program 99.8%
cancel-sign-sub-inv99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
sin-neg99.8%
fma-define99.8%
sin-neg99.8%
Simplified99.8%
Taylor expanded in y around 0 37.8%
if -1600 < y < 5.3e13Initial program 100.0%
Taylor expanded in y around 0 98.0%
Final simplification70.7%
(FPCore (x y z) :precision binary64 (if (<= y -0.00076) (* x (+ 1.0 (/ 1.0 x))) (if (<= y 2.5e+63) (+ 1.0 (- x (* y z))) (+ x 1.0))))
double code(double x, double y, double z) {
double tmp;
if (y <= -0.00076) {
tmp = x * (1.0 + (1.0 / x));
} else if (y <= 2.5e+63) {
tmp = 1.0 + (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 (y <= (-0.00076d0)) then
tmp = x * (1.0d0 + (1.0d0 / x))
else if (y <= 2.5d+63) then
tmp = 1.0d0 + (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 (y <= -0.00076) {
tmp = x * (1.0 + (1.0 / x));
} else if (y <= 2.5e+63) {
tmp = 1.0 + (x - (y * z));
} else {
tmp = x + 1.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -0.00076: tmp = x * (1.0 + (1.0 / x)) elif y <= 2.5e+63: tmp = 1.0 + (x - (y * z)) else: tmp = x + 1.0 return tmp
function code(x, y, z) tmp = 0.0 if (y <= -0.00076) tmp = Float64(x * Float64(1.0 + Float64(1.0 / x))); elseif (y <= 2.5e+63) tmp = Float64(1.0 + 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 (y <= -0.00076) tmp = x * (1.0 + (1.0 / x)); elseif (y <= 2.5e+63) tmp = 1.0 + (x - (y * z)); else tmp = x + 1.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -0.00076], N[(x * N[(1.0 + N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.5e+63], N[(1.0 + N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.00076:\\
\;\;\;\;x \cdot \left(1 + \frac{1}{x}\right)\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{+63}:\\
\;\;\;\;1 + \left(x - y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + 1\\
\end{array}
\end{array}
if y < -7.6000000000000004e-4Initial program 99.8%
cancel-sign-sub-inv99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
sin-neg99.8%
fma-define99.9%
sin-neg99.9%
Simplified99.9%
Taylor expanded in y around 0 33.8%
Taylor expanded in x around inf 33.8%
if -7.6000000000000004e-4 < y < 2.50000000000000005e63Initial program 100.0%
cancel-sign-sub-inv100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
distribute-lft-neg-out100.0%
distribute-rgt-neg-in100.0%
sin-neg100.0%
fma-define100.0%
sin-neg100.0%
Simplified100.0%
Taylor expanded in y around 0 96.9%
mul-1-neg96.9%
unsub-neg96.9%
Simplified96.9%
if 2.50000000000000005e63 < y Initial program 99.8%
cancel-sign-sub-inv99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
distribute-lft-neg-out99.8%
distribute-rgt-neg-in99.8%
sin-neg99.8%
fma-define99.8%
sin-neg99.8%
Simplified99.8%
Taylor expanded in y around 0 44.2%
Final simplification70.6%
(FPCore (x y z) :precision binary64 (if (or (<= x -4e-10) (not (<= x 0.00016))) (+ x 1.0) (- 1.0 (* y z))))
double code(double x, double y, double z) {
double tmp;
if ((x <= -4e-10) || !(x <= 0.00016)) {
tmp = x + 1.0;
} else {
tmp = 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 ((x <= (-4d-10)) .or. (.not. (x <= 0.00016d0))) then
tmp = x + 1.0d0
else
tmp = 1.0d0 - (y * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -4e-10) || !(x <= 0.00016)) {
tmp = x + 1.0;
} else {
tmp = 1.0 - (y * z);
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -4e-10) or not (x <= 0.00016): tmp = x + 1.0 else: tmp = 1.0 - (y * z) return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -4e-10) || !(x <= 0.00016)) tmp = Float64(x + 1.0); else tmp = Float64(1.0 - Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -4e-10) || ~((x <= 0.00016))) tmp = x + 1.0; else tmp = 1.0 - (y * z); end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -4e-10], N[Not[LessEqual[x, 0.00016]], $MachinePrecision]], N[(x + 1.0), $MachinePrecision], N[(1.0 - N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4 \cdot 10^{-10} \lor \neg \left(x \leq 0.00016\right):\\
\;\;\;\;x + 1\\
\mathbf{else}:\\
\;\;\;\;1 - y \cdot z\\
\end{array}
\end{array}
if x < -4.00000000000000015e-10 or 1.60000000000000013e-4 < x Initial program 99.9%
cancel-sign-sub-inv99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
sin-neg99.9%
fma-define100.0%
sin-neg100.0%
Simplified100.0%
Taylor expanded in y around 0 86.1%
if -4.00000000000000015e-10 < x < 1.60000000000000013e-4Initial program 99.9%
cancel-sign-sub-inv99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
sin-neg99.9%
fma-define99.9%
sin-neg99.9%
Simplified99.9%
Taylor expanded in x around 0 99.6%
neg-mul-199.6%
sub-neg99.6%
Simplified99.6%
Taylor expanded in y around 0 49.3%
*-commutative49.3%
Simplified49.3%
Taylor expanded in y around 0 50.8%
mul-1-neg50.8%
unsub-neg50.8%
Simplified50.8%
Final simplification68.0%
(FPCore (x y z) :precision binary64 (if (<= x -1.8e-67) x (if (<= x 1.0) 1.0 x)))
double code(double x, double y, double z) {
double tmp;
if (x <= -1.8e-67) {
tmp = x;
} else if (x <= 1.0) {
tmp = 1.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) :: tmp
if (x <= (-1.8d-67)) then
tmp = x
else if (x <= 1.0d0) then
tmp = 1.0d0
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (x <= -1.8e-67) {
tmp = x;
} else if (x <= 1.0) {
tmp = 1.0;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z): tmp = 0 if x <= -1.8e-67: tmp = x elif x <= 1.0: tmp = 1.0 else: tmp = x return tmp
function code(x, y, z) tmp = 0.0 if (x <= -1.8e-67) tmp = x; elseif (x <= 1.0) tmp = 1.0; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (x <= -1.8e-67) tmp = x; elseif (x <= 1.0) tmp = 1.0; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[x, -1.8e-67], x, If[LessEqual[x, 1.0], 1.0, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.8 \cdot 10^{-67}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.8e-67 or 1 < x Initial program 99.9%
cancel-sign-sub-inv99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
sin-neg99.9%
fma-define99.9%
sin-neg99.9%
Simplified99.9%
Taylor expanded in x around inf 80.6%
if -1.8e-67 < x < 1Initial program 99.9%
cancel-sign-sub-inv99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
sin-neg99.9%
fma-define99.9%
sin-neg99.9%
Simplified99.9%
Taylor expanded in y around 0 40.5%
Taylor expanded in x around 0 40.5%
(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}
Initial program 99.9%
cancel-sign-sub-inv99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
sin-neg99.9%
fma-define99.9%
sin-neg99.9%
Simplified99.9%
Taylor expanded in y around 0 61.7%
Final simplification61.7%
(FPCore (x y z) :precision binary64 1.0)
double code(double x, double y, double z) {
return 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 = 1.0d0
end function
public static double code(double x, double y, double z) {
return 1.0;
}
def code(x, y, z): return 1.0
function code(x, y, z) return 1.0 end
function tmp = code(x, y, z) tmp = 1.0; end
code[x_, y_, z_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 99.9%
cancel-sign-sub-inv99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
distribute-lft-neg-out99.9%
distribute-rgt-neg-in99.9%
sin-neg99.9%
fma-define99.9%
sin-neg99.9%
Simplified99.9%
Taylor expanded in y around 0 61.7%
Taylor expanded in x around 0 21.4%
herbie shell --seed 2024185
(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))))