
(FPCore (x y) :precision binary64 (- (pow x 4.0) (pow y 4.0)))
double code(double x, double y) {
return pow(x, 4.0) - pow(y, 4.0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x ** 4.0d0) - (y ** 4.0d0)
end function
public static double code(double x, double y) {
return Math.pow(x, 4.0) - Math.pow(y, 4.0);
}
def code(x, y): return math.pow(x, 4.0) - math.pow(y, 4.0)
function code(x, y) return Float64((x ^ 4.0) - (y ^ 4.0)) end
function tmp = code(x, y) tmp = (x ^ 4.0) - (y ^ 4.0); end
code[x_, y_] := N[(N[Power[x, 4.0], $MachinePrecision] - N[Power[y, 4.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{x}^{4} - {y}^{4}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 7 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (- (pow x 4.0) (pow y 4.0)))
double code(double x, double y) {
return pow(x, 4.0) - pow(y, 4.0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x ** 4.0d0) - (y ** 4.0d0)
end function
public static double code(double x, double y) {
return Math.pow(x, 4.0) - Math.pow(y, 4.0);
}
def code(x, y): return math.pow(x, 4.0) - math.pow(y, 4.0)
function code(x, y) return Float64((x ^ 4.0) - (y ^ 4.0)) end
function tmp = code(x, y) tmp = (x ^ 4.0) - (y ^ 4.0); end
code[x_, y_] := N[(N[Power[x, 4.0], $MachinePrecision] - N[Power[y, 4.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{x}^{4} - {y}^{4}
\end{array}
(FPCore (x y) :precision binary64 (if (<= y -1.35e+154) (- 0.0 (* y (* y (* y y)))) (/ (- (* x x) (* y y)) (/ 1.0 (+ (* y y) (* x x))))))
double code(double x, double y) {
double tmp;
if (y <= -1.35e+154) {
tmp = 0.0 - (y * (y * (y * y)));
} else {
tmp = ((x * x) - (y * y)) / (1.0 / ((y * y) + (x * x)));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-1.35d+154)) then
tmp = 0.0d0 - (y * (y * (y * y)))
else
tmp = ((x * x) - (y * y)) / (1.0d0 / ((y * y) + (x * x)))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1.35e+154) {
tmp = 0.0 - (y * (y * (y * y)));
} else {
tmp = ((x * x) - (y * y)) / (1.0 / ((y * y) + (x * x)));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.35e+154: tmp = 0.0 - (y * (y * (y * y))) else: tmp = ((x * x) - (y * y)) / (1.0 / ((y * y) + (x * x))) return tmp
function code(x, y) tmp = 0.0 if (y <= -1.35e+154) tmp = Float64(0.0 - Float64(y * Float64(y * Float64(y * y)))); else tmp = Float64(Float64(Float64(x * x) - Float64(y * y)) / Float64(1.0 / Float64(Float64(y * y) + Float64(x * x)))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.35e+154) tmp = 0.0 - (y * (y * (y * y))); else tmp = ((x * x) - (y * y)) / (1.0 / ((y * y) + (x * x))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.35e+154], N[(0.0 - N[(y * N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * x), $MachinePrecision] - N[(y * y), $MachinePrecision]), $MachinePrecision] / N[(1.0 / N[(N[(y * y), $MachinePrecision] + N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;0 - y \cdot \left(y \cdot \left(y \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot x - y \cdot y}{\frac{1}{y \cdot y + x \cdot x}}\\
\end{array}
\end{array}
if y < -1.35000000000000003e154Initial program 57.1%
Taylor expanded in x around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
pow-lowering-pow.f6496.4%
Simplified96.4%
sub0-negN/A
neg-lowering-neg.f64N/A
metadata-evalN/A
pow-plusN/A
cube-unmultN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6496.4%
Applied egg-rr96.4%
if -1.35000000000000003e154 < y Initial program 91.2%
sqr-powN/A
sqr-powN/A
difference-of-squaresN/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
metadata-evalN/A
unpow2N/A
*-lowering-*.f64N/A
metadata-evalN/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
unpow2N/A
*-lowering-*.f64N/A
metadata-evalN/A
unpow2N/A
*-lowering-*.f6498.1%
Applied egg-rr98.1%
flip3-+N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
clear-numN/A
flip3-+N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
Applied egg-rr98.1%
Final simplification97.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- (* x x) (* y y))) (t_1 (/ t_0 (/ 1.0 (* y y)))))
(if (<= y -1.35e+154)
(- 0.0 (* y (* y (* y y))))
(if (<= y -9.2e-71)
t_1
(if (<= y 1.2e-73) (/ t_0 (/ (/ 1.0 x) x)) t_1)))))
double code(double x, double y) {
double t_0 = (x * x) - (y * y);
double t_1 = t_0 / (1.0 / (y * y));
double tmp;
if (y <= -1.35e+154) {
tmp = 0.0 - (y * (y * (y * y)));
} else if (y <= -9.2e-71) {
tmp = t_1;
} else if (y <= 1.2e-73) {
tmp = t_0 / ((1.0 / x) / x);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (x * x) - (y * y)
t_1 = t_0 / (1.0d0 / (y * y))
if (y <= (-1.35d+154)) then
tmp = 0.0d0 - (y * (y * (y * y)))
else if (y <= (-9.2d-71)) then
tmp = t_1
else if (y <= 1.2d-73) then
tmp = t_0 / ((1.0d0 / x) / x)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = (x * x) - (y * y);
double t_1 = t_0 / (1.0 / (y * y));
double tmp;
if (y <= -1.35e+154) {
tmp = 0.0 - (y * (y * (y * y)));
} else if (y <= -9.2e-71) {
tmp = t_1;
} else if (y <= 1.2e-73) {
tmp = t_0 / ((1.0 / x) / x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y): t_0 = (x * x) - (y * y) t_1 = t_0 / (1.0 / (y * y)) tmp = 0 if y <= -1.35e+154: tmp = 0.0 - (y * (y * (y * y))) elif y <= -9.2e-71: tmp = t_1 elif y <= 1.2e-73: tmp = t_0 / ((1.0 / x) / x) else: tmp = t_1 return tmp
function code(x, y) t_0 = Float64(Float64(x * x) - Float64(y * y)) t_1 = Float64(t_0 / Float64(1.0 / Float64(y * y))) tmp = 0.0 if (y <= -1.35e+154) tmp = Float64(0.0 - Float64(y * Float64(y * Float64(y * y)))); elseif (y <= -9.2e-71) tmp = t_1; elseif (y <= 1.2e-73) tmp = Float64(t_0 / Float64(Float64(1.0 / x) / x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y) t_0 = (x * x) - (y * y); t_1 = t_0 / (1.0 / (y * y)); tmp = 0.0; if (y <= -1.35e+154) tmp = 0.0 - (y * (y * (y * y))); elseif (y <= -9.2e-71) tmp = t_1; elseif (y <= 1.2e-73) tmp = t_0 / ((1.0 / x) / x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(x * x), $MachinePrecision] - N[(y * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 / N[(1.0 / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.35e+154], N[(0.0 - N[(y * N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -9.2e-71], t$95$1, If[LessEqual[y, 1.2e-73], N[(t$95$0 / N[(N[(1.0 / x), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot x - y \cdot y\\
t_1 := \frac{t\_0}{\frac{1}{y \cdot y}}\\
\mathbf{if}\;y \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;0 - y \cdot \left(y \cdot \left(y \cdot y\right)\right)\\
\mathbf{elif}\;y \leq -9.2 \cdot 10^{-71}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{-73}:\\
\;\;\;\;\frac{t\_0}{\frac{\frac{1}{x}}{x}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.35000000000000003e154Initial program 57.1%
Taylor expanded in x around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
pow-lowering-pow.f6496.4%
Simplified96.4%
sub0-negN/A
neg-lowering-neg.f64N/A
metadata-evalN/A
pow-plusN/A
cube-unmultN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6496.4%
Applied egg-rr96.4%
if -1.35000000000000003e154 < y < -9.1999999999999994e-71 or 1.20000000000000003e-73 < y Initial program 81.3%
sqr-powN/A
sqr-powN/A
difference-of-squaresN/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
metadata-evalN/A
unpow2N/A
*-lowering-*.f64N/A
metadata-evalN/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
unpow2N/A
*-lowering-*.f64N/A
metadata-evalN/A
unpow2N/A
*-lowering-*.f6496.1%
Applied egg-rr96.1%
flip3-+N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
clear-numN/A
flip3-+N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
Applied egg-rr96.1%
Taylor expanded in x around 0
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6494.3%
Simplified94.3%
if -9.1999999999999994e-71 < y < 1.20000000000000003e-73Initial program 100.0%
sqr-powN/A
sqr-powN/A
difference-of-squaresN/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
metadata-evalN/A
unpow2N/A
*-lowering-*.f64N/A
metadata-evalN/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
unpow2N/A
*-lowering-*.f64N/A
metadata-evalN/A
unpow2N/A
*-lowering-*.f6499.8%
Applied egg-rr99.8%
flip3-+N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
clear-numN/A
flip3-+N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
Applied egg-rr99.9%
Taylor expanded in x around inf
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6499.4%
Simplified99.4%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6499.4%
Applied egg-rr99.4%
Final simplification96.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (- (* x x) (* y y)) (/ 1.0 (* y y)))))
(if (<= y -1.35e+154)
(- 0.0 (* y (* y (* y y))))
(if (<= y -2.9e-66) t_0 (if (<= y 7.4e-79) (* x (* x (* x x))) t_0)))))
double code(double x, double y) {
double t_0 = ((x * x) - (y * y)) / (1.0 / (y * y));
double tmp;
if (y <= -1.35e+154) {
tmp = 0.0 - (y * (y * (y * y)));
} else if (y <= -2.9e-66) {
tmp = t_0;
} else if (y <= 7.4e-79) {
tmp = x * (x * (x * x));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = ((x * x) - (y * y)) / (1.0d0 / (y * y))
if (y <= (-1.35d+154)) then
tmp = 0.0d0 - (y * (y * (y * y)))
else if (y <= (-2.9d-66)) then
tmp = t_0
else if (y <= 7.4d-79) then
tmp = x * (x * (x * x))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = ((x * x) - (y * y)) / (1.0 / (y * y));
double tmp;
if (y <= -1.35e+154) {
tmp = 0.0 - (y * (y * (y * y)));
} else if (y <= -2.9e-66) {
tmp = t_0;
} else if (y <= 7.4e-79) {
tmp = x * (x * (x * x));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = ((x * x) - (y * y)) / (1.0 / (y * y)) tmp = 0 if y <= -1.35e+154: tmp = 0.0 - (y * (y * (y * y))) elif y <= -2.9e-66: tmp = t_0 elif y <= 7.4e-79: tmp = x * (x * (x * x)) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(Float64(Float64(x * x) - Float64(y * y)) / Float64(1.0 / Float64(y * y))) tmp = 0.0 if (y <= -1.35e+154) tmp = Float64(0.0 - Float64(y * Float64(y * Float64(y * y)))); elseif (y <= -2.9e-66) tmp = t_0; elseif (y <= 7.4e-79) tmp = Float64(x * Float64(x * Float64(x * x))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = ((x * x) - (y * y)) / (1.0 / (y * y)); tmp = 0.0; if (y <= -1.35e+154) tmp = 0.0 - (y * (y * (y * y))); elseif (y <= -2.9e-66) tmp = t_0; elseif (y <= 7.4e-79) tmp = x * (x * (x * x)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[(x * x), $MachinePrecision] - N[(y * y), $MachinePrecision]), $MachinePrecision] / N[(1.0 / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.35e+154], N[(0.0 - N[(y * N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -2.9e-66], t$95$0, If[LessEqual[y, 7.4e-79], N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x \cdot x - y \cdot y}{\frac{1}{y \cdot y}}\\
\mathbf{if}\;y \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;0 - y \cdot \left(y \cdot \left(y \cdot y\right)\right)\\
\mathbf{elif}\;y \leq -2.9 \cdot 10^{-66}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 7.4 \cdot 10^{-79}:\\
\;\;\;\;x \cdot \left(x \cdot \left(x \cdot x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -1.35000000000000003e154Initial program 57.1%
Taylor expanded in x around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
pow-lowering-pow.f6496.4%
Simplified96.4%
sub0-negN/A
neg-lowering-neg.f64N/A
metadata-evalN/A
pow-plusN/A
cube-unmultN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6496.4%
Applied egg-rr96.4%
if -1.35000000000000003e154 < y < -2.90000000000000011e-66 or 7.40000000000000035e-79 < y Initial program 81.3%
sqr-powN/A
sqr-powN/A
difference-of-squaresN/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
metadata-evalN/A
unpow2N/A
*-lowering-*.f64N/A
metadata-evalN/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
unpow2N/A
*-lowering-*.f64N/A
metadata-evalN/A
unpow2N/A
*-lowering-*.f6496.1%
Applied egg-rr96.1%
flip3-+N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
clear-numN/A
flip3-+N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
Applied egg-rr96.1%
Taylor expanded in x around 0
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6494.3%
Simplified94.3%
if -2.90000000000000011e-66 < y < 7.40000000000000035e-79Initial program 100.0%
sqr-powN/A
sqr-powN/A
difference-of-squaresN/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
metadata-evalN/A
unpow2N/A
*-lowering-*.f64N/A
metadata-evalN/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
unpow2N/A
*-lowering-*.f64N/A
metadata-evalN/A
unpow2N/A
*-lowering-*.f6499.8%
Applied egg-rr99.8%
Taylor expanded in x around inf
metadata-evalN/A
pow-sqrN/A
unpow2N/A
associate-*r*N/A
unpow2N/A
cube-multN/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6499.4%
Simplified99.4%
Final simplification96.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (- (* x x) (* y y)) (/ 1.0 (* x x)))))
(if (<= x -3.4e-39)
t_0
(if (<= x 2.25e-58) (- 0.0 (* y (* y (* y y)))) t_0))))
double code(double x, double y) {
double t_0 = ((x * x) - (y * y)) / (1.0 / (x * x));
double tmp;
if (x <= -3.4e-39) {
tmp = t_0;
} else if (x <= 2.25e-58) {
tmp = 0.0 - (y * (y * (y * y)));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = ((x * x) - (y * y)) / (1.0d0 / (x * x))
if (x <= (-3.4d-39)) then
tmp = t_0
else if (x <= 2.25d-58) then
tmp = 0.0d0 - (y * (y * (y * y)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = ((x * x) - (y * y)) / (1.0 / (x * x));
double tmp;
if (x <= -3.4e-39) {
tmp = t_0;
} else if (x <= 2.25e-58) {
tmp = 0.0 - (y * (y * (y * y)));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = ((x * x) - (y * y)) / (1.0 / (x * x)) tmp = 0 if x <= -3.4e-39: tmp = t_0 elif x <= 2.25e-58: tmp = 0.0 - (y * (y * (y * y))) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(Float64(Float64(x * x) - Float64(y * y)) / Float64(1.0 / Float64(x * x))) tmp = 0.0 if (x <= -3.4e-39) tmp = t_0; elseif (x <= 2.25e-58) tmp = Float64(0.0 - Float64(y * Float64(y * Float64(y * y)))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = ((x * x) - (y * y)) / (1.0 / (x * x)); tmp = 0.0; if (x <= -3.4e-39) tmp = t_0; elseif (x <= 2.25e-58) tmp = 0.0 - (y * (y * (y * y))); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[(x * x), $MachinePrecision] - N[(y * y), $MachinePrecision]), $MachinePrecision] / N[(1.0 / N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.4e-39], t$95$0, If[LessEqual[x, 2.25e-58], N[(0.0 - N[(y * N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x \cdot x - y \cdot y}{\frac{1}{x \cdot x}}\\
\mathbf{if}\;x \leq -3.4 \cdot 10^{-39}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 2.25 \cdot 10^{-58}:\\
\;\;\;\;0 - y \cdot \left(y \cdot \left(y \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -3.3999999999999999e-39 or 2.2500000000000001e-58 < x Initial program 77.0%
sqr-powN/A
sqr-powN/A
difference-of-squaresN/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
metadata-evalN/A
unpow2N/A
*-lowering-*.f64N/A
metadata-evalN/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
unpow2N/A
*-lowering-*.f64N/A
metadata-evalN/A
unpow2N/A
*-lowering-*.f6491.2%
Applied egg-rr91.2%
flip3-+N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
clear-numN/A
flip3-+N/A
/-lowering-/.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
Applied egg-rr91.2%
Taylor expanded in x around inf
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6485.2%
Simplified85.2%
if -3.3999999999999999e-39 < x < 2.2500000000000001e-58Initial program 100.0%
Taylor expanded in x around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
pow-lowering-pow.f6497.6%
Simplified97.6%
sub0-negN/A
neg-lowering-neg.f64N/A
metadata-evalN/A
pow-plusN/A
cube-unmultN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6497.5%
Applied egg-rr97.5%
Final simplification90.8%
(FPCore (x y) :precision binary64 (if (<= y -1.35e+154) (- 0.0 (* y (* y (* y y)))) (* (- (* x x) (* y y)) (+ (* y y) (* x x)))))
double code(double x, double y) {
double tmp;
if (y <= -1.35e+154) {
tmp = 0.0 - (y * (y * (y * y)));
} else {
tmp = ((x * x) - (y * y)) * ((y * y) + (x * x));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-1.35d+154)) then
tmp = 0.0d0 - (y * (y * (y * y)))
else
tmp = ((x * x) - (y * y)) * ((y * y) + (x * x))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1.35e+154) {
tmp = 0.0 - (y * (y * (y * y)));
} else {
tmp = ((x * x) - (y * y)) * ((y * y) + (x * x));
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.35e+154: tmp = 0.0 - (y * (y * (y * y))) else: tmp = ((x * x) - (y * y)) * ((y * y) + (x * x)) return tmp
function code(x, y) tmp = 0.0 if (y <= -1.35e+154) tmp = Float64(0.0 - Float64(y * Float64(y * Float64(y * y)))); else tmp = Float64(Float64(Float64(x * x) - Float64(y * y)) * Float64(Float64(y * y) + Float64(x * x))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.35e+154) tmp = 0.0 - (y * (y * (y * y))); else tmp = ((x * x) - (y * y)) * ((y * y) + (x * x)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1.35e+154], N[(0.0 - N[(y * N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * x), $MachinePrecision] - N[(y * y), $MachinePrecision]), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] + N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;0 - y \cdot \left(y \cdot \left(y \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot x - y \cdot y\right) \cdot \left(y \cdot y + x \cdot x\right)\\
\end{array}
\end{array}
if y < -1.35000000000000003e154Initial program 57.1%
Taylor expanded in x around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
pow-lowering-pow.f6496.4%
Simplified96.4%
sub0-negN/A
neg-lowering-neg.f64N/A
metadata-evalN/A
pow-plusN/A
cube-unmultN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6496.4%
Applied egg-rr96.4%
if -1.35000000000000003e154 < y Initial program 91.2%
sqr-powN/A
sqr-powN/A
difference-of-squaresN/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
metadata-evalN/A
unpow2N/A
*-lowering-*.f64N/A
metadata-evalN/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
unpow2N/A
*-lowering-*.f64N/A
metadata-evalN/A
unpow2N/A
*-lowering-*.f6498.1%
Applied egg-rr98.1%
Final simplification97.9%
(FPCore (x y) :precision binary64 (let* ((t_0 (- 0.0 (* y (* y (* y y)))))) (if (<= y -3.4e-65) t_0 (if (<= y 2.4e-62) (* x (* x (* x x))) t_0))))
double code(double x, double y) {
double t_0 = 0.0 - (y * (y * (y * y)));
double tmp;
if (y <= -3.4e-65) {
tmp = t_0;
} else if (y <= 2.4e-62) {
tmp = x * (x * (x * x));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = 0.0d0 - (y * (y * (y * y)))
if (y <= (-3.4d-65)) then
tmp = t_0
else if (y <= 2.4d-62) then
tmp = x * (x * (x * x))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 0.0 - (y * (y * (y * y)));
double tmp;
if (y <= -3.4e-65) {
tmp = t_0;
} else if (y <= 2.4e-62) {
tmp = x * (x * (x * x));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = 0.0 - (y * (y * (y * y))) tmp = 0 if y <= -3.4e-65: tmp = t_0 elif y <= 2.4e-62: tmp = x * (x * (x * x)) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(0.0 - Float64(y * Float64(y * Float64(y * y)))) tmp = 0.0 if (y <= -3.4e-65) tmp = t_0; elseif (y <= 2.4e-62) tmp = Float64(x * Float64(x * Float64(x * x))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = 0.0 - (y * (y * (y * y))); tmp = 0.0; if (y <= -3.4e-65) tmp = t_0; elseif (y <= 2.4e-62) tmp = x * (x * (x * x)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(0.0 - N[(y * N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.4e-65], t$95$0, If[LessEqual[y, 2.4e-62], N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0 - y \cdot \left(y \cdot \left(y \cdot y\right)\right)\\
\mathbf{if}\;y \leq -3.4 \cdot 10^{-65}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{-62}:\\
\;\;\;\;x \cdot \left(x \cdot \left(x \cdot x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -3.39999999999999987e-65 or 2.39999999999999984e-62 < y Initial program 75.9%
Taylor expanded in x around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
pow-lowering-pow.f6480.5%
Simplified80.5%
sub0-negN/A
neg-lowering-neg.f64N/A
metadata-evalN/A
pow-plusN/A
cube-unmultN/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6480.4%
Applied egg-rr80.4%
if -3.39999999999999987e-65 < y < 2.39999999999999984e-62Initial program 100.0%
sqr-powN/A
sqr-powN/A
difference-of-squaresN/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
metadata-evalN/A
unpow2N/A
*-lowering-*.f64N/A
metadata-evalN/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
unpow2N/A
*-lowering-*.f64N/A
metadata-evalN/A
unpow2N/A
*-lowering-*.f6499.8%
Applied egg-rr99.8%
Taylor expanded in x around inf
metadata-evalN/A
pow-sqrN/A
unpow2N/A
associate-*r*N/A
unpow2N/A
cube-multN/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6499.5%
Simplified99.5%
Final simplification89.6%
(FPCore (x y) :precision binary64 (* x (* x (* x x))))
double code(double x, double y) {
return x * (x * (x * x));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x * (x * (x * x))
end function
public static double code(double x, double y) {
return x * (x * (x * x));
}
def code(x, y): return x * (x * (x * x))
function code(x, y) return Float64(x * Float64(x * Float64(x * x))) end
function tmp = code(x, y) tmp = x * (x * (x * x)); end
code[x_, y_] := N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(x \cdot \left(x \cdot x\right)\right)
\end{array}
Initial program 87.5%
sqr-powN/A
sqr-powN/A
difference-of-squaresN/A
*-commutativeN/A
*-lowering-*.f64N/A
--lowering--.f64N/A
metadata-evalN/A
unpow2N/A
*-lowering-*.f64N/A
metadata-evalN/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
metadata-evalN/A
unpow2N/A
*-lowering-*.f64N/A
metadata-evalN/A
unpow2N/A
*-lowering-*.f6495.2%
Applied egg-rr95.2%
Taylor expanded in x around inf
metadata-evalN/A
pow-sqrN/A
unpow2N/A
associate-*r*N/A
unpow2N/A
cube-multN/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6458.6%
Simplified58.6%
herbie shell --seed 2024191
(FPCore (x y)
:name "Radioactive exchange between two surfaces"
:precision binary64
(- (pow x 4.0) (pow y 4.0)))