
(FPCore (x y) :precision binary64 (* x (exp (* y y))))
double code(double x, double y) {
return x * exp((y * y));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x * exp((y * y))
end function
public static double code(double x, double y) {
return x * Math.exp((y * y));
}
def code(x, y): return x * math.exp((y * y))
function code(x, y) return Float64(x * exp(Float64(y * y))) end
function tmp = code(x, y) tmp = x * exp((y * y)); end
code[x_, y_] := N[(x * N[Exp[N[(y * y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{y \cdot y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (* x (exp (* y y))))
double code(double x, double y) {
return x * exp((y * y));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x * exp((y * y))
end function
public static double code(double x, double y) {
return x * Math.exp((y * y));
}
def code(x, y): return x * math.exp((y * y))
function code(x, y) return Float64(x * exp(Float64(y * y))) end
function tmp = code(x, y) tmp = x * exp((y * y)); end
code[x_, y_] := N[(x * N[Exp[N[(y * y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{y \cdot y}
\end{array}
y_m = (fabs.f64 y) (FPCore (x y_m) :precision binary64 (* (pow (exp (* 0.5 y_m)) (* 2.0 y_m)) x))
y_m = fabs(y);
double code(double x, double y_m) {
return pow(exp((0.5 * y_m)), (2.0 * y_m)) * x;
}
y_m = abs(y)
real(8) function code(x, y_m)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
code = (exp((0.5d0 * y_m)) ** (2.0d0 * y_m)) * x
end function
y_m = Math.abs(y);
public static double code(double x, double y_m) {
return Math.pow(Math.exp((0.5 * y_m)), (2.0 * y_m)) * x;
}
y_m = math.fabs(y) def code(x, y_m): return math.pow(math.exp((0.5 * y_m)), (2.0 * y_m)) * x
y_m = abs(y) function code(x, y_m) return Float64((exp(Float64(0.5 * y_m)) ^ Float64(2.0 * y_m)) * x) end
y_m = abs(y); function tmp = code(x, y_m) tmp = (exp((0.5 * y_m)) ^ (2.0 * y_m)) * x; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_] := N[(N[Power[N[Exp[N[(0.5 * y$95$m), $MachinePrecision]], $MachinePrecision], N[(2.0 * y$95$m), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
{\left(e^{0.5 \cdot y\_m}\right)}^{\left(2 \cdot y\_m\right)} \cdot x
\end{array}
Initial program 100.0%
Taylor expanded in y around inf
unpow2N/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64100.0
Applied rewrites100.0%
Applied rewrites100.0%
Applied rewrites100.0%
Final simplification100.0%
y_m = (fabs.f64 y) (FPCore (x y_m) :precision binary64 (* (pow (exp y_m) y_m) x))
y_m = fabs(y);
double code(double x, double y_m) {
return pow(exp(y_m), y_m) * x;
}
y_m = abs(y)
real(8) function code(x, y_m)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
code = (exp(y_m) ** y_m) * x
end function
y_m = Math.abs(y);
public static double code(double x, double y_m) {
return Math.pow(Math.exp(y_m), y_m) * x;
}
y_m = math.fabs(y) def code(x, y_m): return math.pow(math.exp(y_m), y_m) * x
y_m = abs(y) function code(x, y_m) return Float64((exp(y_m) ^ y_m) * x) end
y_m = abs(y); function tmp = code(x, y_m) tmp = (exp(y_m) ^ y_m) * x; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_] := N[(N[Power[N[Exp[y$95$m], $MachinePrecision], y$95$m], $MachinePrecision] * x), $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
{\left(e^{y\_m}\right)}^{y\_m} \cdot x
\end{array}
Initial program 100.0%
Taylor expanded in y around inf
unpow2N/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64100.0
Applied rewrites100.0%
Final simplification100.0%
y_m = (fabs.f64 y) (FPCore (x y_m) :precision binary64 (* (exp (* y_m y_m)) x))
y_m = fabs(y);
double code(double x, double y_m) {
return exp((y_m * y_m)) * x;
}
y_m = abs(y)
real(8) function code(x, y_m)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
code = exp((y_m * y_m)) * x
end function
y_m = Math.abs(y);
public static double code(double x, double y_m) {
return Math.exp((y_m * y_m)) * x;
}
y_m = math.fabs(y) def code(x, y_m): return math.exp((y_m * y_m)) * x
y_m = abs(y) function code(x, y_m) return Float64(exp(Float64(y_m * y_m)) * x) end
y_m = abs(y); function tmp = code(x, y_m) tmp = exp((y_m * y_m)) * x; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_] := N[(N[Exp[N[(y$95$m * y$95$m), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
e^{y\_m \cdot y\_m} \cdot x
\end{array}
Initial program 100.0%
Final simplification100.0%
y_m = (fabs.f64 y) (FPCore (x y_m) :precision binary64 (* (pow (- y_m -1.0) y_m) x))
y_m = fabs(y);
double code(double x, double y_m) {
return pow((y_m - -1.0), y_m) * x;
}
y_m = abs(y)
real(8) function code(x, y_m)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
code = ((y_m - (-1.0d0)) ** y_m) * x
end function
y_m = Math.abs(y);
public static double code(double x, double y_m) {
return Math.pow((y_m - -1.0), y_m) * x;
}
y_m = math.fabs(y) def code(x, y_m): return math.pow((y_m - -1.0), y_m) * x
y_m = abs(y) function code(x, y_m) return Float64((Float64(y_m - -1.0) ^ y_m) * x) end
y_m = abs(y); function tmp = code(x, y_m) tmp = ((y_m - -1.0) ^ y_m) * x; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_] := N[(N[Power[N[(y$95$m - -1.0), $MachinePrecision], y$95$m], $MachinePrecision] * x), $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
{\left(y\_m - -1\right)}^{y\_m} \cdot x
\end{array}
Initial program 100.0%
Taylor expanded in y around inf
unpow2N/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64100.0
Applied rewrites100.0%
Taylor expanded in y around 0
Applied rewrites75.3%
Final simplification75.3%
y_m = (fabs.f64 y) (FPCore (x y_m) :precision binary64 (* (exp y_m) x))
y_m = fabs(y);
double code(double x, double y_m) {
return exp(y_m) * x;
}
y_m = abs(y)
real(8) function code(x, y_m)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
code = exp(y_m) * x
end function
y_m = Math.abs(y);
public static double code(double x, double y_m) {
return Math.exp(y_m) * x;
}
y_m = math.fabs(y) def code(x, y_m): return math.exp(y_m) * x
y_m = abs(y) function code(x, y_m) return Float64(exp(y_m) * x) end
y_m = abs(y); function tmp = code(x, y_m) tmp = exp(y_m) * x; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_] := N[(N[Exp[y$95$m], $MachinePrecision] * x), $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
e^{y\_m} \cdot x
\end{array}
Initial program 100.0%
lift-*.f64N/A
*-rgt-identityN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
distribute-lft-outN/A
div-invN/A
div-invN/A
flip-+N/A
+-inversesN/A
+-inversesN/A
associate-*r/N/A
*-rgt-identityN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
distribute-lft-outN/A
div-invN/A
div-invN/A
+-inversesN/A
difference-of-squaresN/A
+-inversesN/A
flip-+N/A
count-2N/A
Applied rewrites74.4%
Final simplification74.4%
y_m = (fabs.f64 y) (FPCore (x y_m) :precision binary64 (if (<= (* y_m y_m) 0.1) (fma (* y_m x) y_m x) (* (fma (fma 0.16666666666666666 y_m 0.5) (* y_m y_m) y_m) x)))
y_m = fabs(y);
double code(double x, double y_m) {
double tmp;
if ((y_m * y_m) <= 0.1) {
tmp = fma((y_m * x), y_m, x);
} else {
tmp = fma(fma(0.16666666666666666, y_m, 0.5), (y_m * y_m), y_m) * x;
}
return tmp;
}
y_m = abs(y) function code(x, y_m) tmp = 0.0 if (Float64(y_m * y_m) <= 0.1) tmp = fma(Float64(y_m * x), y_m, x); else tmp = Float64(fma(fma(0.16666666666666666, y_m, 0.5), Float64(y_m * y_m), y_m) * x); end return tmp end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_] := If[LessEqual[N[(y$95$m * y$95$m), $MachinePrecision], 0.1], N[(N[(y$95$m * x), $MachinePrecision] * y$95$m + x), $MachinePrecision], N[(N[(N[(0.16666666666666666 * y$95$m + 0.5), $MachinePrecision] * N[(y$95$m * y$95$m), $MachinePrecision] + y$95$m), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;y\_m \cdot y\_m \leq 0.1:\\
\;\;\;\;\mathsf{fma}\left(y\_m \cdot x, y\_m, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666, y\_m, 0.5\right), y\_m \cdot y\_m, y\_m\right) \cdot x\\
\end{array}
\end{array}
if (*.f64 y y) < 0.10000000000000001Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6499.4
Applied rewrites99.4%
Applied rewrites99.4%
if 0.10000000000000001 < (*.f64 y y) Initial program 99.9%
lift-*.f64N/A
*-rgt-identityN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
distribute-lft-outN/A
div-invN/A
div-invN/A
flip-+N/A
+-inversesN/A
+-inversesN/A
associate-*r/N/A
*-rgt-identityN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
distribute-lft-outN/A
div-invN/A
div-invN/A
+-inversesN/A
difference-of-squaresN/A
+-inversesN/A
flip-+N/A
count-2N/A
Applied rewrites47.6%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6438.0
Applied rewrites38.0%
Taylor expanded in y around inf
Applied rewrites38.0%
Final simplification70.6%
y_m = (fabs.f64 y) (FPCore (x y_m) :precision binary64 (if (<= (* y_m y_m) 0.1) (fma (* y_m x) y_m x) (* (* (fma 0.16666666666666666 y_m 0.5) (* y_m y_m)) x)))
y_m = fabs(y);
double code(double x, double y_m) {
double tmp;
if ((y_m * y_m) <= 0.1) {
tmp = fma((y_m * x), y_m, x);
} else {
tmp = (fma(0.16666666666666666, y_m, 0.5) * (y_m * y_m)) * x;
}
return tmp;
}
y_m = abs(y) function code(x, y_m) tmp = 0.0 if (Float64(y_m * y_m) <= 0.1) tmp = fma(Float64(y_m * x), y_m, x); else tmp = Float64(Float64(fma(0.16666666666666666, y_m, 0.5) * Float64(y_m * y_m)) * x); end return tmp end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_] := If[LessEqual[N[(y$95$m * y$95$m), $MachinePrecision], 0.1], N[(N[(y$95$m * x), $MachinePrecision] * y$95$m + x), $MachinePrecision], N[(N[(N[(0.16666666666666666 * y$95$m + 0.5), $MachinePrecision] * N[(y$95$m * y$95$m), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;y\_m \cdot y\_m \leq 0.1:\\
\;\;\;\;\mathsf{fma}\left(y\_m \cdot x, y\_m, x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(0.16666666666666666, y\_m, 0.5\right) \cdot \left(y\_m \cdot y\_m\right)\right) \cdot x\\
\end{array}
\end{array}
if (*.f64 y y) < 0.10000000000000001Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6499.4
Applied rewrites99.4%
Applied rewrites99.4%
if 0.10000000000000001 < (*.f64 y y) Initial program 99.9%
lift-*.f64N/A
*-rgt-identityN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
distribute-lft-outN/A
div-invN/A
div-invN/A
flip-+N/A
+-inversesN/A
+-inversesN/A
associate-*r/N/A
*-rgt-identityN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
distribute-lft-outN/A
div-invN/A
div-invN/A
+-inversesN/A
difference-of-squaresN/A
+-inversesN/A
flip-+N/A
count-2N/A
Applied rewrites47.6%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6438.0
Applied rewrites38.0%
Taylor expanded in y around inf
Applied rewrites38.0%
Final simplification70.6%
y_m = (fabs.f64 y) (FPCore (x y_m) :precision binary64 (if (<= (* y_m y_m) 4e+206) (fma (* y_m x) y_m x) (* (* y_m y_m) x)))
y_m = fabs(y);
double code(double x, double y_m) {
double tmp;
if ((y_m * y_m) <= 4e+206) {
tmp = fma((y_m * x), y_m, x);
} else {
tmp = (y_m * y_m) * x;
}
return tmp;
}
y_m = abs(y) function code(x, y_m) tmp = 0.0 if (Float64(y_m * y_m) <= 4e+206) tmp = fma(Float64(y_m * x), y_m, x); else tmp = Float64(Float64(y_m * y_m) * x); end return tmp end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_] := If[LessEqual[N[(y$95$m * y$95$m), $MachinePrecision], 4e+206], N[(N[(y$95$m * x), $MachinePrecision] * y$95$m + x), $MachinePrecision], N[(N[(y$95$m * y$95$m), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;y\_m \cdot y\_m \leq 4 \cdot 10^{+206}:\\
\;\;\;\;\mathsf{fma}\left(y\_m \cdot x, y\_m, x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y\_m \cdot y\_m\right) \cdot x\\
\end{array}
\end{array}
if (*.f64 y y) < 4.0000000000000002e206Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6478.2
Applied rewrites78.2%
Applied rewrites78.2%
if 4.0000000000000002e206 < (*.f64 y y) Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6487.6
Applied rewrites87.6%
Taylor expanded in y around inf
Applied rewrites87.6%
y_m = (fabs.f64 y) (FPCore (x y_m) :precision binary64 (* (fma (fma (* 0.16666666666666666 y_m) y_m 1.0) y_m 1.0) x))
y_m = fabs(y);
double code(double x, double y_m) {
return fma(fma((0.16666666666666666 * y_m), y_m, 1.0), y_m, 1.0) * x;
}
y_m = abs(y) function code(x, y_m) return Float64(fma(fma(Float64(0.16666666666666666 * y_m), y_m, 1.0), y_m, 1.0) * x) end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_] := N[(N[(N[(N[(0.16666666666666666 * y$95$m), $MachinePrecision] * y$95$m + 1.0), $MachinePrecision] * y$95$m + 1.0), $MachinePrecision] * x), $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666 \cdot y\_m, y\_m, 1\right), y\_m, 1\right) \cdot x
\end{array}
Initial program 100.0%
lift-*.f64N/A
*-rgt-identityN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
distribute-lft-outN/A
div-invN/A
div-invN/A
flip-+N/A
+-inversesN/A
+-inversesN/A
associate-*r/N/A
*-rgt-identityN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
distribute-lft-outN/A
div-invN/A
div-invN/A
+-inversesN/A
difference-of-squaresN/A
+-inversesN/A
flip-+N/A
count-2N/A
Applied rewrites74.4%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6469.9
Applied rewrites69.9%
Taylor expanded in y around inf
Applied rewrites69.9%
Final simplification69.9%
y_m = (fabs.f64 y) (FPCore (x y_m) :precision binary64 (if (<= (* y_m y_m) 0.1) (* 1.0 x) (* (* y_m y_m) x)))
y_m = fabs(y);
double code(double x, double y_m) {
double tmp;
if ((y_m * y_m) <= 0.1) {
tmp = 1.0 * x;
} else {
tmp = (y_m * y_m) * x;
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8) :: tmp
if ((y_m * y_m) <= 0.1d0) then
tmp = 1.0d0 * x
else
tmp = (y_m * y_m) * x
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m) {
double tmp;
if ((y_m * y_m) <= 0.1) {
tmp = 1.0 * x;
} else {
tmp = (y_m * y_m) * x;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m): tmp = 0 if (y_m * y_m) <= 0.1: tmp = 1.0 * x else: tmp = (y_m * y_m) * x return tmp
y_m = abs(y) function code(x, y_m) tmp = 0.0 if (Float64(y_m * y_m) <= 0.1) tmp = Float64(1.0 * x); else tmp = Float64(Float64(y_m * y_m) * x); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m) tmp = 0.0; if ((y_m * y_m) <= 0.1) tmp = 1.0 * x; else tmp = (y_m * y_m) * x; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_] := If[LessEqual[N[(y$95$m * y$95$m), $MachinePrecision], 0.1], N[(1.0 * x), $MachinePrecision], N[(N[(y$95$m * y$95$m), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;y\_m \cdot y\_m \leq 0.1:\\
\;\;\;\;1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;\left(y\_m \cdot y\_m\right) \cdot x\\
\end{array}
\end{array}
if (*.f64 y y) < 0.10000000000000001Initial program 100.0%
Taylor expanded in y around 0
Applied rewrites99.1%
if 0.10000000000000001 < (*.f64 y y) Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6460.2
Applied rewrites60.2%
Taylor expanded in y around inf
Applied rewrites60.2%
Final simplification80.8%
y_m = (fabs.f64 y) (FPCore (x y_m) :precision binary64 (if (<= (* y_m y_m) 0.1) (* 1.0 x) (* (* y_m x) y_m)))
y_m = fabs(y);
double code(double x, double y_m) {
double tmp;
if ((y_m * y_m) <= 0.1) {
tmp = 1.0 * x;
} else {
tmp = (y_m * x) * y_m;
}
return tmp;
}
y_m = abs(y)
real(8) function code(x, y_m)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8) :: tmp
if ((y_m * y_m) <= 0.1d0) then
tmp = 1.0d0 * x
else
tmp = (y_m * x) * y_m
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m) {
double tmp;
if ((y_m * y_m) <= 0.1) {
tmp = 1.0 * x;
} else {
tmp = (y_m * x) * y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m): tmp = 0 if (y_m * y_m) <= 0.1: tmp = 1.0 * x else: tmp = (y_m * x) * y_m return tmp
y_m = abs(y) function code(x, y_m) tmp = 0.0 if (Float64(y_m * y_m) <= 0.1) tmp = Float64(1.0 * x); else tmp = Float64(Float64(y_m * x) * y_m); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m) tmp = 0.0; if ((y_m * y_m) <= 0.1) tmp = 1.0 * x; else tmp = (y_m * x) * y_m; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_] := If[LessEqual[N[(y$95$m * y$95$m), $MachinePrecision], 0.1], N[(1.0 * x), $MachinePrecision], N[(N[(y$95$m * x), $MachinePrecision] * y$95$m), $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;y\_m \cdot y\_m \leq 0.1:\\
\;\;\;\;1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;\left(y\_m \cdot x\right) \cdot y\_m\\
\end{array}
\end{array}
if (*.f64 y y) < 0.10000000000000001Initial program 100.0%
Taylor expanded in y around 0
Applied rewrites99.1%
if 0.10000000000000001 < (*.f64 y y) Initial program 99.9%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6460.2
Applied rewrites60.2%
Taylor expanded in y around inf
Applied rewrites60.2%
Applied rewrites48.5%
Final simplification75.4%
y_m = (fabs.f64 y) (FPCore (x y_m) :precision binary64 (fma (* y_m y_m) x x))
y_m = fabs(y);
double code(double x, double y_m) {
return fma((y_m * y_m), x, x);
}
y_m = abs(y) function code(x, y_m) return fma(Float64(y_m * y_m), x, x) end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_] := N[(N[(y$95$m * y$95$m), $MachinePrecision] * x + x), $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
\mathsf{fma}\left(y\_m \cdot y\_m, x, x\right)
\end{array}
Initial program 100.0%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6481.0
Applied rewrites81.0%
y_m = (fabs.f64 y) (FPCore (x y_m) :precision binary64 (fma y_m x x))
y_m = fabs(y);
double code(double x, double y_m) {
return fma(y_m, x, x);
}
y_m = abs(y) function code(x, y_m) return fma(y_m, x, x) end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_] := N[(y$95$m * x + x), $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
\mathsf{fma}\left(y\_m, x, x\right)
\end{array}
Initial program 100.0%
lift-*.f64N/A
*-rgt-identityN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
distribute-lft-outN/A
div-invN/A
div-invN/A
flip-+N/A
+-inversesN/A
+-inversesN/A
associate-*r/N/A
*-rgt-identityN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
distribute-lft-outN/A
div-invN/A
div-invN/A
+-inversesN/A
difference-of-squaresN/A
+-inversesN/A
flip-+N/A
count-2N/A
Applied rewrites74.4%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f6459.1
Applied rewrites59.1%
y_m = (fabs.f64 y) (FPCore (x y_m) :precision binary64 (* 1.0 x))
y_m = fabs(y);
double code(double x, double y_m) {
return 1.0 * x;
}
y_m = abs(y)
real(8) function code(x, y_m)
real(8), intent (in) :: x
real(8), intent (in) :: y_m
code = 1.0d0 * x
end function
y_m = Math.abs(y);
public static double code(double x, double y_m) {
return 1.0 * x;
}
y_m = math.fabs(y) def code(x, y_m): return 1.0 * x
y_m = abs(y) function code(x, y_m) return Float64(1.0 * x) end
y_m = abs(y); function tmp = code(x, y_m) tmp = 1.0 * x; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_] := N[(1.0 * x), $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
1 \cdot x
\end{array}
Initial program 100.0%
Taylor expanded in y around 0
Applied rewrites54.4%
Final simplification54.4%
(FPCore (x y) :precision binary64 (* x (pow (exp y) y)))
double code(double x, double y) {
return x * pow(exp(y), y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x * (exp(y) ** y)
end function
public static double code(double x, double y) {
return x * Math.pow(Math.exp(y), y);
}
def code(x, y): return x * math.pow(math.exp(y), y)
function code(x, y) return Float64(x * (exp(y) ^ y)) end
function tmp = code(x, y) tmp = x * (exp(y) ^ y); end
code[x_, y_] := N[(x * N[Power[N[Exp[y], $MachinePrecision], y], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot {\left(e^{y}\right)}^{y}
\end{array}
herbie shell --seed 2024331
(FPCore (x y)
:name "Data.Number.Erf:$dmerfcx from erf-2.0.0.0"
:precision binary64
:alt
(! :herbie-platform default (* x (pow (exp y) y)))
(* x (exp (* y y))))