
(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) (* (+ x y) (fma x x (* y y)))))
double code(double x, double y) {
return (x - y) * ((x + y) * fma(x, x, (y * y)));
}
function code(x, y) return Float64(Float64(x - y) * Float64(Float64(x + y) * fma(x, x, Float64(y * y)))) end
code[x_, y_] := N[(N[(x - y), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] * N[(x * x + N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x - y\right) \cdot \left(\left(x + y\right) \cdot \mathsf{fma}\left(x, x, y \cdot y\right)\right)
\end{array}
Initial program 83.2%
lift--.f64N/A
lift-pow.f64N/A
sqr-powN/A
lift-pow.f64N/A
sqr-powN/A
difference-of-squaresN/A
lower-*.f64N/A
+-commutativeN/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%
Applied rewrites97.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-/.f64N/A
rgt-mult-inverseN/A
metadata-evalN/A
div-invN/A
/-rgt-identityN/A
lower-*.f64N/A
lower-+.f6499.8
lift-fma.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.8
Applied rewrites99.8%
(FPCore (x y) :precision binary64 (if (<= (- (pow x 4.0) (pow y 4.0)) -5e-296) (* (- x y) (* (* (+ y x) y) y)) (* (- x y) (* (* (+ y x) x) x))))
double code(double x, double y) {
double tmp;
if ((pow(x, 4.0) - pow(y, 4.0)) <= -5e-296) {
tmp = (x - y) * (((y + x) * y) * y);
} else {
tmp = (x - y) * (((y + x) * x) * x);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (((x ** 4.0d0) - (y ** 4.0d0)) <= (-5d-296)) then
tmp = (x - y) * (((y + x) * y) * y)
else
tmp = (x - y) * (((y + x) * x) * x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((Math.pow(x, 4.0) - Math.pow(y, 4.0)) <= -5e-296) {
tmp = (x - y) * (((y + x) * y) * y);
} else {
tmp = (x - y) * (((y + x) * x) * x);
}
return tmp;
}
def code(x, y): tmp = 0 if (math.pow(x, 4.0) - math.pow(y, 4.0)) <= -5e-296: tmp = (x - y) * (((y + x) * y) * y) else: tmp = (x - y) * (((y + x) * x) * x) return tmp
function code(x, y) tmp = 0.0 if (Float64((x ^ 4.0) - (y ^ 4.0)) <= -5e-296) tmp = Float64(Float64(x - y) * Float64(Float64(Float64(y + x) * y) * y)); else tmp = Float64(Float64(x - y) * Float64(Float64(Float64(y + x) * x) * x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (((x ^ 4.0) - (y ^ 4.0)) <= -5e-296) tmp = (x - y) * (((y + x) * y) * y); else tmp = (x - y) * (((y + x) * x) * x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[N[(N[Power[x, 4.0], $MachinePrecision] - N[Power[y, 4.0], $MachinePrecision]), $MachinePrecision], -5e-296], N[(N[(x - y), $MachinePrecision] * N[(N[(N[(y + x), $MachinePrecision] * y), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], N[(N[(x - y), $MachinePrecision] * N[(N[(N[(y + x), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{x}^{4} - {y}^{4} \leq -5 \cdot 10^{-296}:\\
\;\;\;\;\left(x - y\right) \cdot \left(\left(\left(y + x\right) \cdot y\right) \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x - y\right) \cdot \left(\left(\left(y + x\right) \cdot x\right) \cdot x\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 x #s(literal 4 binary64)) (pow.f64 y #s(literal 4 binary64))) < -5.0000000000000003e-296Initial program 100.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
+-commutativeN/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.6
Applied rewrites99.6%
Applied rewrites99.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-/.f64N/A
rgt-mult-inverseN/A
metadata-evalN/A
div-invN/A
/-rgt-identityN/A
lower-*.f64N/A
lower-+.f6499.7
lift-fma.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.7
Applied rewrites99.7%
Taylor expanded in x around 0
cube-multN/A
unpow2N/A
distribute-rgt-outN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f6499.7
Applied rewrites99.7%
if -5.0000000000000003e-296 < (-.f64 (pow.f64 x #s(literal 4 binary64)) (pow.f64 y #s(literal 4 binary64))) Initial program 74.2%
lift--.f64N/A
lift-pow.f64N/A
sqr-powN/A
lift-pow.f64N/A
sqr-powN/A
difference-of-squaresN/A
lower-*.f64N/A
+-commutativeN/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.9
Applied rewrites99.9%
Applied rewrites96.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-/.f64N/A
rgt-mult-inverseN/A
metadata-evalN/A
div-invN/A
/-rgt-identityN/A
lower-*.f64N/A
lower-+.f6499.9
lift-fma.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
Applied rewrites99.9%
Taylor expanded in y around 0
unpow3N/A
unpow2N/A
distribute-lft-outN/A
+-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f6499.5
Applied rewrites99.5%
(FPCore (x y) :precision binary64 (if (<= (- (pow x 4.0) (pow y 4.0)) -5e-296) (* (* y y) (* (- y) y)) (* (- x y) (* (* (+ y x) x) x))))
double code(double x, double y) {
double tmp;
if ((pow(x, 4.0) - pow(y, 4.0)) <= -5e-296) {
tmp = (y * y) * (-y * y);
} else {
tmp = (x - y) * (((y + x) * x) * x);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (((x ** 4.0d0) - (y ** 4.0d0)) <= (-5d-296)) then
tmp = (y * y) * (-y * y)
else
tmp = (x - y) * (((y + x) * x) * x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((Math.pow(x, 4.0) - Math.pow(y, 4.0)) <= -5e-296) {
tmp = (y * y) * (-y * y);
} else {
tmp = (x - y) * (((y + x) * x) * x);
}
return tmp;
}
def code(x, y): tmp = 0 if (math.pow(x, 4.0) - math.pow(y, 4.0)) <= -5e-296: tmp = (y * y) * (-y * y) else: tmp = (x - y) * (((y + x) * x) * x) return tmp
function code(x, y) tmp = 0.0 if (Float64((x ^ 4.0) - (y ^ 4.0)) <= -5e-296) tmp = Float64(Float64(y * y) * Float64(Float64(-y) * y)); else tmp = Float64(Float64(x - y) * Float64(Float64(Float64(y + x) * x) * x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (((x ^ 4.0) - (y ^ 4.0)) <= -5e-296) tmp = (y * y) * (-y * y); else tmp = (x - y) * (((y + x) * x) * x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[N[(N[Power[x, 4.0], $MachinePrecision] - N[Power[y, 4.0], $MachinePrecision]), $MachinePrecision], -5e-296], N[(N[(y * y), $MachinePrecision] * N[((-y) * y), $MachinePrecision]), $MachinePrecision], N[(N[(x - y), $MachinePrecision] * N[(N[(N[(y + x), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{x}^{4} - {y}^{4} \leq -5 \cdot 10^{-296}:\\
\;\;\;\;\left(y \cdot y\right) \cdot \left(\left(-y\right) \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x - y\right) \cdot \left(\left(\left(y + x\right) \cdot x\right) \cdot x\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 x #s(literal 4 binary64)) (pow.f64 y #s(literal 4 binary64))) < -5.0000000000000003e-296Initial program 100.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
+-commutativeN/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.6
Applied rewrites99.6%
Taylor expanded in x around inf
distribute-lft-inN/A
distribute-lft1-inN/A
metadata-evalN/A
mul0-lftN/A
distribute-lft-inN/A
metadata-evalN/A
*-rgt-identityN/A
unpow2N/A
lower-*.f641.3
Applied rewrites1.3%
Taylor expanded in x around 0
unpow2N/A
lower-*.f641.3
Applied rewrites1.3%
Taylor expanded in x around 0
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6499.6
Applied rewrites99.6%
if -5.0000000000000003e-296 < (-.f64 (pow.f64 x #s(literal 4 binary64)) (pow.f64 y #s(literal 4 binary64))) Initial program 74.2%
lift--.f64N/A
lift-pow.f64N/A
sqr-powN/A
lift-pow.f64N/A
sqr-powN/A
difference-of-squaresN/A
lower-*.f64N/A
+-commutativeN/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.9
Applied rewrites99.9%
Applied rewrites96.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-/.f64N/A
rgt-mult-inverseN/A
metadata-evalN/A
div-invN/A
/-rgt-identityN/A
lower-*.f64N/A
lower-+.f6499.9
lift-fma.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
Applied rewrites99.9%
Taylor expanded in y around 0
unpow3N/A
unpow2N/A
distribute-lft-outN/A
+-commutativeN/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f6499.5
Applied rewrites99.5%
(FPCore (x y) :precision binary64 (if (or (<= x -3.6e+179) (not (<= x 1.45e+167))) (* (* y y) (* x x)) (* (* y y) (* (- y) y))))
double code(double x, double y) {
double tmp;
if ((x <= -3.6e+179) || !(x <= 1.45e+167)) {
tmp = (y * y) * (x * x);
} else {
tmp = (y * y) * (-y * y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((x <= (-3.6d+179)) .or. (.not. (x <= 1.45d+167))) then
tmp = (y * y) * (x * x)
else
tmp = (y * y) * (-y * y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((x <= -3.6e+179) || !(x <= 1.45e+167)) {
tmp = (y * y) * (x * x);
} else {
tmp = (y * y) * (-y * y);
}
return tmp;
}
def code(x, y): tmp = 0 if (x <= -3.6e+179) or not (x <= 1.45e+167): tmp = (y * y) * (x * x) else: tmp = (y * y) * (-y * y) return tmp
function code(x, y) tmp = 0.0 if ((x <= -3.6e+179) || !(x <= 1.45e+167)) tmp = Float64(Float64(y * y) * Float64(x * x)); else tmp = Float64(Float64(y * y) * Float64(Float64(-y) * y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((x <= -3.6e+179) || ~((x <= 1.45e+167))) tmp = (y * y) * (x * x); else tmp = (y * y) * (-y * y); end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[x, -3.6e+179], N[Not[LessEqual[x, 1.45e+167]], $MachinePrecision]], N[(N[(y * y), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision], N[(N[(y * y), $MachinePrecision] * N[((-y) * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.6 \cdot 10^{+179} \lor \neg \left(x \leq 1.45 \cdot 10^{+167}\right):\\
\;\;\;\;\left(y \cdot y\right) \cdot \left(x \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot y\right) \cdot \left(\left(-y\right) \cdot y\right)\\
\end{array}
\end{array}
if x < -3.5999999999999998e179 or 1.44999999999999987e167 < x Initial program 63.1%
lift--.f64N/A
lift-pow.f64N/A
sqr-powN/A
lift-pow.f64N/A
sqr-powN/A
difference-of-squaresN/A
lower-*.f64N/A
+-commutativeN/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 inf
distribute-lft-inN/A
distribute-lft1-inN/A
metadata-evalN/A
mul0-lftN/A
distribute-lft-inN/A
metadata-evalN/A
*-rgt-identityN/A
unpow2N/A
lower-*.f6492.3
Applied rewrites92.3%
Taylor expanded in x around 0
unpow2N/A
lower-*.f6466.2
Applied rewrites66.2%
if -3.5999999999999998e179 < x < 1.44999999999999987e167Initial program 90.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
+-commutativeN/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.7
Applied rewrites99.7%
Taylor expanded in x around inf
distribute-lft-inN/A
distribute-lft1-inN/A
metadata-evalN/A
mul0-lftN/A
distribute-lft-inN/A
metadata-evalN/A
*-rgt-identityN/A
unpow2N/A
lower-*.f6444.7
Applied rewrites44.7%
Taylor expanded in x around 0
unpow2N/A
lower-*.f6426.4
Applied rewrites26.4%
Taylor expanded in x around 0
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6477.6
Applied rewrites77.6%
Final simplification74.7%
(FPCore (x y) :precision binary64 (* (* y y) (* (+ x y) (- x y))))
double code(double x, double y) {
return (y * y) * ((x + y) * (x - y));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (y * y) * ((x + y) * (x - y))
end function
public static double code(double x, double y) {
return (y * y) * ((x + y) * (x - y));
}
def code(x, y): return (y * y) * ((x + y) * (x - y))
function code(x, y) return Float64(Float64(y * y) * Float64(Float64(x + y) * Float64(x - y))) end
function tmp = code(x, y) tmp = (y * y) * ((x + y) * (x - y)); end
code[x_, y_] := N[(N[(y * y), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(y \cdot y\right) \cdot \left(\left(x + y\right) \cdot \left(x - y\right)\right)
\end{array}
Initial program 83.2%
lift--.f64N/A
lift-pow.f64N/A
sqr-powN/A
lift-pow.f64N/A
sqr-powN/A
difference-of-squaresN/A
lower-*.f64N/A
+-commutativeN/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%
Taylor expanded in x around 0
unpow2N/A
lower-*.f6479.3
Applied rewrites79.3%
(FPCore (x y) :precision binary64 (* (* y y) (* x x)))
double code(double x, double y) {
return (y * y) * (x * x);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (y * y) * (x * x)
end function
public static double code(double x, double y) {
return (y * y) * (x * x);
}
def code(x, y): return (y * y) * (x * x)
function code(x, y) return Float64(Float64(y * y) * Float64(x * x)) end
function tmp = code(x, y) tmp = (y * y) * (x * x); end
code[x_, y_] := N[(N[(y * y), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(y \cdot y\right) \cdot \left(x \cdot x\right)
\end{array}
Initial program 83.2%
lift--.f64N/A
lift-pow.f64N/A
sqr-powN/A
lift-pow.f64N/A
sqr-powN/A
difference-of-squaresN/A
lower-*.f64N/A
+-commutativeN/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%
Taylor expanded in x around inf
distribute-lft-inN/A
distribute-lft1-inN/A
metadata-evalN/A
mul0-lftN/A
distribute-lft-inN/A
metadata-evalN/A
*-rgt-identityN/A
unpow2N/A
lower-*.f6456.8
Applied rewrites56.8%
Taylor expanded in x around 0
unpow2N/A
lower-*.f6436.5
Applied rewrites36.5%
(FPCore (x y) :precision binary64 (* (* y y) (* y y)))
double code(double x, double y) {
return (y * y) * (y * y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (y * y) * (y * y)
end function
public static double code(double x, double y) {
return (y * y) * (y * y);
}
def code(x, y): return (y * y) * (y * y)
function code(x, y) return Float64(Float64(y * y) * Float64(y * y)) end
function tmp = code(x, y) tmp = (y * y) * (y * y); end
code[x_, y_] := N[(N[(y * y), $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(y \cdot y\right) \cdot \left(y \cdot y\right)
\end{array}
Initial program 83.2%
Taylor expanded in x around 0
mul-1-negN/A
lower-neg.f64N/A
lower-pow.f6460.2
Applied rewrites60.2%
Applied rewrites25.7%
herbie shell --seed 2024321
(FPCore (x y)
:name "Radioactive exchange between two surfaces"
:precision binary64
(- (pow x 4.0) (pow y 4.0)))