
(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 19 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}
(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}
Initial program 99.6%
(FPCore (x y)
:precision binary64
(if (<= (* y y) 1.0)
(*
x
(+
1.0
(*
(* y y)
(+ 1.0 (* y (/ 1.0 (/ (+ 2.0 (* (* y y) -0.6666666666666666)) y)))))))
(* x (exp y))))
double code(double x, double y) {
double tmp;
if ((y * y) <= 1.0) {
tmp = x * (1.0 + ((y * y) * (1.0 + (y * (1.0 / ((2.0 + ((y * y) * -0.6666666666666666)) / y))))));
} else {
tmp = x * exp(y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((y * y) <= 1.0d0) then
tmp = x * (1.0d0 + ((y * y) * (1.0d0 + (y * (1.0d0 / ((2.0d0 + ((y * y) * (-0.6666666666666666d0))) / y))))))
else
tmp = x * exp(y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y * y) <= 1.0) {
tmp = x * (1.0 + ((y * y) * (1.0 + (y * (1.0 / ((2.0 + ((y * y) * -0.6666666666666666)) / y))))));
} else {
tmp = x * Math.exp(y);
}
return tmp;
}
def code(x, y): tmp = 0 if (y * y) <= 1.0: tmp = x * (1.0 + ((y * y) * (1.0 + (y * (1.0 / ((2.0 + ((y * y) * -0.6666666666666666)) / y)))))) else: tmp = x * math.exp(y) return tmp
function code(x, y) tmp = 0.0 if (Float64(y * y) <= 1.0) tmp = Float64(x * Float64(1.0 + Float64(Float64(y * y) * Float64(1.0 + Float64(y * Float64(1.0 / Float64(Float64(2.0 + Float64(Float64(y * y) * -0.6666666666666666)) / y))))))); else tmp = Float64(x * exp(y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y * y) <= 1.0) tmp = x * (1.0 + ((y * y) * (1.0 + (y * (1.0 / ((2.0 + ((y * y) * -0.6666666666666666)) / y)))))); else tmp = x * exp(y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[N[(y * y), $MachinePrecision], 1.0], N[(x * N[(1.0 + N[(N[(y * y), $MachinePrecision] * N[(1.0 + N[(y * N[(1.0 / N[(N[(2.0 + N[(N[(y * y), $MachinePrecision] * -0.6666666666666666), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \cdot y \leq 1:\\
\;\;\;\;x \cdot \left(1 + \left(y \cdot y\right) \cdot \left(1 + y \cdot \frac{1}{\frac{2 + \left(y \cdot y\right) \cdot -0.6666666666666666}{y}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{y}\\
\end{array}
\end{array}
if (*.f64 y y) < 1Initial program 99.9%
Taylor expanded in y around 0
Simplified97.8%
*-commutativeN/A
flip-+N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
metadata-evalN/A
swap-sqrN/A
*-lowering-*.f64N/A
associate-*l*N/A
cube-unmultN/A
*-lowering-*.f64N/A
cube-unmultN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
Applied egg-rr97.8%
clear-numN/A
/-lowering-/.f64N/A
clear-numN/A
/-lowering-/.f64N/A
div-invN/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
associate-*r*N/A
metadata-evalN/A
swap-sqrN/A
associate-*r*N/A
associate-*r*N/A
Applied egg-rr97.8%
Taylor expanded in y around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6497.9%
Simplified97.9%
if 1 < (*.f64 y y) Initial program 99.3%
*-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 egg-rr45.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* y (* y (+ 0.5 (* y (* y 0.16666666666666666))))))
(t_1 (* (* y y) (- -1.0 t_0))))
(if (<= (* y y) 2e+102)
(/ (* x (+ 1.0 (* y (* (* y (+ 1.0 t_0)) t_1)))) (+ 1.0 t_1))
(* x (+ 1.0 (* y (* (* y y) (* y (* (* y y) 0.16666666666666666)))))))))
double code(double x, double y) {
double t_0 = y * (y * (0.5 + (y * (y * 0.16666666666666666))));
double t_1 = (y * y) * (-1.0 - t_0);
double tmp;
if ((y * y) <= 2e+102) {
tmp = (x * (1.0 + (y * ((y * (1.0 + t_0)) * t_1)))) / (1.0 + t_1);
} else {
tmp = x * (1.0 + (y * ((y * y) * (y * ((y * y) * 0.16666666666666666)))));
}
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 = y * (y * (0.5d0 + (y * (y * 0.16666666666666666d0))))
t_1 = (y * y) * ((-1.0d0) - t_0)
if ((y * y) <= 2d+102) then
tmp = (x * (1.0d0 + (y * ((y * (1.0d0 + t_0)) * t_1)))) / (1.0d0 + t_1)
else
tmp = x * (1.0d0 + (y * ((y * y) * (y * ((y * y) * 0.16666666666666666d0)))))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y * (y * (0.5 + (y * (y * 0.16666666666666666))));
double t_1 = (y * y) * (-1.0 - t_0);
double tmp;
if ((y * y) <= 2e+102) {
tmp = (x * (1.0 + (y * ((y * (1.0 + t_0)) * t_1)))) / (1.0 + t_1);
} else {
tmp = x * (1.0 + (y * ((y * y) * (y * ((y * y) * 0.16666666666666666)))));
}
return tmp;
}
def code(x, y): t_0 = y * (y * (0.5 + (y * (y * 0.16666666666666666)))) t_1 = (y * y) * (-1.0 - t_0) tmp = 0 if (y * y) <= 2e+102: tmp = (x * (1.0 + (y * ((y * (1.0 + t_0)) * t_1)))) / (1.0 + t_1) else: tmp = x * (1.0 + (y * ((y * y) * (y * ((y * y) * 0.16666666666666666))))) return tmp
function code(x, y) t_0 = Float64(y * Float64(y * Float64(0.5 + Float64(y * Float64(y * 0.16666666666666666))))) t_1 = Float64(Float64(y * y) * Float64(-1.0 - t_0)) tmp = 0.0 if (Float64(y * y) <= 2e+102) tmp = Float64(Float64(x * Float64(1.0 + Float64(y * Float64(Float64(y * Float64(1.0 + t_0)) * t_1)))) / Float64(1.0 + t_1)); else tmp = Float64(x * Float64(1.0 + Float64(y * Float64(Float64(y * y) * Float64(y * Float64(Float64(y * y) * 0.16666666666666666)))))); end return tmp end
function tmp_2 = code(x, y) t_0 = y * (y * (0.5 + (y * (y * 0.16666666666666666)))); t_1 = (y * y) * (-1.0 - t_0); tmp = 0.0; if ((y * y) <= 2e+102) tmp = (x * (1.0 + (y * ((y * (1.0 + t_0)) * t_1)))) / (1.0 + t_1); else tmp = x * (1.0 + (y * ((y * y) * (y * ((y * y) * 0.16666666666666666))))); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y * N[(y * N[(0.5 + N[(y * N[(y * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(y * y), $MachinePrecision] * N[(-1.0 - t$95$0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(y * y), $MachinePrecision], 2e+102], N[(N[(x * N[(1.0 + N[(y * N[(N[(y * N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 + N[(y * N[(N[(y * y), $MachinePrecision] * N[(y * N[(N[(y * y), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := y \cdot \left(y \cdot \left(0.5 + y \cdot \left(y \cdot 0.16666666666666666\right)\right)\right)\\
t_1 := \left(y \cdot y\right) \cdot \left(-1 - t\_0\right)\\
\mathbf{if}\;y \cdot y \leq 2 \cdot 10^{+102}:\\
\;\;\;\;\frac{x \cdot \left(1 + y \cdot \left(\left(y \cdot \left(1 + t\_0\right)\right) \cdot t\_1\right)\right)}{1 + t\_1}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 + y \cdot \left(\left(y \cdot y\right) \cdot \left(y \cdot \left(\left(y \cdot y\right) \cdot 0.16666666666666666\right)\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 y y) < 1.99999999999999995e102Initial program 99.3%
Taylor expanded in y around 0
Simplified84.1%
Taylor expanded in x around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6484.1%
Simplified84.1%
Applied egg-rr91.1%
if 1.99999999999999995e102 < (*.f64 y y) Initial program 100.0%
Taylor expanded in y around 0
Simplified100.0%
Taylor expanded in x around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in y around inf
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
unpow3N/A
*-lowering-*.f64N/A
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in y around inf
metadata-evalN/A
pow-plusN/A
associate-*l*N/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
associate-*r*N/A
unpow2N/A
unpow3N/A
*-commutativeN/A
unpow3N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Final simplification94.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (* y y) 0.16666666666666666))
(t_1 (+ 1.0 (* y (* y (+ 0.5 t_0)))))
(t_2 (* (* y y) t_1)))
(if (<= (* y y) 2e+102)
(* x (/ (+ (* (* y y) (* t_1 t_2)) -1.0) (+ t_2 -1.0)))
(* x (+ 1.0 (* y (* (* y y) (* y t_0))))))))
double code(double x, double y) {
double t_0 = (y * y) * 0.16666666666666666;
double t_1 = 1.0 + (y * (y * (0.5 + t_0)));
double t_2 = (y * y) * t_1;
double tmp;
if ((y * y) <= 2e+102) {
tmp = x * ((((y * y) * (t_1 * t_2)) + -1.0) / (t_2 + -1.0));
} else {
tmp = x * (1.0 + (y * ((y * y) * (y * 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = (y * y) * 0.16666666666666666d0
t_1 = 1.0d0 + (y * (y * (0.5d0 + t_0)))
t_2 = (y * y) * t_1
if ((y * y) <= 2d+102) then
tmp = x * ((((y * y) * (t_1 * t_2)) + (-1.0d0)) / (t_2 + (-1.0d0)))
else
tmp = x * (1.0d0 + (y * ((y * y) * (y * t_0))))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = (y * y) * 0.16666666666666666;
double t_1 = 1.0 + (y * (y * (0.5 + t_0)));
double t_2 = (y * y) * t_1;
double tmp;
if ((y * y) <= 2e+102) {
tmp = x * ((((y * y) * (t_1 * t_2)) + -1.0) / (t_2 + -1.0));
} else {
tmp = x * (1.0 + (y * ((y * y) * (y * t_0))));
}
return tmp;
}
def code(x, y): t_0 = (y * y) * 0.16666666666666666 t_1 = 1.0 + (y * (y * (0.5 + t_0))) t_2 = (y * y) * t_1 tmp = 0 if (y * y) <= 2e+102: tmp = x * ((((y * y) * (t_1 * t_2)) + -1.0) / (t_2 + -1.0)) else: tmp = x * (1.0 + (y * ((y * y) * (y * t_0)))) return tmp
function code(x, y) t_0 = Float64(Float64(y * y) * 0.16666666666666666) t_1 = Float64(1.0 + Float64(y * Float64(y * Float64(0.5 + t_0)))) t_2 = Float64(Float64(y * y) * t_1) tmp = 0.0 if (Float64(y * y) <= 2e+102) tmp = Float64(x * Float64(Float64(Float64(Float64(y * y) * Float64(t_1 * t_2)) + -1.0) / Float64(t_2 + -1.0))); else tmp = Float64(x * Float64(1.0 + Float64(y * Float64(Float64(y * y) * Float64(y * t_0))))); end return tmp end
function tmp_2 = code(x, y) t_0 = (y * y) * 0.16666666666666666; t_1 = 1.0 + (y * (y * (0.5 + t_0))); t_2 = (y * y) * t_1; tmp = 0.0; if ((y * y) <= 2e+102) tmp = x * ((((y * y) * (t_1 * t_2)) + -1.0) / (t_2 + -1.0)); else tmp = x * (1.0 + (y * ((y * y) * (y * t_0)))); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(y * y), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 + N[(y * N[(y * N[(0.5 + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * y), $MachinePrecision] * t$95$1), $MachinePrecision]}, If[LessEqual[N[(y * y), $MachinePrecision], 2e+102], N[(x * N[(N[(N[(N[(y * y), $MachinePrecision] * N[(t$95$1 * t$95$2), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision] / N[(t$95$2 + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 + N[(y * N[(N[(y * y), $MachinePrecision] * N[(y * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(y \cdot y\right) \cdot 0.16666666666666666\\
t_1 := 1 + y \cdot \left(y \cdot \left(0.5 + t\_0\right)\right)\\
t_2 := \left(y \cdot y\right) \cdot t\_1\\
\mathbf{if}\;y \cdot y \leq 2 \cdot 10^{+102}:\\
\;\;\;\;x \cdot \frac{\left(y \cdot y\right) \cdot \left(t\_1 \cdot t\_2\right) + -1}{t\_2 + -1}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 + y \cdot \left(\left(y \cdot y\right) \cdot \left(y \cdot t\_0\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 y y) < 1.99999999999999995e102Initial program 99.3%
Taylor expanded in y around 0
Simplified84.1%
+-commutativeN/A
flip-+N/A
/-lowering-/.f64N/A
Applied egg-rr89.9%
if 1.99999999999999995e102 < (*.f64 y y) Initial program 100.0%
Taylor expanded in y around 0
Simplified100.0%
Taylor expanded in x around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in y around inf
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
unpow3N/A
*-lowering-*.f64N/A
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in y around inf
metadata-evalN/A
pow-plusN/A
associate-*l*N/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
associate-*r*N/A
unpow2N/A
unpow3N/A
*-commutativeN/A
unpow3N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Final simplification94.1%
(FPCore (x y)
:precision binary64
(if (<= (* y y) 2e+139)
(*
x
(+
1.0
(/
(*
(* y y)
(+
1.0
(*
(* (* y y) (* y y))
(+
-0.25
(*
(* y y)
(+ -0.16666666666666666 (* (* y y) -0.027777777777777776)))))))
(- 1.0 (* y (* y (+ 0.5 (* (* y y) 0.16666666666666666))))))))
(* x (* y (* 0.5 (* y (* y y)))))))
double code(double x, double y) {
double tmp;
if ((y * y) <= 2e+139) {
tmp = x * (1.0 + (((y * y) * (1.0 + (((y * y) * (y * y)) * (-0.25 + ((y * y) * (-0.16666666666666666 + ((y * y) * -0.027777777777777776))))))) / (1.0 - (y * (y * (0.5 + ((y * y) * 0.16666666666666666)))))));
} else {
tmp = x * (y * (0.5 * (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 ((y * y) <= 2d+139) then
tmp = x * (1.0d0 + (((y * y) * (1.0d0 + (((y * y) * (y * y)) * ((-0.25d0) + ((y * y) * ((-0.16666666666666666d0) + ((y * y) * (-0.027777777777777776d0)))))))) / (1.0d0 - (y * (y * (0.5d0 + ((y * y) * 0.16666666666666666d0)))))))
else
tmp = x * (y * (0.5d0 * (y * (y * y))))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y * y) <= 2e+139) {
tmp = x * (1.0 + (((y * y) * (1.0 + (((y * y) * (y * y)) * (-0.25 + ((y * y) * (-0.16666666666666666 + ((y * y) * -0.027777777777777776))))))) / (1.0 - (y * (y * (0.5 + ((y * y) * 0.16666666666666666)))))));
} else {
tmp = x * (y * (0.5 * (y * (y * y))));
}
return tmp;
}
def code(x, y): tmp = 0 if (y * y) <= 2e+139: tmp = x * (1.0 + (((y * y) * (1.0 + (((y * y) * (y * y)) * (-0.25 + ((y * y) * (-0.16666666666666666 + ((y * y) * -0.027777777777777776))))))) / (1.0 - (y * (y * (0.5 + ((y * y) * 0.16666666666666666))))))) else: tmp = x * (y * (0.5 * (y * (y * y)))) return tmp
function code(x, y) tmp = 0.0 if (Float64(y * y) <= 2e+139) tmp = Float64(x * Float64(1.0 + Float64(Float64(Float64(y * y) * Float64(1.0 + Float64(Float64(Float64(y * y) * Float64(y * y)) * Float64(-0.25 + Float64(Float64(y * y) * Float64(-0.16666666666666666 + Float64(Float64(y * y) * -0.027777777777777776))))))) / Float64(1.0 - Float64(y * Float64(y * Float64(0.5 + Float64(Float64(y * y) * 0.16666666666666666)))))))); else tmp = Float64(x * Float64(y * Float64(0.5 * Float64(y * Float64(y * y))))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y * y) <= 2e+139) tmp = x * (1.0 + (((y * y) * (1.0 + (((y * y) * (y * y)) * (-0.25 + ((y * y) * (-0.16666666666666666 + ((y * y) * -0.027777777777777776))))))) / (1.0 - (y * (y * (0.5 + ((y * y) * 0.16666666666666666))))))); else tmp = x * (y * (0.5 * (y * (y * y)))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[N[(y * y), $MachinePrecision], 2e+139], N[(x * N[(1.0 + N[(N[(N[(y * y), $MachinePrecision] * N[(1.0 + N[(N[(N[(y * y), $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision] * N[(-0.25 + N[(N[(y * y), $MachinePrecision] * N[(-0.16666666666666666 + N[(N[(y * y), $MachinePrecision] * -0.027777777777777776), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 - N[(y * N[(y * N[(0.5 + N[(N[(y * y), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(y * N[(0.5 * N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \cdot y \leq 2 \cdot 10^{+139}:\\
\;\;\;\;x \cdot \left(1 + \frac{\left(y \cdot y\right) \cdot \left(1 + \left(\left(y \cdot y\right) \cdot \left(y \cdot y\right)\right) \cdot \left(-0.25 + \left(y \cdot y\right) \cdot \left(-0.16666666666666666 + \left(y \cdot y\right) \cdot -0.027777777777777776\right)\right)\right)}{1 - y \cdot \left(y \cdot \left(0.5 + \left(y \cdot y\right) \cdot 0.16666666666666666\right)\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot \left(0.5 \cdot \left(y \cdot \left(y \cdot y\right)\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 y y) < 2.00000000000000007e139Initial program 99.4%
Taylor expanded in y around 0
Simplified85.1%
*-commutativeN/A
flip-+N/A
associate-*l/N/A
/-lowering-/.f64N/A
Applied egg-rr90.5%
Taylor expanded in y around 0
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
pow-sqrN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
Simplified90.5%
if 2.00000000000000007e139 < (*.f64 y y) Initial program 100.0%
Taylor expanded in y around 0
*-rgt-identityN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
associate-*l*N/A
distribute-lft-outN/A
*-rgt-identityN/A
distribute-lft-inN/A
distribute-lft-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in y around inf
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
unpow3N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (* y y) (* y y))))
(if (<= (* y y) 2e+139)
(*
x
(+
1.0
(*
y
(/
(* y (- 1.0 (* t_0 (* t_0 0.027777777777777776))))
(- 1.0 (* (* y y) (* (* y y) 0.16666666666666666)))))))
(* x (* y (* 0.5 (* y (* y y))))))))
double code(double x, double y) {
double t_0 = (y * y) * (y * y);
double tmp;
if ((y * y) <= 2e+139) {
tmp = x * (1.0 + (y * ((y * (1.0 - (t_0 * (t_0 * 0.027777777777777776)))) / (1.0 - ((y * y) * ((y * y) * 0.16666666666666666))))));
} else {
tmp = x * (y * (0.5 * (y * (y * y))));
}
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 = (y * y) * (y * y)
if ((y * y) <= 2d+139) then
tmp = x * (1.0d0 + (y * ((y * (1.0d0 - (t_0 * (t_0 * 0.027777777777777776d0)))) / (1.0d0 - ((y * y) * ((y * y) * 0.16666666666666666d0))))))
else
tmp = x * (y * (0.5d0 * (y * (y * y))))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = (y * y) * (y * y);
double tmp;
if ((y * y) <= 2e+139) {
tmp = x * (1.0 + (y * ((y * (1.0 - (t_0 * (t_0 * 0.027777777777777776)))) / (1.0 - ((y * y) * ((y * y) * 0.16666666666666666))))));
} else {
tmp = x * (y * (0.5 * (y * (y * y))));
}
return tmp;
}
def code(x, y): t_0 = (y * y) * (y * y) tmp = 0 if (y * y) <= 2e+139: tmp = x * (1.0 + (y * ((y * (1.0 - (t_0 * (t_0 * 0.027777777777777776)))) / (1.0 - ((y * y) * ((y * y) * 0.16666666666666666)))))) else: tmp = x * (y * (0.5 * (y * (y * y)))) return tmp
function code(x, y) t_0 = Float64(Float64(y * y) * Float64(y * y)) tmp = 0.0 if (Float64(y * y) <= 2e+139) tmp = Float64(x * Float64(1.0 + Float64(y * Float64(Float64(y * Float64(1.0 - Float64(t_0 * Float64(t_0 * 0.027777777777777776)))) / Float64(1.0 - Float64(Float64(y * y) * Float64(Float64(y * y) * 0.16666666666666666))))))); else tmp = Float64(x * Float64(y * Float64(0.5 * Float64(y * Float64(y * y))))); end return tmp end
function tmp_2 = code(x, y) t_0 = (y * y) * (y * y); tmp = 0.0; if ((y * y) <= 2e+139) tmp = x * (1.0 + (y * ((y * (1.0 - (t_0 * (t_0 * 0.027777777777777776)))) / (1.0 - ((y * y) * ((y * y) * 0.16666666666666666)))))); else tmp = x * (y * (0.5 * (y * (y * y)))); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(y * y), $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(y * y), $MachinePrecision], 2e+139], N[(x * N[(1.0 + N[(y * N[(N[(y * N[(1.0 - N[(t$95$0 * N[(t$95$0 * 0.027777777777777776), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 - N[(N[(y * y), $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(y * N[(0.5 * N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(y \cdot y\right) \cdot \left(y \cdot y\right)\\
\mathbf{if}\;y \cdot y \leq 2 \cdot 10^{+139}:\\
\;\;\;\;x \cdot \left(1 + y \cdot \frac{y \cdot \left(1 - t\_0 \cdot \left(t\_0 \cdot 0.027777777777777776\right)\right)}{1 - \left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 0.16666666666666666\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot \left(0.5 \cdot \left(y \cdot \left(y \cdot y\right)\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 y y) < 2.00000000000000007e139Initial program 99.4%
Taylor expanded in y around 0
Simplified85.1%
Taylor expanded in x around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6485.1%
Simplified85.1%
Taylor expanded in y around inf
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
unpow3N/A
*-lowering-*.f64N/A
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6484.3%
Simplified84.3%
*-commutativeN/A
flip-+N/A
associate-*l/N/A
/-lowering-/.f64N/A
Applied egg-rr89.6%
if 2.00000000000000007e139 < (*.f64 y y) Initial program 100.0%
Taylor expanded in y around 0
*-rgt-identityN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
associate-*l*N/A
distribute-lft-outN/A
*-rgt-identityN/A
distribute-lft-inN/A
distribute-lft-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in y around inf
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
unpow3N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
Final simplification93.6%
(FPCore (x y) :precision binary64 (+ x (* x (* (* y y) (+ 1.0 (* y (* y (+ 0.5 (* y (* y 0.16666666666666666))))))))))
double code(double x, double y) {
return x + (x * ((y * y) * (1.0 + (y * (y * (0.5 + (y * (y * 0.16666666666666666))))))));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x + (x * ((y * y) * (1.0d0 + (y * (y * (0.5d0 + (y * (y * 0.16666666666666666d0))))))))
end function
public static double code(double x, double y) {
return x + (x * ((y * y) * (1.0 + (y * (y * (0.5 + (y * (y * 0.16666666666666666))))))));
}
def code(x, y): return x + (x * ((y * y) * (1.0 + (y * (y * (0.5 + (y * (y * 0.16666666666666666))))))))
function code(x, y) return Float64(x + Float64(x * Float64(Float64(y * y) * Float64(1.0 + Float64(y * Float64(y * Float64(0.5 + Float64(y * Float64(y * 0.16666666666666666))))))))) end
function tmp = code(x, y) tmp = x + (x * ((y * y) * (1.0 + (y * (y * (0.5 + (y * (y * 0.16666666666666666)))))))); end
code[x_, y_] := N[(x + N[(x * N[(N[(y * y), $MachinePrecision] * N[(1.0 + N[(y * N[(y * N[(0.5 + N[(y * N[(y * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + x \cdot \left(\left(y \cdot y\right) \cdot \left(1 + y \cdot \left(y \cdot \left(0.5 + y \cdot \left(y \cdot 0.16666666666666666\right)\right)\right)\right)\right)
\end{array}
Initial program 99.6%
Taylor expanded in y around 0
Simplified90.8%
Taylor expanded in x around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6490.8%
Simplified90.8%
Applied egg-rr90.8%
Final simplification90.8%
(FPCore (x y) :precision binary64 (* x (+ 1.0 (* y (* y (+ 1.0 (* (* y y) (+ 0.5 (* y (* y 0.16666666666666666))))))))))
double code(double x, double y) {
return x * (1.0 + (y * (y * (1.0 + ((y * y) * (0.5 + (y * (y * 0.16666666666666666))))))));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x * (1.0d0 + (y * (y * (1.0d0 + ((y * y) * (0.5d0 + (y * (y * 0.16666666666666666d0))))))))
end function
public static double code(double x, double y) {
return x * (1.0 + (y * (y * (1.0 + ((y * y) * (0.5 + (y * (y * 0.16666666666666666))))))));
}
def code(x, y): return x * (1.0 + (y * (y * (1.0 + ((y * y) * (0.5 + (y * (y * 0.16666666666666666))))))))
function code(x, y) return Float64(x * Float64(1.0 + Float64(y * Float64(y * Float64(1.0 + Float64(Float64(y * y) * Float64(0.5 + Float64(y * Float64(y * 0.16666666666666666))))))))) end
function tmp = code(x, y) tmp = x * (1.0 + (y * (y * (1.0 + ((y * y) * (0.5 + (y * (y * 0.16666666666666666)))))))); end
code[x_, y_] := N[(x * N[(1.0 + N[(y * N[(y * N[(1.0 + N[(N[(y * y), $MachinePrecision] * N[(0.5 + N[(y * N[(y * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(1 + y \cdot \left(y \cdot \left(1 + \left(y \cdot y\right) \cdot \left(0.5 + y \cdot \left(y \cdot 0.16666666666666666\right)\right)\right)\right)\right)
\end{array}
Initial program 99.6%
Taylor expanded in y around 0
Simplified90.8%
Taylor expanded in x around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6490.8%
Simplified90.8%
(FPCore (x y) :precision binary64 (* x (+ 1.0 (* y (* y (+ 1.0 (* y (* y (* y (* y 0.16666666666666666))))))))))
double code(double x, double y) {
return x * (1.0 + (y * (y * (1.0 + (y * (y * (y * (y * 0.16666666666666666))))))));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x * (1.0d0 + (y * (y * (1.0d0 + (y * (y * (y * (y * 0.16666666666666666d0))))))))
end function
public static double code(double x, double y) {
return x * (1.0 + (y * (y * (1.0 + (y * (y * (y * (y * 0.16666666666666666))))))));
}
def code(x, y): return x * (1.0 + (y * (y * (1.0 + (y * (y * (y * (y * 0.16666666666666666))))))))
function code(x, y) return Float64(x * Float64(1.0 + Float64(y * Float64(y * Float64(1.0 + Float64(y * Float64(y * Float64(y * Float64(y * 0.16666666666666666))))))))) end
function tmp = code(x, y) tmp = x * (1.0 + (y * (y * (1.0 + (y * (y * (y * (y * 0.16666666666666666)))))))); end
code[x_, y_] := N[(x * N[(1.0 + N[(y * N[(y * N[(1.0 + N[(y * N[(y * N[(y * N[(y * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(1 + y \cdot \left(y \cdot \left(1 + y \cdot \left(y \cdot \left(y \cdot \left(y \cdot 0.16666666666666666\right)\right)\right)\right)\right)\right)
\end{array}
Initial program 99.6%
Taylor expanded in y around 0
Simplified90.8%
Taylor expanded in x around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6490.8%
Simplified90.8%
Taylor expanded in y around inf
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
unpow3N/A
*-lowering-*.f64N/A
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6490.2%
Simplified90.2%
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6490.2%
Applied egg-rr90.2%
Final simplification90.2%
(FPCore (x y) :precision binary64 (if (<= (* y y) 1.0) (+ x (* x (* y y))) (* x (* y (* 0.5 (* y (* y y)))))))
double code(double x, double y) {
double tmp;
if ((y * y) <= 1.0) {
tmp = x + (x * (y * y));
} else {
tmp = x * (y * (0.5 * (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 ((y * y) <= 1.0d0) then
tmp = x + (x * (y * y))
else
tmp = x * (y * (0.5d0 * (y * (y * y))))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y * y) <= 1.0) {
tmp = x + (x * (y * y));
} else {
tmp = x * (y * (0.5 * (y * (y * y))));
}
return tmp;
}
def code(x, y): tmp = 0 if (y * y) <= 1.0: tmp = x + (x * (y * y)) else: tmp = x * (y * (0.5 * (y * (y * y)))) return tmp
function code(x, y) tmp = 0.0 if (Float64(y * y) <= 1.0) tmp = Float64(x + Float64(x * Float64(y * y))); else tmp = Float64(x * Float64(y * Float64(0.5 * Float64(y * Float64(y * y))))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y * y) <= 1.0) tmp = x + (x * (y * y)); else tmp = x * (y * (0.5 * (y * (y * y)))); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[N[(y * y), $MachinePrecision], 1.0], N[(x + N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(y * N[(0.5 * N[(y * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \cdot y \leq 1:\\
\;\;\;\;x + x \cdot \left(y \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot \left(0.5 \cdot \left(y \cdot \left(y \cdot y\right)\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 y y) < 1Initial program 99.9%
Taylor expanded in y around 0
*-rgt-identityN/A
distribute-lft-inN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6496.6%
Simplified96.6%
distribute-rgt-inN/A
*-lft-identityN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6496.6%
Applied egg-rr96.6%
if 1 < (*.f64 y y) Initial program 99.3%
Taylor expanded in y around 0
*-rgt-identityN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
associate-*l*N/A
distribute-lft-outN/A
*-rgt-identityN/A
distribute-lft-inN/A
distribute-lft-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6476.2%
Simplified76.2%
Taylor expanded in y around inf
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
unpow3N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6476.2%
Simplified76.2%
Final simplification85.7%
(FPCore (x y) :precision binary64 (* x (+ 1.0 (* y (* (* y y) (* y (* (* y y) 0.16666666666666666)))))))
double code(double x, double y) {
return x * (1.0 + (y * ((y * y) * (y * ((y * y) * 0.16666666666666666)))));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x * (1.0d0 + (y * ((y * y) * (y * ((y * y) * 0.16666666666666666d0)))))
end function
public static double code(double x, double y) {
return x * (1.0 + (y * ((y * y) * (y * ((y * y) * 0.16666666666666666)))));
}
def code(x, y): return x * (1.0 + (y * ((y * y) * (y * ((y * y) * 0.16666666666666666)))))
function code(x, y) return Float64(x * Float64(1.0 + Float64(y * Float64(Float64(y * y) * Float64(y * Float64(Float64(y * y) * 0.16666666666666666)))))) end
function tmp = code(x, y) tmp = x * (1.0 + (y * ((y * y) * (y * ((y * y) * 0.16666666666666666))))); end
code[x_, y_] := N[(x * N[(1.0 + N[(y * N[(N[(y * y), $MachinePrecision] * N[(y * N[(N[(y * y), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(1 + y \cdot \left(\left(y \cdot y\right) \cdot \left(y \cdot \left(\left(y \cdot y\right) \cdot 0.16666666666666666\right)\right)\right)\right)
\end{array}
Initial program 99.6%
Taylor expanded in y around 0
Simplified90.8%
Taylor expanded in x around 0
*-lowering-*.f64N/A
+-lowering-+.f64N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6490.8%
Simplified90.8%
Taylor expanded in y around inf
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
unpow2N/A
unpow3N/A
*-lowering-*.f64N/A
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6490.2%
Simplified90.2%
Taylor expanded in y around inf
metadata-evalN/A
pow-plusN/A
associate-*l*N/A
metadata-evalN/A
pow-sqrN/A
associate-*l*N/A
associate-*r*N/A
unpow2N/A
unpow3N/A
*-commutativeN/A
unpow3N/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6489.8%
Simplified89.8%
(FPCore (x y) :precision binary64 (if (<= (* y y) 1.0) (+ x (* x (* y y))) (* x (* y (* (* y y) 0.16666666666666666)))))
double code(double x, double y) {
double tmp;
if ((y * y) <= 1.0) {
tmp = x + (x * (y * y));
} else {
tmp = x * (y * ((y * y) * 0.16666666666666666));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((y * y) <= 1.0d0) then
tmp = x + (x * (y * y))
else
tmp = x * (y * ((y * y) * 0.16666666666666666d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y * y) <= 1.0) {
tmp = x + (x * (y * y));
} else {
tmp = x * (y * ((y * y) * 0.16666666666666666));
}
return tmp;
}
def code(x, y): tmp = 0 if (y * y) <= 1.0: tmp = x + (x * (y * y)) else: tmp = x * (y * ((y * y) * 0.16666666666666666)) return tmp
function code(x, y) tmp = 0.0 if (Float64(y * y) <= 1.0) tmp = Float64(x + Float64(x * Float64(y * y))); else tmp = Float64(x * Float64(y * Float64(Float64(y * y) * 0.16666666666666666))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y * y) <= 1.0) tmp = x + (x * (y * y)); else tmp = x * (y * ((y * y) * 0.16666666666666666)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[N[(y * y), $MachinePrecision], 1.0], N[(x + N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(y * N[(N[(y * y), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \cdot y \leq 1:\\
\;\;\;\;x + x \cdot \left(y \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot \left(\left(y \cdot y\right) \cdot 0.16666666666666666\right)\right)\\
\end{array}
\end{array}
if (*.f64 y y) < 1Initial program 99.9%
Taylor expanded in y around 0
*-rgt-identityN/A
distribute-lft-inN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6496.6%
Simplified96.6%
distribute-rgt-inN/A
*-lft-identityN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6496.6%
Applied egg-rr96.6%
if 1 < (*.f64 y y) Initial program 99.3%
*-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 egg-rr45.4%
Taylor expanded in y around 0
Simplified31.3%
Taylor expanded in y around inf
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
unpow3N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6431.3%
Simplified31.3%
Final simplification61.7%
(FPCore (x y) :precision binary64 (+ x (* x (* y (* y (+ 1.0 (* y (* y 0.5))))))))
double code(double x, double y) {
return x + (x * (y * (y * (1.0 + (y * (y * 0.5))))));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x + (x * (y * (y * (1.0d0 + (y * (y * 0.5d0))))))
end function
public static double code(double x, double y) {
return x + (x * (y * (y * (1.0 + (y * (y * 0.5))))));
}
def code(x, y): return x + (x * (y * (y * (1.0 + (y * (y * 0.5))))))
function code(x, y) return Float64(x + Float64(x * Float64(y * Float64(y * Float64(1.0 + Float64(y * Float64(y * 0.5))))))) end
function tmp = code(x, y) tmp = x + (x * (y * (y * (1.0 + (y * (y * 0.5)))))); end
code[x_, y_] := N[(x + N[(x * N[(y * N[(y * N[(1.0 + N[(y * N[(y * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + x \cdot \left(y \cdot \left(y \cdot \left(1 + y \cdot \left(y \cdot 0.5\right)\right)\right)\right)
\end{array}
Initial program 99.6%
Taylor expanded in y around 0
*-rgt-identityN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
associate-*l*N/A
distribute-lft-outN/A
*-rgt-identityN/A
distribute-lft-inN/A
distribute-lft-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6486.1%
Simplified86.1%
+-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6486.1%
Applied egg-rr86.1%
Final simplification86.1%
(FPCore (x y) :precision binary64 (* x (+ 1.0 (* (* y y) (+ 1.0 (* (* y y) 0.5))))))
double code(double x, double y) {
return x * (1.0 + ((y * y) * (1.0 + ((y * y) * 0.5))));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x * (1.0d0 + ((y * y) * (1.0d0 + ((y * y) * 0.5d0))))
end function
public static double code(double x, double y) {
return x * (1.0 + ((y * y) * (1.0 + ((y * y) * 0.5))));
}
def code(x, y): return x * (1.0 + ((y * y) * (1.0 + ((y * y) * 0.5))))
function code(x, y) return Float64(x * Float64(1.0 + Float64(Float64(y * y) * Float64(1.0 + Float64(Float64(y * y) * 0.5))))) end
function tmp = code(x, y) tmp = x * (1.0 + ((y * y) * (1.0 + ((y * y) * 0.5)))); end
code[x_, y_] := N[(x * N[(1.0 + N[(N[(y * y), $MachinePrecision] * N[(1.0 + N[(N[(y * y), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(1 + \left(y \cdot y\right) \cdot \left(1 + \left(y \cdot y\right) \cdot 0.5\right)\right)
\end{array}
Initial program 99.6%
Taylor expanded in y around 0
*-rgt-identityN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
associate-*l*N/A
distribute-lft-outN/A
*-rgt-identityN/A
distribute-lft-inN/A
distribute-lft-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6486.1%
Simplified86.1%
(FPCore (x y) :precision binary64 (* x (+ 1.0 (* (* y y) (* y (* y 0.5))))))
double code(double x, double y) {
return x * (1.0 + ((y * y) * (y * (y * 0.5))));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x * (1.0d0 + ((y * y) * (y * (y * 0.5d0))))
end function
public static double code(double x, double y) {
return x * (1.0 + ((y * y) * (y * (y * 0.5))));
}
def code(x, y): return x * (1.0 + ((y * y) * (y * (y * 0.5))))
function code(x, y) return Float64(x * Float64(1.0 + Float64(Float64(y * y) * Float64(y * Float64(y * 0.5))))) end
function tmp = code(x, y) tmp = x * (1.0 + ((y * y) * (y * (y * 0.5)))); end
code[x_, y_] := N[(x * N[(1.0 + N[(N[(y * y), $MachinePrecision] * N[(y * N[(y * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(1 + \left(y \cdot y\right) \cdot \left(y \cdot \left(y \cdot 0.5\right)\right)\right)
\end{array}
Initial program 99.6%
Taylor expanded in y around 0
*-rgt-identityN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
associate-*l*N/A
distribute-lft-outN/A
*-rgt-identityN/A
distribute-lft-inN/A
distribute-lft-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6486.1%
Simplified86.1%
Taylor expanded in y around inf
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6485.3%
Simplified85.3%
(FPCore (x y) :precision binary64 (if (<= (* y y) 1.0) x (* x (* y y))))
double code(double x, double y) {
double tmp;
if ((y * y) <= 1.0) {
tmp = x;
} else {
tmp = x * (y * y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((y * y) <= 1.0d0) then
tmp = x
else
tmp = x * (y * y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y * y) <= 1.0) {
tmp = x;
} else {
tmp = x * (y * y);
}
return tmp;
}
def code(x, y): tmp = 0 if (y * y) <= 1.0: tmp = x else: tmp = x * (y * y) return tmp
function code(x, y) tmp = 0.0 if (Float64(y * y) <= 1.0) tmp = x; else tmp = Float64(x * Float64(y * y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y * y) <= 1.0) tmp = x; else tmp = x * (y * y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[N[(y * y), $MachinePrecision], 1.0], x, N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \cdot y \leq 1:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot y\right)\\
\end{array}
\end{array}
if (*.f64 y y) < 1Initial program 99.9%
Taylor expanded in y around 0
Simplified95.7%
if 1 < (*.f64 y y) Initial program 99.3%
Taylor expanded in y around 0
*-rgt-identityN/A
distribute-lft-inN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6459.4%
Simplified59.4%
Taylor expanded in y around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6459.4%
Simplified59.4%
(FPCore (x y) :precision binary64 (+ x (* x (* y y))))
double code(double x, double y) {
return x + (x * (y * y));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x + (x * (y * y))
end function
public static double code(double x, double y) {
return x + (x * (y * y));
}
def code(x, y): return x + (x * (y * y))
function code(x, y) return Float64(x + Float64(x * Float64(y * y))) end
function tmp = code(x, y) tmp = x + (x * (y * y)); end
code[x_, y_] := N[(x + N[(x * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + x \cdot \left(y \cdot y\right)
\end{array}
Initial program 99.6%
Taylor expanded in y around 0
*-rgt-identityN/A
distribute-lft-inN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6476.7%
Simplified76.7%
distribute-rgt-inN/A
*-lft-identityN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6476.7%
Applied egg-rr76.7%
Final simplification76.7%
(FPCore (x y) :precision binary64 (* x (+ (* y y) 1.0)))
double code(double x, double y) {
return x * ((y * y) + 1.0);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x * ((y * y) + 1.0d0)
end function
public static double code(double x, double y) {
return x * ((y * y) + 1.0);
}
def code(x, y): return x * ((y * y) + 1.0)
function code(x, y) return Float64(x * Float64(Float64(y * y) + 1.0)) end
function tmp = code(x, y) tmp = x * ((y * y) + 1.0); end
code[x_, y_] := N[(x * N[(N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(y \cdot y + 1\right)
\end{array}
Initial program 99.6%
Taylor expanded in y around 0
*-rgt-identityN/A
distribute-lft-inN/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
unpow2N/A
*-lowering-*.f6476.7%
Simplified76.7%
(FPCore (x y) :precision binary64 x)
double code(double x, double y) {
return x;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = x
end function
public static double code(double x, double y) {
return x;
}
def code(x, y): return x
function code(x, y) return x end
function tmp = code(x, y) tmp = x; end
code[x_, y_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 99.6%
Taylor expanded in y around 0
Simplified46.5%
(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 2024155
(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))))