
(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 (* (- x y) (* (fma x x (* y y)) (+ x y))))
double code(double x, double y) {
return (x - y) * (fma(x, x, (y * y)) * (x + y));
}
function code(x, y) return Float64(Float64(x - y) * Float64(fma(x, x, Float64(y * y)) * Float64(x + y))) end
code[x_, y_] := N[(N[(x - y), $MachinePrecision] * N[(N[(x * x + N[(y * y), $MachinePrecision]), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x - y\right) \cdot \left(\mathsf{fma}\left(x, x, y \cdot y\right) \cdot \left(x + y\right)\right)
\end{array}
Initial program 85.9%
lift--.f64N/A
lift-pow.f64N/A
sqr-powN/A
lift-pow.f64N/A
sqr-powN/A
difference-of-squaresN/A
lower-*.f64N/A
metadata-evalN/A
unpow2N/A
lower-fma.f64N/A
metadata-evalN/A
unpow2N/A
lower-*.f64N/A
metadata-evalN/A
unpow2N/A
metadata-evalN/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6499.8
Applied rewrites99.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6499.9
Applied rewrites99.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- (pow x 4.0) (pow y 4.0))))
(if (<= t_0 -5e-324)
(- (* y (* y (* y y))))
(if (<= t_0 INFINITY)
(* x (* x (* x x)))
(* (* y y) (* (- x y) (+ x y)))))))
double code(double x, double y) {
double t_0 = pow(x, 4.0) - pow(y, 4.0);
double tmp;
if (t_0 <= -5e-324) {
tmp = -(y * (y * (y * y)));
} else if (t_0 <= ((double) INFINITY)) {
tmp = x * (x * (x * x));
} else {
tmp = (y * y) * ((x - y) * (x + y));
}
return tmp;
}
public static double code(double x, double y) {
double t_0 = Math.pow(x, 4.0) - Math.pow(y, 4.0);
double tmp;
if (t_0 <= -5e-324) {
tmp = -(y * (y * (y * y)));
} else if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = x * (x * (x * x));
} else {
tmp = (y * y) * ((x - y) * (x + y));
}
return tmp;
}
def code(x, y): t_0 = math.pow(x, 4.0) - math.pow(y, 4.0) tmp = 0 if t_0 <= -5e-324: tmp = -(y * (y * (y * y))) elif t_0 <= math.inf: tmp = x * (x * (x * x)) else: tmp = (y * y) * ((x - y) * (x + y)) return tmp
function code(x, y) t_0 = Float64((x ^ 4.0) - (y ^ 4.0)) tmp = 0.0 if (t_0 <= -5e-324) tmp = Float64(-Float64(y * Float64(y * Float64(y * y)))); elseif (t_0 <= Inf) tmp = Float64(x * Float64(x * Float64(x * x))); else tmp = Float64(Float64(y * y) * Float64(Float64(x - y) * Float64(x + y))); end return tmp end
function tmp_2 = code(x, y) t_0 = (x ^ 4.0) - (y ^ 4.0); tmp = 0.0; if (t_0 <= -5e-324) tmp = -(y * (y * (y * y))); elseif (t_0 <= Inf) tmp = x * (x * (x * x)); else tmp = (y * y) * ((x - y) * (x + y)); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[Power[x, 4.0], $MachinePrecision] - N[Power[y, 4.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -5e-324], (-N[(y * N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), If[LessEqual[t$95$0, Infinity], N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * y), $MachinePrecision] * N[(N[(x - y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{4} - {y}^{4}\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{-324}:\\
\;\;\;\;-y \cdot \left(y \cdot \left(y \cdot y\right)\right)\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;x \cdot \left(x \cdot \left(x \cdot x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot y\right) \cdot \left(\left(x - y\right) \cdot \left(x + y\right)\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 x #s(literal 4 binary64)) (pow.f64 y #s(literal 4 binary64))) < -4.94066e-324Initial program 100.0%
lift--.f64N/A
flip--N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip--N/A
lift--.f64N/A
lower-/.f6499.9
lift--.f64N/A
lift-pow.f64N/A
sqr-powN/A
lift-pow.f64N/A
sqr-powN/A
difference-of-squaresN/A
lower-*.f64N/A
Applied rewrites99.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
div-invN/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
difference-of-squaresN/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f6499.6
Applied rewrites99.6%
Taylor expanded in x around inf
lower-/.f64N/A
metadata-evalN/A
pow-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f643.3
Applied rewrites3.3%
Taylor expanded in x around 0
mul-1-negN/A
lower-neg.f64N/A
metadata-evalN/A
pow-plusN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6499.9
Applied rewrites99.9%
if -4.94066e-324 < (-.f64 (pow.f64 x #s(literal 4 binary64)) (pow.f64 y #s(literal 4 binary64))) < +inf.0Initial program 100.0%
Taylor expanded in x around inf
lower-pow.f64100.0
Applied rewrites100.0%
Applied rewrites99.8%
if +inf.0 < (-.f64 (pow.f64 x #s(literal 4 binary64)) (pow.f64 y #s(literal 4 binary64))) Initial program 0.0%
lift--.f64N/A
lift-pow.f64N/A
sqr-powN/A
lift-pow.f64N/A
sqr-powN/A
difference-of-squaresN/A
lower-*.f64N/A
metadata-evalN/A
unpow2N/A
lower-fma.f64N/A
metadata-evalN/A
unpow2N/A
lower-*.f64N/A
metadata-evalN/A
unpow2N/A
metadata-evalN/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f64100.0
Applied rewrites100.0%
Taylor expanded in x around 0
unpow2N/A
lower-*.f64100.0
Applied rewrites100.0%
Final simplification99.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- (pow x 4.0) (pow y 4.0))) (t_1 (* y (* y y))))
(if (<= t_0 -5e-324)
(- (* y t_1))
(if (<= t_0 INFINITY) (* x (* x (* x x))) (* (- x y) t_1)))))
double code(double x, double y) {
double t_0 = pow(x, 4.0) - pow(y, 4.0);
double t_1 = y * (y * y);
double tmp;
if (t_0 <= -5e-324) {
tmp = -(y * t_1);
} else if (t_0 <= ((double) INFINITY)) {
tmp = x * (x * (x * x));
} else {
tmp = (x - y) * t_1;
}
return tmp;
}
public static double code(double x, double y) {
double t_0 = Math.pow(x, 4.0) - Math.pow(y, 4.0);
double t_1 = y * (y * y);
double tmp;
if (t_0 <= -5e-324) {
tmp = -(y * t_1);
} else if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = x * (x * (x * x));
} else {
tmp = (x - y) * t_1;
}
return tmp;
}
def code(x, y): t_0 = math.pow(x, 4.0) - math.pow(y, 4.0) t_1 = y * (y * y) tmp = 0 if t_0 <= -5e-324: tmp = -(y * t_1) elif t_0 <= math.inf: tmp = x * (x * (x * x)) else: tmp = (x - y) * t_1 return tmp
function code(x, y) t_0 = Float64((x ^ 4.0) - (y ^ 4.0)) t_1 = Float64(y * Float64(y * y)) tmp = 0.0 if (t_0 <= -5e-324) tmp = Float64(-Float64(y * t_1)); elseif (t_0 <= Inf) tmp = Float64(x * Float64(x * Float64(x * x))); else tmp = Float64(Float64(x - y) * t_1); end return tmp end
function tmp_2 = code(x, y) t_0 = (x ^ 4.0) - (y ^ 4.0); t_1 = y * (y * y); tmp = 0.0; if (t_0 <= -5e-324) tmp = -(y * t_1); elseif (t_0 <= Inf) tmp = x * (x * (x * x)); else tmp = (x - y) * t_1; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[Power[x, 4.0], $MachinePrecision] - N[Power[y, 4.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -5e-324], (-N[(y * t$95$1), $MachinePrecision]), If[LessEqual[t$95$0, Infinity], N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x - y), $MachinePrecision] * t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{4} - {y}^{4}\\
t_1 := y \cdot \left(y \cdot y\right)\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{-324}:\\
\;\;\;\;-y \cdot t\_1\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;x \cdot \left(x \cdot \left(x \cdot x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x - y\right) \cdot t\_1\\
\end{array}
\end{array}
if (-.f64 (pow.f64 x #s(literal 4 binary64)) (pow.f64 y #s(literal 4 binary64))) < -4.94066e-324Initial program 100.0%
lift--.f64N/A
flip--N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip--N/A
lift--.f64N/A
lower-/.f6499.9
lift--.f64N/A
lift-pow.f64N/A
sqr-powN/A
lift-pow.f64N/A
sqr-powN/A
difference-of-squaresN/A
lower-*.f64N/A
Applied rewrites99.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
div-invN/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
difference-of-squaresN/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f6499.6
Applied rewrites99.6%
Taylor expanded in x around inf
lower-/.f64N/A
metadata-evalN/A
pow-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f643.3
Applied rewrites3.3%
Taylor expanded in x around 0
mul-1-negN/A
lower-neg.f64N/A
metadata-evalN/A
pow-plusN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6499.9
Applied rewrites99.9%
if -4.94066e-324 < (-.f64 (pow.f64 x #s(literal 4 binary64)) (pow.f64 y #s(literal 4 binary64))) < +inf.0Initial program 100.0%
Taylor expanded in x around inf
lower-pow.f64100.0
Applied rewrites100.0%
Applied rewrites99.8%
if +inf.0 < (-.f64 (pow.f64 x #s(literal 4 binary64)) (pow.f64 y #s(literal 4 binary64))) Initial program 0.0%
lift--.f64N/A
lift-pow.f64N/A
sqr-powN/A
lift-pow.f64N/A
sqr-powN/A
difference-of-squaresN/A
lower-*.f64N/A
metadata-evalN/A
unpow2N/A
lower-fma.f64N/A
metadata-evalN/A
unpow2N/A
lower-*.f64N/A
metadata-evalN/A
unpow2N/A
metadata-evalN/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f64100.0
Applied rewrites100.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64100.0
Applied rewrites100.0%
Taylor expanded in x around 0
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6483.3
Applied rewrites83.3%
Final simplification97.5%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- (pow x 4.0) (pow y 4.0))))
(if (<= t_0 -5e-324)
(- (* y (* y (* y y))))
(if (<= t_0 INFINITY) (* x (* x (* x x))) (* (* y y) (* y (- y)))))))
double code(double x, double y) {
double t_0 = pow(x, 4.0) - pow(y, 4.0);
double tmp;
if (t_0 <= -5e-324) {
tmp = -(y * (y * (y * y)));
} else if (t_0 <= ((double) INFINITY)) {
tmp = x * (x * (x * x));
} else {
tmp = (y * y) * (y * -y);
}
return tmp;
}
public static double code(double x, double y) {
double t_0 = Math.pow(x, 4.0) - Math.pow(y, 4.0);
double tmp;
if (t_0 <= -5e-324) {
tmp = -(y * (y * (y * y)));
} else if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = x * (x * (x * x));
} else {
tmp = (y * y) * (y * -y);
}
return tmp;
}
def code(x, y): t_0 = math.pow(x, 4.0) - math.pow(y, 4.0) tmp = 0 if t_0 <= -5e-324: tmp = -(y * (y * (y * y))) elif t_0 <= math.inf: tmp = x * (x * (x * x)) else: tmp = (y * y) * (y * -y) return tmp
function code(x, y) t_0 = Float64((x ^ 4.0) - (y ^ 4.0)) tmp = 0.0 if (t_0 <= -5e-324) tmp = Float64(-Float64(y * Float64(y * Float64(y * y)))); elseif (t_0 <= Inf) tmp = Float64(x * Float64(x * Float64(x * x))); else tmp = Float64(Float64(y * y) * Float64(y * Float64(-y))); end return tmp end
function tmp_2 = code(x, y) t_0 = (x ^ 4.0) - (y ^ 4.0); tmp = 0.0; if (t_0 <= -5e-324) tmp = -(y * (y * (y * y))); elseif (t_0 <= Inf) tmp = x * (x * (x * x)); else tmp = (y * y) * (y * -y); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[Power[x, 4.0], $MachinePrecision] - N[Power[y, 4.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -5e-324], (-N[(y * N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), If[LessEqual[t$95$0, Infinity], N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * y), $MachinePrecision] * N[(y * (-y)), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{4} - {y}^{4}\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{-324}:\\
\;\;\;\;-y \cdot \left(y \cdot \left(y \cdot y\right)\right)\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;x \cdot \left(x \cdot \left(x \cdot x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot y\right) \cdot \left(y \cdot \left(-y\right)\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 x #s(literal 4 binary64)) (pow.f64 y #s(literal 4 binary64))) < -4.94066e-324Initial program 100.0%
lift--.f64N/A
flip--N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip--N/A
lift--.f64N/A
lower-/.f6499.9
lift--.f64N/A
lift-pow.f64N/A
sqr-powN/A
lift-pow.f64N/A
sqr-powN/A
difference-of-squaresN/A
lower-*.f64N/A
Applied rewrites99.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
div-invN/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
difference-of-squaresN/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f6499.6
Applied rewrites99.6%
Taylor expanded in x around inf
lower-/.f64N/A
metadata-evalN/A
pow-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f643.3
Applied rewrites3.3%
Taylor expanded in x around 0
mul-1-negN/A
lower-neg.f64N/A
metadata-evalN/A
pow-plusN/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6499.9
Applied rewrites99.9%
if -4.94066e-324 < (-.f64 (pow.f64 x #s(literal 4 binary64)) (pow.f64 y #s(literal 4 binary64))) < +inf.0Initial program 100.0%
Taylor expanded in x around inf
lower-pow.f64100.0
Applied rewrites100.0%
Applied rewrites99.8%
if +inf.0 < (-.f64 (pow.f64 x #s(literal 4 binary64)) (pow.f64 y #s(literal 4 binary64))) Initial program 0.0%
lift--.f64N/A
flip--N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip--N/A
lift--.f64N/A
lower-/.f640.0
lift--.f64N/A
lift-pow.f64N/A
sqr-powN/A
lift-pow.f64N/A
sqr-powN/A
difference-of-squaresN/A
lower-*.f64N/A
Applied rewrites100.0%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
div-invN/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
difference-of-squaresN/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64100.0
Applied rewrites100.0%
Taylor expanded in x around 0
mul-1-negN/A
lower-neg.f64N/A
metadata-evalN/A
pow-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6466.7
Applied rewrites66.7%
Final simplification95.2%
(FPCore (x y) :precision binary64 (let* ((t_0 (- (pow x 4.0) (pow y 4.0))) (t_1 (* (* y y) (* y (- y))))) (if (<= t_0 -5e-324) t_1 (if (<= t_0 INFINITY) (* x (* x (* x x))) t_1))))
double code(double x, double y) {
double t_0 = pow(x, 4.0) - pow(y, 4.0);
double t_1 = (y * y) * (y * -y);
double tmp;
if (t_0 <= -5e-324) {
tmp = t_1;
} else if (t_0 <= ((double) INFINITY)) {
tmp = x * (x * (x * x));
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y) {
double t_0 = Math.pow(x, 4.0) - Math.pow(y, 4.0);
double t_1 = (y * y) * (y * -y);
double tmp;
if (t_0 <= -5e-324) {
tmp = t_1;
} else if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = x * (x * (x * x));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y): t_0 = math.pow(x, 4.0) - math.pow(y, 4.0) t_1 = (y * y) * (y * -y) tmp = 0 if t_0 <= -5e-324: tmp = t_1 elif t_0 <= math.inf: tmp = x * (x * (x * x)) else: tmp = t_1 return tmp
function code(x, y) t_0 = Float64((x ^ 4.0) - (y ^ 4.0)) t_1 = Float64(Float64(y * y) * Float64(y * Float64(-y))) tmp = 0.0 if (t_0 <= -5e-324) tmp = t_1; elseif (t_0 <= Inf) tmp = Float64(x * Float64(x * Float64(x * x))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y) t_0 = (x ^ 4.0) - (y ^ 4.0); t_1 = (y * y) * (y * -y); tmp = 0.0; if (t_0 <= -5e-324) tmp = t_1; elseif (t_0 <= Inf) tmp = x * (x * (x * x)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[Power[x, 4.0], $MachinePrecision] - N[Power[y, 4.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(y * y), $MachinePrecision] * N[(y * (-y)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -5e-324], t$95$1, If[LessEqual[t$95$0, Infinity], N[(x * N[(x * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{4} - {y}^{4}\\
t_1 := \left(y \cdot y\right) \cdot \left(y \cdot \left(-y\right)\right)\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{-324}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;x \cdot \left(x \cdot \left(x \cdot x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (pow.f64 x #s(literal 4 binary64)) (pow.f64 y #s(literal 4 binary64))) < -4.94066e-324 or +inf.0 < (-.f64 (pow.f64 x #s(literal 4 binary64)) (pow.f64 y #s(literal 4 binary64))) Initial program 70.7%
lift--.f64N/A
flip--N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
flip--N/A
lift--.f64N/A
lower-/.f6470.7
lift--.f64N/A
lift-pow.f64N/A
sqr-powN/A
lift-pow.f64N/A
sqr-powN/A
difference-of-squaresN/A
lower-*.f64N/A
Applied rewrites99.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
div-invN/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
difference-of-squaresN/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f6499.7
Applied rewrites99.7%
Taylor expanded in x around 0
mul-1-negN/A
lower-neg.f64N/A
metadata-evalN/A
pow-sqrN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6490.1
Applied rewrites90.1%
if -4.94066e-324 < (-.f64 (pow.f64 x #s(literal 4 binary64)) (pow.f64 y #s(literal 4 binary64))) < +inf.0Initial program 100.0%
Taylor expanded in x around inf
lower-pow.f64100.0
Applied rewrites100.0%
Applied rewrites99.8%
Final simplification95.1%
(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 85.9%
Taylor expanded in x around inf
lower-pow.f6457.7
Applied rewrites57.7%
Applied rewrites57.7%
Final simplification57.7%
(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(Float64(x * x) * Float64(x * x)) end
function tmp = code(x, y) tmp = (x * x) * (x * x); end
code[x_, y_] := N[(N[(x * x), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot x\right) \cdot \left(x \cdot x\right)
\end{array}
Initial program 85.9%
Taylor expanded in x around inf
lower-pow.f6457.7
Applied rewrites57.7%
Applied rewrites57.6%
herbie shell --seed 2024237
(FPCore (x y)
:name "Radioactive exchange between two surfaces"
:precision binary64
(- (pow x 4.0) (pow y 4.0)))