
(FPCore (x) :precision binary64 (- (/ 1.0 (+ x 1.0)) (/ 1.0 (- x 1.0))))
double code(double x) {
return (1.0 / (x + 1.0)) - (1.0 / (x - 1.0));
}
real(8) function code(x)
real(8), intent (in) :: x
code = (1.0d0 / (x + 1.0d0)) - (1.0d0 / (x - 1.0d0))
end function
public static double code(double x) {
return (1.0 / (x + 1.0)) - (1.0 / (x - 1.0));
}
def code(x): return (1.0 / (x + 1.0)) - (1.0 / (x - 1.0))
function code(x) return Float64(Float64(1.0 / Float64(x + 1.0)) - Float64(1.0 / Float64(x - 1.0))) end
function tmp = code(x) tmp = (1.0 / (x + 1.0)) - (1.0 / (x - 1.0)); end
code[x_] := N[(N[(1.0 / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] - N[(1.0 / N[(x - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{x + 1} - \frac{1}{x - 1}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x) :precision binary64 (- (/ 1.0 (+ x 1.0)) (/ 1.0 (- x 1.0))))
double code(double x) {
return (1.0 / (x + 1.0)) - (1.0 / (x - 1.0));
}
real(8) function code(x)
real(8), intent (in) :: x
code = (1.0d0 / (x + 1.0d0)) - (1.0d0 / (x - 1.0d0))
end function
public static double code(double x) {
return (1.0 / (x + 1.0)) - (1.0 / (x - 1.0));
}
def code(x): return (1.0 / (x + 1.0)) - (1.0 / (x - 1.0))
function code(x) return Float64(Float64(1.0 / Float64(x + 1.0)) - Float64(1.0 / Float64(x - 1.0))) end
function tmp = code(x) tmp = (1.0 / (x + 1.0)) - (1.0 / (x - 1.0)); end
code[x_] := N[(N[(1.0 / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] - N[(1.0 / N[(x - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{x + 1} - \frac{1}{x - 1}
\end{array}
(FPCore (x) :precision binary64 (/ (/ 2.0 (+ x 1.0)) (- 1.0 x)))
double code(double x) {
return (2.0 / (x + 1.0)) / (1.0 - x);
}
real(8) function code(x)
real(8), intent (in) :: x
code = (2.0d0 / (x + 1.0d0)) / (1.0d0 - x)
end function
public static double code(double x) {
return (2.0 / (x + 1.0)) / (1.0 - x);
}
def code(x): return (2.0 / (x + 1.0)) / (1.0 - x)
function code(x) return Float64(Float64(2.0 / Float64(x + 1.0)) / Float64(1.0 - x)) end
function tmp = code(x) tmp = (2.0 / (x + 1.0)) / (1.0 - x); end
code[x_] := N[(N[(2.0 / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(1.0 - x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{2}{x + 1}}{1 - x}
\end{array}
Initial program 78.4%
sub-neg78.4%
+-commutative78.4%
distribute-neg-frac78.4%
metadata-eval78.4%
metadata-eval78.4%
metadata-eval78.4%
associate-/r*78.4%
metadata-eval78.4%
neg-mul-178.4%
sub0-neg78.4%
associate-+l-78.4%
neg-sub078.4%
remove-double-neg78.4%
distribute-neg-in78.4%
sub-neg78.4%
mul-1-neg78.4%
metadata-eval78.4%
associate-/r*78.4%
metadata-eval78.4%
metadata-eval78.4%
metadata-eval78.4%
metadata-eval78.4%
associate-*l/78.4%
Simplified78.4%
frac-sub79.4%
*-rgt-identity79.4%
metadata-eval79.4%
div-inv79.4%
associate-/r*79.4%
*-un-lft-identity79.4%
metadata-eval79.4%
div-inv79.4%
associate--l-82.2%
div-inv82.2%
metadata-eval82.2%
*-rgt-identity82.2%
div-inv82.2%
metadata-eval82.2%
*-rgt-identity82.2%
Applied egg-rr82.2%
frac-2neg82.2%
div-inv82.2%
distribute-neg-frac82.2%
associate--r+79.4%
associate--r-79.3%
neg-mul-179.3%
sub-neg79.3%
distribute-rgt-in79.3%
metadata-eval79.3%
cancel-sign-sub-inv79.3%
*-commutative79.3%
neg-mul-179.3%
Applied egg-rr79.3%
associate-*l/79.3%
sub-neg79.3%
remove-double-neg79.3%
associate-*r/79.3%
associate--l-79.3%
+-commutative79.3%
associate-+l-82.2%
associate--l+99.9%
+-inverses99.9%
metadata-eval99.9%
metadata-eval99.9%
metadata-eval99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x) :precision binary64 (if (<= x 0.75) 2.0 (/ 2.0 (* x (- 1.0 x)))))
double code(double x) {
double tmp;
if (x <= 0.75) {
tmp = 2.0;
} else {
tmp = 2.0 / (x * (1.0 - x));
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if (x <= 0.75d0) then
tmp = 2.0d0
else
tmp = 2.0d0 / (x * (1.0d0 - x))
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (x <= 0.75) {
tmp = 2.0;
} else {
tmp = 2.0 / (x * (1.0 - x));
}
return tmp;
}
def code(x): tmp = 0 if x <= 0.75: tmp = 2.0 else: tmp = 2.0 / (x * (1.0 - x)) return tmp
function code(x) tmp = 0.0 if (x <= 0.75) tmp = 2.0; else tmp = Float64(2.0 / Float64(x * Float64(1.0 - x))); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (x <= 0.75) tmp = 2.0; else tmp = 2.0 / (x * (1.0 - x)); end tmp_2 = tmp; end
code[x_] := If[LessEqual[x, 0.75], 2.0, N[(2.0 / N[(x * N[(1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.75:\\
\;\;\;\;2\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{x \cdot \left(1 - x\right)}\\
\end{array}
\end{array}
if x < 0.75Initial program 87.0%
sub-neg87.0%
+-commutative87.0%
distribute-neg-frac87.0%
metadata-eval87.0%
metadata-eval87.0%
metadata-eval87.0%
associate-/r*87.0%
metadata-eval87.0%
neg-mul-187.0%
sub0-neg87.0%
associate-+l-87.0%
neg-sub087.0%
remove-double-neg87.0%
distribute-neg-in87.0%
sub-neg87.0%
mul-1-neg87.0%
metadata-eval87.0%
associate-/r*87.0%
metadata-eval87.0%
metadata-eval87.0%
metadata-eval87.0%
metadata-eval87.0%
associate-*l/87.0%
Simplified87.0%
Taylor expanded in x around 0 65.2%
if 0.75 < x Initial program 50.9%
sub-neg50.9%
+-commutative50.9%
distribute-neg-frac50.9%
metadata-eval50.9%
metadata-eval50.9%
metadata-eval50.9%
associate-/r*50.9%
metadata-eval50.9%
neg-mul-150.9%
sub0-neg50.9%
associate-+l-50.9%
neg-sub050.9%
remove-double-neg50.9%
distribute-neg-in50.9%
sub-neg50.9%
mul-1-neg50.9%
metadata-eval50.9%
associate-/r*50.9%
metadata-eval50.9%
metadata-eval50.9%
metadata-eval50.9%
metadata-eval50.9%
associate-*l/50.9%
Simplified50.9%
frac-sub52.1%
*-rgt-identity52.1%
metadata-eval52.1%
div-inv52.1%
associate-/r*52.2%
*-un-lft-identity52.2%
metadata-eval52.2%
div-inv52.2%
associate--l-58.7%
div-inv58.7%
metadata-eval58.7%
*-rgt-identity58.7%
div-inv58.7%
metadata-eval58.7%
*-rgt-identity58.7%
Applied egg-rr58.7%
frac-2neg58.7%
div-inv58.7%
distribute-neg-frac58.7%
associate--r+52.2%
associate--r-52.1%
neg-mul-152.1%
sub-neg52.1%
distribute-rgt-in52.1%
metadata-eval52.1%
cancel-sign-sub-inv52.1%
*-commutative52.1%
neg-mul-152.1%
Applied egg-rr52.1%
associate-*l/52.1%
sub-neg52.1%
remove-double-neg52.1%
associate-*r/52.1%
associate--l-52.1%
+-commutative52.1%
associate-+l-58.7%
associate--l+99.8%
+-inverses99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in x around inf 97.1%
expm1-log1p-u97.1%
expm1-udef48.3%
associate-/l/48.3%
*-commutative48.3%
Applied egg-rr48.3%
expm1-def97.2%
expm1-log1p97.2%
Simplified97.2%
Final simplification72.9%
(FPCore (x) :precision binary64 (if (<= x 1.0) 2.0 (/ (/ 2.0 x) (- -1.0 x))))
double code(double x) {
double tmp;
if (x <= 1.0) {
tmp = 2.0;
} else {
tmp = (2.0 / x) / (-1.0 - x);
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if (x <= 1.0d0) then
tmp = 2.0d0
else
tmp = (2.0d0 / x) / ((-1.0d0) - x)
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (x <= 1.0) {
tmp = 2.0;
} else {
tmp = (2.0 / x) / (-1.0 - x);
}
return tmp;
}
def code(x): tmp = 0 if x <= 1.0: tmp = 2.0 else: tmp = (2.0 / x) / (-1.0 - x) return tmp
function code(x) tmp = 0.0 if (x <= 1.0) tmp = 2.0; else tmp = Float64(Float64(2.0 / x) / Float64(-1.0 - x)); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (x <= 1.0) tmp = 2.0; else tmp = (2.0 / x) / (-1.0 - x); end tmp_2 = tmp; end
code[x_] := If[LessEqual[x, 1.0], 2.0, N[(N[(2.0 / x), $MachinePrecision] / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1:\\
\;\;\;\;2\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{x}}{-1 - x}\\
\end{array}
\end{array}
if x < 1Initial program 87.0%
sub-neg87.0%
+-commutative87.0%
distribute-neg-frac87.0%
metadata-eval87.0%
metadata-eval87.0%
metadata-eval87.0%
associate-/r*87.0%
metadata-eval87.0%
neg-mul-187.0%
sub0-neg87.0%
associate-+l-87.0%
neg-sub087.0%
remove-double-neg87.0%
distribute-neg-in87.0%
sub-neg87.0%
mul-1-neg87.0%
metadata-eval87.0%
associate-/r*87.0%
metadata-eval87.0%
metadata-eval87.0%
metadata-eval87.0%
metadata-eval87.0%
associate-*l/87.0%
Simplified87.0%
Taylor expanded in x around 0 65.2%
if 1 < x Initial program 50.9%
sub-neg50.9%
+-commutative50.9%
distribute-neg-frac50.9%
metadata-eval50.9%
metadata-eval50.9%
metadata-eval50.9%
associate-/r*50.9%
metadata-eval50.9%
neg-mul-150.9%
sub0-neg50.9%
associate-+l-50.9%
neg-sub050.9%
remove-double-neg50.9%
distribute-neg-in50.9%
sub-neg50.9%
mul-1-neg50.9%
metadata-eval50.9%
associate-/r*50.9%
metadata-eval50.9%
metadata-eval50.9%
metadata-eval50.9%
metadata-eval50.9%
associate-*l/50.9%
Simplified50.9%
frac-sub52.1%
*-rgt-identity52.1%
metadata-eval52.1%
div-inv52.1%
associate-/r*52.2%
*-un-lft-identity52.2%
metadata-eval52.2%
div-inv52.2%
associate--l-58.7%
div-inv58.7%
metadata-eval58.7%
*-rgt-identity58.7%
div-inv58.7%
metadata-eval58.7%
*-rgt-identity58.7%
Applied egg-rr58.7%
Taylor expanded in x around inf 97.1%
Final simplification72.8%
(FPCore (x) :precision binary64 (if (<= x 0.75) 2.0 (/ (/ 2.0 x) (- 1.0 x))))
double code(double x) {
double tmp;
if (x <= 0.75) {
tmp = 2.0;
} else {
tmp = (2.0 / x) / (1.0 - x);
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if (x <= 0.75d0) then
tmp = 2.0d0
else
tmp = (2.0d0 / x) / (1.0d0 - x)
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (x <= 0.75) {
tmp = 2.0;
} else {
tmp = (2.0 / x) / (1.0 - x);
}
return tmp;
}
def code(x): tmp = 0 if x <= 0.75: tmp = 2.0 else: tmp = (2.0 / x) / (1.0 - x) return tmp
function code(x) tmp = 0.0 if (x <= 0.75) tmp = 2.0; else tmp = Float64(Float64(2.0 / x) / Float64(1.0 - x)); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (x <= 0.75) tmp = 2.0; else tmp = (2.0 / x) / (1.0 - x); end tmp_2 = tmp; end
code[x_] := If[LessEqual[x, 0.75], 2.0, N[(N[(2.0 / x), $MachinePrecision] / N[(1.0 - x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.75:\\
\;\;\;\;2\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{2}{x}}{1 - x}\\
\end{array}
\end{array}
if x < 0.75Initial program 87.0%
sub-neg87.0%
+-commutative87.0%
distribute-neg-frac87.0%
metadata-eval87.0%
metadata-eval87.0%
metadata-eval87.0%
associate-/r*87.0%
metadata-eval87.0%
neg-mul-187.0%
sub0-neg87.0%
associate-+l-87.0%
neg-sub087.0%
remove-double-neg87.0%
distribute-neg-in87.0%
sub-neg87.0%
mul-1-neg87.0%
metadata-eval87.0%
associate-/r*87.0%
metadata-eval87.0%
metadata-eval87.0%
metadata-eval87.0%
metadata-eval87.0%
associate-*l/87.0%
Simplified87.0%
Taylor expanded in x around 0 65.2%
if 0.75 < x Initial program 50.9%
sub-neg50.9%
+-commutative50.9%
distribute-neg-frac50.9%
metadata-eval50.9%
metadata-eval50.9%
metadata-eval50.9%
associate-/r*50.9%
metadata-eval50.9%
neg-mul-150.9%
sub0-neg50.9%
associate-+l-50.9%
neg-sub050.9%
remove-double-neg50.9%
distribute-neg-in50.9%
sub-neg50.9%
mul-1-neg50.9%
metadata-eval50.9%
associate-/r*50.9%
metadata-eval50.9%
metadata-eval50.9%
metadata-eval50.9%
metadata-eval50.9%
associate-*l/50.9%
Simplified50.9%
frac-sub52.1%
*-rgt-identity52.1%
metadata-eval52.1%
div-inv52.1%
associate-/r*52.2%
*-un-lft-identity52.2%
metadata-eval52.2%
div-inv52.2%
associate--l-58.7%
div-inv58.7%
metadata-eval58.7%
*-rgt-identity58.7%
div-inv58.7%
metadata-eval58.7%
*-rgt-identity58.7%
Applied egg-rr58.7%
frac-2neg58.7%
div-inv58.7%
distribute-neg-frac58.7%
associate--r+52.2%
associate--r-52.1%
neg-mul-152.1%
sub-neg52.1%
distribute-rgt-in52.1%
metadata-eval52.1%
cancel-sign-sub-inv52.1%
*-commutative52.1%
neg-mul-152.1%
Applied egg-rr52.1%
associate-*l/52.1%
sub-neg52.1%
remove-double-neg52.1%
associate-*r/52.1%
associate--l-52.1%
+-commutative52.1%
associate-+l-58.7%
associate--l+99.8%
+-inverses99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in x around inf 97.1%
Final simplification72.8%
(FPCore (x) :precision binary64 (/ 2.0 (* (- -1.0 x) (+ x -1.0))))
double code(double x) {
return 2.0 / ((-1.0 - x) * (x + -1.0));
}
real(8) function code(x)
real(8), intent (in) :: x
code = 2.0d0 / (((-1.0d0) - x) * (x + (-1.0d0)))
end function
public static double code(double x) {
return 2.0 / ((-1.0 - x) * (x + -1.0));
}
def code(x): return 2.0 / ((-1.0 - x) * (x + -1.0))
function code(x) return Float64(2.0 / Float64(Float64(-1.0 - x) * Float64(x + -1.0))) end
function tmp = code(x) tmp = 2.0 / ((-1.0 - x) * (x + -1.0)); end
code[x_] := N[(2.0 / N[(N[(-1.0 - x), $MachinePrecision] * N[(x + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{2}{\left(-1 - x\right) \cdot \left(x + -1\right)}
\end{array}
Initial program 78.4%
sub-neg78.4%
+-commutative78.4%
distribute-neg-frac78.4%
metadata-eval78.4%
metadata-eval78.4%
metadata-eval78.4%
associate-/r*78.4%
metadata-eval78.4%
neg-mul-178.4%
sub0-neg78.4%
associate-+l-78.4%
neg-sub078.4%
remove-double-neg78.4%
distribute-neg-in78.4%
sub-neg78.4%
mul-1-neg78.4%
metadata-eval78.4%
associate-/r*78.4%
metadata-eval78.4%
metadata-eval78.4%
metadata-eval78.4%
metadata-eval78.4%
associate-*l/78.4%
Simplified78.4%
sub-neg78.4%
distribute-neg-frac78.4%
metadata-eval78.4%
Applied egg-rr78.4%
*-rgt-identity78.4%
cancel-sign-sub78.4%
distribute-neg-frac78.4%
metadata-eval78.4%
*-rgt-identity78.4%
*-inverses78.4%
associate-/r*53.8%
distribute-lft-neg-in53.8%
distribute-rgt-neg-in53.8%
*-commutative53.8%
*-lft-identity53.8%
*-inverses53.8%
times-frac78.5%
div-sub79.4%
Simplified99.9%
Final simplification99.9%
(FPCore (x) :precision binary64 (if (<= x 1.0) 2.0 (/ -2.0 x)))
double code(double x) {
double tmp;
if (x <= 1.0) {
tmp = 2.0;
} else {
tmp = -2.0 / x;
}
return tmp;
}
real(8) function code(x)
real(8), intent (in) :: x
real(8) :: tmp
if (x <= 1.0d0) then
tmp = 2.0d0
else
tmp = (-2.0d0) / x
end if
code = tmp
end function
public static double code(double x) {
double tmp;
if (x <= 1.0) {
tmp = 2.0;
} else {
tmp = -2.0 / x;
}
return tmp;
}
def code(x): tmp = 0 if x <= 1.0: tmp = 2.0 else: tmp = -2.0 / x return tmp
function code(x) tmp = 0.0 if (x <= 1.0) tmp = 2.0; else tmp = Float64(-2.0 / x); end return tmp end
function tmp_2 = code(x) tmp = 0.0; if (x <= 1.0) tmp = 2.0; else tmp = -2.0 / x; end tmp_2 = tmp; end
code[x_] := If[LessEqual[x, 1.0], 2.0, N[(-2.0 / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1:\\
\;\;\;\;2\\
\mathbf{else}:\\
\;\;\;\;\frac{-2}{x}\\
\end{array}
\end{array}
if x < 1Initial program 87.0%
sub-neg87.0%
+-commutative87.0%
distribute-neg-frac87.0%
metadata-eval87.0%
metadata-eval87.0%
metadata-eval87.0%
associate-/r*87.0%
metadata-eval87.0%
neg-mul-187.0%
sub0-neg87.0%
associate-+l-87.0%
neg-sub087.0%
remove-double-neg87.0%
distribute-neg-in87.0%
sub-neg87.0%
mul-1-neg87.0%
metadata-eval87.0%
associate-/r*87.0%
metadata-eval87.0%
metadata-eval87.0%
metadata-eval87.0%
metadata-eval87.0%
associate-*l/87.0%
Simplified87.0%
Taylor expanded in x around 0 65.2%
if 1 < x Initial program 50.9%
sub-neg50.9%
+-commutative50.9%
distribute-neg-frac50.9%
metadata-eval50.9%
metadata-eval50.9%
metadata-eval50.9%
associate-/r*50.9%
metadata-eval50.9%
neg-mul-150.9%
sub0-neg50.9%
associate-+l-50.9%
neg-sub050.9%
remove-double-neg50.9%
distribute-neg-in50.9%
sub-neg50.9%
mul-1-neg50.9%
metadata-eval50.9%
associate-/r*50.9%
metadata-eval50.9%
metadata-eval50.9%
metadata-eval50.9%
metadata-eval50.9%
associate-*l/50.9%
Simplified50.9%
frac-sub52.1%
*-rgt-identity52.1%
metadata-eval52.1%
div-inv52.1%
associate-/r*52.2%
*-un-lft-identity52.2%
metadata-eval52.2%
div-inv52.2%
associate--l-58.7%
div-inv58.7%
metadata-eval58.7%
*-rgt-identity58.7%
div-inv58.7%
metadata-eval58.7%
*-rgt-identity58.7%
Applied egg-rr58.7%
Taylor expanded in x around inf 97.1%
Taylor expanded in x around 0 7.1%
Final simplification51.4%
(FPCore (x) :precision binary64 (/ -2.0 (- -1.0 x)))
double code(double x) {
return -2.0 / (-1.0 - x);
}
real(8) function code(x)
real(8), intent (in) :: x
code = (-2.0d0) / ((-1.0d0) - x)
end function
public static double code(double x) {
return -2.0 / (-1.0 - x);
}
def code(x): return -2.0 / (-1.0 - x)
function code(x) return Float64(-2.0 / Float64(-1.0 - x)) end
function tmp = code(x) tmp = -2.0 / (-1.0 - x); end
code[x_] := N[(-2.0 / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{-2}{-1 - x}
\end{array}
Initial program 78.4%
sub-neg78.4%
+-commutative78.4%
distribute-neg-frac78.4%
metadata-eval78.4%
metadata-eval78.4%
metadata-eval78.4%
associate-/r*78.4%
metadata-eval78.4%
neg-mul-178.4%
sub0-neg78.4%
associate-+l-78.4%
neg-sub078.4%
remove-double-neg78.4%
distribute-neg-in78.4%
sub-neg78.4%
mul-1-neg78.4%
metadata-eval78.4%
associate-/r*78.4%
metadata-eval78.4%
metadata-eval78.4%
metadata-eval78.4%
metadata-eval78.4%
associate-*l/78.4%
Simplified78.4%
frac-sub79.4%
*-rgt-identity79.4%
metadata-eval79.4%
div-inv79.4%
associate-/r*79.4%
*-un-lft-identity79.4%
metadata-eval79.4%
div-inv79.4%
associate--l-82.2%
div-inv82.2%
metadata-eval82.2%
*-rgt-identity82.2%
div-inv82.2%
metadata-eval82.2%
*-rgt-identity82.2%
Applied egg-rr82.2%
Taylor expanded in x around 0 51.5%
Final simplification51.5%
(FPCore (x) :precision binary64 1.0)
double code(double x) {
return 1.0;
}
real(8) function code(x)
real(8), intent (in) :: x
code = 1.0d0
end function
public static double code(double x) {
return 1.0;
}
def code(x): return 1.0
function code(x) return 1.0 end
function tmp = code(x) tmp = 1.0; end
code[x_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 78.4%
sub-neg78.4%
+-commutative78.4%
distribute-neg-frac78.4%
metadata-eval78.4%
metadata-eval78.4%
metadata-eval78.4%
associate-/r*78.4%
metadata-eval78.4%
neg-mul-178.4%
sub0-neg78.4%
associate-+l-78.4%
neg-sub078.4%
remove-double-neg78.4%
distribute-neg-in78.4%
sub-neg78.4%
mul-1-neg78.4%
metadata-eval78.4%
associate-/r*78.4%
metadata-eval78.4%
metadata-eval78.4%
metadata-eval78.4%
metadata-eval78.4%
associate-*l/78.4%
Simplified78.4%
Taylor expanded in x around 0 49.9%
Taylor expanded in x around inf 10.6%
Final simplification10.6%
(FPCore (x) :precision binary64 2.0)
double code(double x) {
return 2.0;
}
real(8) function code(x)
real(8), intent (in) :: x
code = 2.0d0
end function
public static double code(double x) {
return 2.0;
}
def code(x): return 2.0
function code(x) return 2.0 end
function tmp = code(x) tmp = 2.0; end
code[x_] := 2.0
\begin{array}{l}
\\
2
\end{array}
Initial program 78.4%
sub-neg78.4%
+-commutative78.4%
distribute-neg-frac78.4%
metadata-eval78.4%
metadata-eval78.4%
metadata-eval78.4%
associate-/r*78.4%
metadata-eval78.4%
neg-mul-178.4%
sub0-neg78.4%
associate-+l-78.4%
neg-sub078.4%
remove-double-neg78.4%
distribute-neg-in78.4%
sub-neg78.4%
mul-1-neg78.4%
metadata-eval78.4%
associate-/r*78.4%
metadata-eval78.4%
metadata-eval78.4%
metadata-eval78.4%
metadata-eval78.4%
associate-*l/78.4%
Simplified78.4%
Taylor expanded in x around 0 50.3%
Final simplification50.3%
herbie shell --seed 2024010
(FPCore (x)
:name "Asymptote A"
:precision binary64
(- (/ 1.0 (+ x 1.0)) (/ 1.0 (- x 1.0))))