
(FPCore (x y) :precision binary64 (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))
double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0d0))
end function
public static double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
def code(x, y): return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0))
function code(x, y) return Float64(Float64(x * y) / Float64(Float64(Float64(x + y) * Float64(x + y)) * Float64(Float64(x + y) + 1.0))) end
function tmp = code(x, y) tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0)); end
code[x_, y_] := N[(N[(x * y), $MachinePrecision] / N[(N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))
double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0d0))
end function
public static double code(double x, double y) {
return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0));
}
def code(x, y): return (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0))
function code(x, y) return Float64(Float64(x * y) / Float64(Float64(Float64(x + y) * Float64(x + y)) * Float64(Float64(x + y) + 1.0))) end
function tmp = code(x, y) tmp = (x * y) / (((x + y) * (x + y)) * ((x + y) + 1.0)); end
code[x_, y_] := N[(N[(x * y), $MachinePrecision] / N[(N[(N[(x + y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] * N[(N[(x + y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y}{\left(\left(x + y\right) \cdot \left(x + y\right)\right) \cdot \left(\left(x + y\right) + 1\right)}
\end{array}
(FPCore (x y) :precision binary64 (* (/ y (+ y x)) (/ (/ x (+ x (+ y 1.0))) (+ y x))))
double code(double x, double y) {
return (y / (y + x)) * ((x / (x + (y + 1.0))) / (y + x));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (y / (y + x)) * ((x / (x + (y + 1.0d0))) / (y + x))
end function
public static double code(double x, double y) {
return (y / (y + x)) * ((x / (x + (y + 1.0))) / (y + x));
}
def code(x, y): return (y / (y + x)) * ((x / (x + (y + 1.0))) / (y + x))
function code(x, y) return Float64(Float64(y / Float64(y + x)) * Float64(Float64(x / Float64(x + Float64(y + 1.0))) / Float64(y + x))) end
function tmp = code(x, y) tmp = (y / (y + x)) * ((x / (x + (y + 1.0))) / (y + x)); end
code[x_, y_] := N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(N[(x / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{y}{y + x} \cdot \frac{\frac{x}{x + \left(y + 1\right)}}{y + x}
\end{array}
Initial program 68.6%
associate-+r+68.6%
*-commutative68.6%
frac-times89.4%
associate-*l/82.9%
times-frac99.9%
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ x (+ y 1.0))))
(if (<= y 2.2e-23)
(* (/ y (+ y x)) (/ (/ x (+ x 1.0)) (+ y x)))
(if (<= y 1.7e+122)
(* (/ x (* (+ y x) (+ y x))) (/ y t_0))
(/ (/ x t_0) y)))))
double code(double x, double y) {
double t_0 = x + (y + 1.0);
double tmp;
if (y <= 2.2e-23) {
tmp = (y / (y + x)) * ((x / (x + 1.0)) / (y + x));
} else if (y <= 1.7e+122) {
tmp = (x / ((y + x) * (y + x))) * (y / t_0);
} else {
tmp = (x / t_0) / 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 = x + (y + 1.0d0)
if (y <= 2.2d-23) then
tmp = (y / (y + x)) * ((x / (x + 1.0d0)) / (y + x))
else if (y <= 1.7d+122) then
tmp = (x / ((y + x) * (y + x))) * (y / t_0)
else
tmp = (x / t_0) / y
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x + (y + 1.0);
double tmp;
if (y <= 2.2e-23) {
tmp = (y / (y + x)) * ((x / (x + 1.0)) / (y + x));
} else if (y <= 1.7e+122) {
tmp = (x / ((y + x) * (y + x))) * (y / t_0);
} else {
tmp = (x / t_0) / y;
}
return tmp;
}
def code(x, y): t_0 = x + (y + 1.0) tmp = 0 if y <= 2.2e-23: tmp = (y / (y + x)) * ((x / (x + 1.0)) / (y + x)) elif y <= 1.7e+122: tmp = (x / ((y + x) * (y + x))) * (y / t_0) else: tmp = (x / t_0) / y return tmp
function code(x, y) t_0 = Float64(x + Float64(y + 1.0)) tmp = 0.0 if (y <= 2.2e-23) tmp = Float64(Float64(y / Float64(y + x)) * Float64(Float64(x / Float64(x + 1.0)) / Float64(y + x))); elseif (y <= 1.7e+122) tmp = Float64(Float64(x / Float64(Float64(y + x) * Float64(y + x))) * Float64(y / t_0)); else tmp = Float64(Float64(x / t_0) / y); end return tmp end
function tmp_2 = code(x, y) t_0 = x + (y + 1.0); tmp = 0.0; if (y <= 2.2e-23) tmp = (y / (y + x)) * ((x / (x + 1.0)) / (y + x)); elseif (y <= 1.7e+122) tmp = (x / ((y + x) * (y + x))) * (y / t_0); else tmp = (x / t_0) / y; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 2.2e-23], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.7e+122], N[(N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(x / t$95$0), $MachinePrecision] / y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x + \left(y + 1\right)\\
\mathbf{if}\;y \leq 2.2 \cdot 10^{-23}:\\
\;\;\;\;\frac{y}{y + x} \cdot \frac{\frac{x}{x + 1}}{y + x}\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{+122}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t_0}}{y}\\
\end{array}
\end{array}
if y < 2.1999999999999999e-23Initial program 67.5%
associate-+r+67.5%
*-commutative67.5%
frac-times88.6%
associate-*l/80.6%
times-frac99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 82.5%
+-commutative82.5%
Simplified82.5%
if 2.1999999999999999e-23 < y < 1.7e122Initial program 81.6%
times-frac99.7%
associate-+l+99.7%
Simplified99.7%
if 1.7e122 < y Initial program 67.4%
associate-/r*70.7%
+-commutative70.7%
+-commutative70.7%
+-commutative70.7%
associate-/l/67.4%
times-frac87.5%
*-commutative87.5%
+-commutative87.5%
+-commutative87.5%
+-commutative87.5%
associate-+l+87.5%
Simplified87.5%
Taylor expanded in y around inf 92.9%
associate-*l/93.0%
*-un-lft-identity93.0%
Applied egg-rr93.0%
Final simplification85.0%
(FPCore (x y)
:precision binary64
(if (<= x -1.08e+167)
(/ (/ y (+ y x)) (+ x (+ y (+ y 1.0))))
(if (<= x -1.85e-156)
(* (/ x (* (+ y x) (+ y x))) (/ y (+ x 1.0)))
(/ (/ x (+ x (+ y 1.0))) y))))
double code(double x, double y) {
double tmp;
if (x <= -1.08e+167) {
tmp = (y / (y + x)) / (x + (y + (y + 1.0)));
} else if (x <= -1.85e-156) {
tmp = (x / ((y + x) * (y + x))) * (y / (x + 1.0));
} else {
tmp = (x / (x + (y + 1.0))) / y;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.08d+167)) then
tmp = (y / (y + x)) / (x + (y + (y + 1.0d0)))
else if (x <= (-1.85d-156)) then
tmp = (x / ((y + x) * (y + x))) * (y / (x + 1.0d0))
else
tmp = (x / (x + (y + 1.0d0))) / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.08e+167) {
tmp = (y / (y + x)) / (x + (y + (y + 1.0)));
} else if (x <= -1.85e-156) {
tmp = (x / ((y + x) * (y + x))) * (y / (x + 1.0));
} else {
tmp = (x / (x + (y + 1.0))) / y;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.08e+167: tmp = (y / (y + x)) / (x + (y + (y + 1.0))) elif x <= -1.85e-156: tmp = (x / ((y + x) * (y + x))) * (y / (x + 1.0)) else: tmp = (x / (x + (y + 1.0))) / y return tmp
function code(x, y) tmp = 0.0 if (x <= -1.08e+167) tmp = Float64(Float64(y / Float64(y + x)) / Float64(x + Float64(y + Float64(y + 1.0)))); elseif (x <= -1.85e-156) tmp = Float64(Float64(x / Float64(Float64(y + x) * Float64(y + x))) * Float64(y / Float64(x + 1.0))); else tmp = Float64(Float64(x / Float64(x + Float64(y + 1.0))) / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.08e+167) tmp = (y / (y + x)) / (x + (y + (y + 1.0))); elseif (x <= -1.85e-156) tmp = (x / ((y + x) * (y + x))) * (y / (x + 1.0)); else tmp = (x / (x + (y + 1.0))) / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.08e+167], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(x + N[(y + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.85e-156], N[(N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.08 \cdot 10^{+167}:\\
\;\;\;\;\frac{\frac{y}{y + x}}{x + \left(y + \left(y + 1\right)\right)}\\
\mathbf{elif}\;x \leq -1.85 \cdot 10^{-156}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + \left(y + 1\right)}}{y}\\
\end{array}
\end{array}
if x < -1.08000000000000005e167Initial program 53.3%
associate-+r+53.3%
*-commutative53.3%
frac-times85.9%
associate-*l/85.9%
times-frac99.9%
Applied egg-rr99.9%
clear-num97.9%
inv-pow97.9%
+-commutative97.9%
Applied egg-rr97.9%
unpow-197.9%
un-div-inv97.9%
+-commutative97.9%
div-inv97.9%
clear-num97.9%
Applied egg-rr97.9%
Taylor expanded in x around -inf 88.0%
+-commutative88.0%
neg-mul-188.0%
+-commutative88.0%
distribute-lft-in88.0%
mul-1-neg88.0%
remove-double-neg88.0%
distribute-lft-in88.0%
metadata-eval88.0%
neg-mul-188.0%
distribute-lft-in88.0%
metadata-eval88.0%
mul-1-neg88.0%
remove-double-neg88.0%
+-commutative88.0%
Simplified88.0%
if -1.08000000000000005e167 < x < -1.85e-156Initial program 76.4%
times-frac98.5%
associate-+l+98.5%
Simplified98.5%
Taylor expanded in y around 0 81.3%
+-commutative81.3%
Simplified81.3%
if -1.85e-156 < x Initial program 68.0%
associate-/r*70.3%
+-commutative70.3%
+-commutative70.3%
+-commutative70.3%
associate-/l/68.0%
times-frac85.9%
*-commutative85.9%
+-commutative85.9%
+-commutative85.9%
+-commutative85.9%
associate-+l+85.9%
Simplified85.9%
Taylor expanded in y around inf 54.3%
associate-*l/54.3%
*-un-lft-identity54.3%
Applied egg-rr54.3%
Final simplification65.8%
(FPCore (x y)
:precision binary64
(if (<= x -1.0)
(/ (/ y x) x)
(if (<= x -1.58e-90)
(- (/ y x) y)
(if (<= x -7.2e-139)
(/ x (* y y))
(if (<= x -8e-155)
(/ y x)
(if (<= x 1.45e-104) (/ x y) (/ 1.0 (* y (/ y x)))))))))
double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = (y / x) / x;
} else if (x <= -1.58e-90) {
tmp = (y / x) - y;
} else if (x <= -7.2e-139) {
tmp = x / (y * y);
} else if (x <= -8e-155) {
tmp = y / x;
} else if (x <= 1.45e-104) {
tmp = x / y;
} else {
tmp = 1.0 / (y * (y / x));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.0d0)) then
tmp = (y / x) / x
else if (x <= (-1.58d-90)) then
tmp = (y / x) - y
else if (x <= (-7.2d-139)) then
tmp = x / (y * y)
else if (x <= (-8d-155)) then
tmp = y / x
else if (x <= 1.45d-104) then
tmp = x / y
else
tmp = 1.0d0 / (y * (y / x))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = (y / x) / x;
} else if (x <= -1.58e-90) {
tmp = (y / x) - y;
} else if (x <= -7.2e-139) {
tmp = x / (y * y);
} else if (x <= -8e-155) {
tmp = y / x;
} else if (x <= 1.45e-104) {
tmp = x / y;
} else {
tmp = 1.0 / (y * (y / x));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.0: tmp = (y / x) / x elif x <= -1.58e-90: tmp = (y / x) - y elif x <= -7.2e-139: tmp = x / (y * y) elif x <= -8e-155: tmp = y / x elif x <= 1.45e-104: tmp = x / y else: tmp = 1.0 / (y * (y / x)) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.0) tmp = Float64(Float64(y / x) / x); elseif (x <= -1.58e-90) tmp = Float64(Float64(y / x) - y); elseif (x <= -7.2e-139) tmp = Float64(x / Float64(y * y)); elseif (x <= -8e-155) tmp = Float64(y / x); elseif (x <= 1.45e-104) tmp = Float64(x / y); else tmp = Float64(1.0 / Float64(y * Float64(y / x))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.0) tmp = (y / x) / x; elseif (x <= -1.58e-90) tmp = (y / x) - y; elseif (x <= -7.2e-139) tmp = x / (y * y); elseif (x <= -8e-155) tmp = y / x; elseif (x <= 1.45e-104) tmp = x / y; else tmp = 1.0 / (y * (y / x)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.0], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -1.58e-90], N[(N[(y / x), $MachinePrecision] - y), $MachinePrecision], If[LessEqual[x, -7.2e-139], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -8e-155], N[(y / x), $MachinePrecision], If[LessEqual[x, 1.45e-104], N[(x / y), $MachinePrecision], N[(1.0 / N[(y * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;x \leq -1.58 \cdot 10^{-90}:\\
\;\;\;\;\frac{y}{x} - y\\
\mathbf{elif}\;x \leq -7.2 \cdot 10^{-139}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\mathbf{elif}\;x \leq -8 \cdot 10^{-155}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;x \leq 1.45 \cdot 10^{-104}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{y \cdot \frac{y}{x}}\\
\end{array}
\end{array}
if x < -1Initial program 61.8%
associate-+r+61.8%
*-commutative61.8%
frac-times92.3%
associate-*l/92.3%
times-frac99.8%
Applied egg-rr99.8%
clear-num99.0%
inv-pow99.0%
+-commutative99.0%
Applied egg-rr99.0%
unpow-199.0%
un-div-inv99.0%
+-commutative99.0%
div-inv99.0%
clear-num99.0%
Applied egg-rr99.0%
Taylor expanded in x around inf 77.3%
unpow277.3%
associate-/l/78.1%
Simplified78.1%
if -1 < x < -1.58e-90Initial program 86.6%
associate-+r+86.6%
*-commutative86.6%
frac-times99.9%
associate-*l/95.0%
times-frac99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 43.9%
*-commutative43.9%
distribute-lft-in43.9%
*-rgt-identity43.9%
Simplified43.9%
Taylor expanded in x around 0 43.9%
neg-mul-143.9%
unsub-neg43.9%
Simplified43.9%
if -1.58e-90 < x < -7.20000000000000007e-139Initial program 99.8%
associate-/r*99.6%
+-commutative99.6%
+-commutative99.6%
+-commutative99.6%
associate-/r*99.8%
associate-*l/88.4%
*-commutative88.4%
*-commutative88.4%
distribute-rgt1-in88.4%
fma-def88.4%
+-commutative88.4%
+-commutative88.4%
cube-unmult88.4%
+-commutative88.4%
Simplified88.4%
Taylor expanded in y around inf 51.7%
unpow251.7%
Simplified51.7%
if -7.20000000000000007e-139 < x < -8.00000000000000011e-155Initial program 52.2%
associate-+r+52.2%
*-commutative52.2%
frac-times100.0%
associate-*l/52.2%
times-frac100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 51.4%
*-commutative51.4%
distribute-lft-in51.4%
*-rgt-identity51.4%
Simplified51.4%
Taylor expanded in x around 0 51.4%
if -8.00000000000000011e-155 < x < 1.4500000000000001e-104Initial program 64.2%
times-frac79.8%
associate-+l+79.8%
Simplified79.8%
Taylor expanded in x around 0 83.3%
+-commutative83.3%
Simplified83.3%
Taylor expanded in y around 0 66.1%
if 1.4500000000000001e-104 < x Initial program 71.8%
associate-/r*76.3%
+-commutative76.3%
+-commutative76.3%
+-commutative76.3%
associate-/l/71.8%
times-frac91.8%
*-commutative91.8%
+-commutative91.8%
+-commutative91.8%
+-commutative91.8%
associate-+l+91.8%
Simplified91.8%
Taylor expanded in y around inf 26.4%
*-commutative26.4%
clear-num26.3%
frac-times26.4%
metadata-eval26.4%
Applied egg-rr26.4%
Taylor expanded in y around inf 24.5%
Final simplification53.9%
(FPCore (x y) :precision binary64 (if (<= y 64000000000.0) (* (/ y (+ y x)) (/ (/ x (+ x 1.0)) (+ y x))) (/ (/ x (+ x (+ y 1.0))) y)))
double code(double x, double y) {
double tmp;
if (y <= 64000000000.0) {
tmp = (y / (y + x)) * ((x / (x + 1.0)) / (y + x));
} else {
tmp = (x / (x + (y + 1.0))) / y;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 64000000000.0d0) then
tmp = (y / (y + x)) * ((x / (x + 1.0d0)) / (y + x))
else
tmp = (x / (x + (y + 1.0d0))) / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 64000000000.0) {
tmp = (y / (y + x)) * ((x / (x + 1.0)) / (y + x));
} else {
tmp = (x / (x + (y + 1.0))) / y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 64000000000.0: tmp = (y / (y + x)) * ((x / (x + 1.0)) / (y + x)) else: tmp = (x / (x + (y + 1.0))) / y return tmp
function code(x, y) tmp = 0.0 if (y <= 64000000000.0) tmp = Float64(Float64(y / Float64(y + x)) * Float64(Float64(x / Float64(x + 1.0)) / Float64(y + x))); else tmp = Float64(Float64(x / Float64(x + Float64(y + 1.0))) / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 64000000000.0) tmp = (y / (y + x)) * ((x / (x + 1.0)) / (y + x)); else tmp = (x / (x + (y + 1.0))) / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 64000000000.0], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 64000000000:\\
\;\;\;\;\frac{y}{y + x} \cdot \frac{\frac{x}{x + 1}}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + \left(y + 1\right)}}{y}\\
\end{array}
\end{array}
if y < 6.4e10Initial program 68.1%
associate-+r+68.1%
*-commutative68.1%
frac-times88.8%
associate-*l/80.9%
times-frac99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 82.3%
+-commutative82.3%
Simplified82.3%
if 6.4e10 < y Initial program 71.2%
associate-/r*77.4%
+-commutative77.4%
+-commutative77.4%
+-commutative77.4%
associate-/l/71.2%
times-frac92.3%
*-commutative92.3%
+-commutative92.3%
+-commutative92.3%
+-commutative92.3%
associate-+l+92.3%
Simplified92.3%
Taylor expanded in y around inf 81.9%
associate-*l/81.9%
*-un-lft-identity81.9%
Applied egg-rr81.9%
Final simplification82.2%
(FPCore (x y) :precision binary64 (if (<= x -8.8e-15) (* (/ (/ x (+ x (+ y 1.0))) (+ y x)) (/ y x)) (/ (/ y (+ y x)) (* (+ y x) (/ (+ y 1.0) x)))))
double code(double x, double y) {
double tmp;
if (x <= -8.8e-15) {
tmp = ((x / (x + (y + 1.0))) / (y + x)) * (y / x);
} else {
tmp = (y / (y + x)) / ((y + x) * ((y + 1.0) / x));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-8.8d-15)) then
tmp = ((x / (x + (y + 1.0d0))) / (y + x)) * (y / x)
else
tmp = (y / (y + x)) / ((y + x) * ((y + 1.0d0) / x))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -8.8e-15) {
tmp = ((x / (x + (y + 1.0))) / (y + x)) * (y / x);
} else {
tmp = (y / (y + x)) / ((y + x) * ((y + 1.0) / x));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -8.8e-15: tmp = ((x / (x + (y + 1.0))) / (y + x)) * (y / x) else: tmp = (y / (y + x)) / ((y + x) * ((y + 1.0) / x)) return tmp
function code(x, y) tmp = 0.0 if (x <= -8.8e-15) tmp = Float64(Float64(Float64(x / Float64(x + Float64(y + 1.0))) / Float64(y + x)) * Float64(y / x)); else tmp = Float64(Float64(y / Float64(y + x)) / Float64(Float64(y + x) * Float64(Float64(y + 1.0) / x))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -8.8e-15) tmp = ((x / (x + (y + 1.0))) / (y + x)) * (y / x); else tmp = (y / (y + x)) / ((y + x) * ((y + 1.0) / x)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -8.8e-15], N[(N[(N[(x / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] * N[(N[(y + 1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.8 \cdot 10^{-15}:\\
\;\;\;\;\frac{\frac{x}{x + \left(y + 1\right)}}{y + x} \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{y + x}}{\left(y + x\right) \cdot \frac{y + 1}{x}}\\
\end{array}
\end{array}
if x < -8.79999999999999942e-15Initial program 64.9%
associate-+r+64.9%
*-commutative64.9%
frac-times92.9%
associate-*l/92.9%
times-frac99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 86.5%
if -8.79999999999999942e-15 < x Initial program 70.2%
associate-+r+70.2%
*-commutative70.2%
frac-times88.0%
associate-*l/78.8%
times-frac99.9%
Applied egg-rr99.9%
clear-num99.4%
inv-pow99.4%
+-commutative99.4%
Applied egg-rr99.4%
unpow-199.4%
un-div-inv99.4%
+-commutative99.4%
div-inv99.4%
clear-num99.4%
Applied egg-rr99.4%
Taylor expanded in x around 0 83.2%
+-commutative83.2%
Simplified83.2%
Final simplification84.1%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (* y y))))
(if (<= x -1.0)
(/ y (* x x))
(if (<= x -1.35e-90)
(- (/ y x) y)
(if (<= x -1.06e-139)
t_0
(if (<= x -2e-155) (/ y x) (if (<= x 1.6e-104) (/ x y) t_0)))))))
double code(double x, double y) {
double t_0 = x / (y * y);
double tmp;
if (x <= -1.0) {
tmp = y / (x * x);
} else if (x <= -1.35e-90) {
tmp = (y / x) - y;
} else if (x <= -1.06e-139) {
tmp = t_0;
} else if (x <= -2e-155) {
tmp = y / x;
} else if (x <= 1.6e-104) {
tmp = x / y;
} else {
tmp = 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) :: tmp
t_0 = x / (y * y)
if (x <= (-1.0d0)) then
tmp = y / (x * x)
else if (x <= (-1.35d-90)) then
tmp = (y / x) - y
else if (x <= (-1.06d-139)) then
tmp = t_0
else if (x <= (-2d-155)) then
tmp = y / x
else if (x <= 1.6d-104) then
tmp = x / y
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x / (y * y);
double tmp;
if (x <= -1.0) {
tmp = y / (x * x);
} else if (x <= -1.35e-90) {
tmp = (y / x) - y;
} else if (x <= -1.06e-139) {
tmp = t_0;
} else if (x <= -2e-155) {
tmp = y / x;
} else if (x <= 1.6e-104) {
tmp = x / y;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = x / (y * y) tmp = 0 if x <= -1.0: tmp = y / (x * x) elif x <= -1.35e-90: tmp = (y / x) - y elif x <= -1.06e-139: tmp = t_0 elif x <= -2e-155: tmp = y / x elif x <= 1.6e-104: tmp = x / y else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(x / Float64(y * y)) tmp = 0.0 if (x <= -1.0) tmp = Float64(y / Float64(x * x)); elseif (x <= -1.35e-90) tmp = Float64(Float64(y / x) - y); elseif (x <= -1.06e-139) tmp = t_0; elseif (x <= -2e-155) tmp = Float64(y / x); elseif (x <= 1.6e-104) tmp = Float64(x / y); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = x / (y * y); tmp = 0.0; if (x <= -1.0) tmp = y / (x * x); elseif (x <= -1.35e-90) tmp = (y / x) - y; elseif (x <= -1.06e-139) tmp = t_0; elseif (x <= -2e-155) tmp = y / x; elseif (x <= 1.6e-104) tmp = x / y; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.0], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.35e-90], N[(N[(y / x), $MachinePrecision] - y), $MachinePrecision], If[LessEqual[x, -1.06e-139], t$95$0, If[LessEqual[x, -2e-155], N[(y / x), $MachinePrecision], If[LessEqual[x, 1.6e-104], N[(x / y), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{y \cdot y}\\
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{y}{x \cdot x}\\
\mathbf{elif}\;x \leq -1.35 \cdot 10^{-90}:\\
\;\;\;\;\frac{y}{x} - y\\
\mathbf{elif}\;x \leq -1.06 \cdot 10^{-139}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -2 \cdot 10^{-155}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{-104}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -1Initial program 61.8%
associate-/r*72.0%
+-commutative72.0%
+-commutative72.0%
+-commutative72.0%
associate-/r*61.8%
associate-*l/82.0%
*-commutative82.0%
*-commutative82.0%
distribute-rgt1-in34.3%
fma-def82.0%
+-commutative82.0%
+-commutative82.0%
cube-unmult82.0%
+-commutative82.0%
Simplified82.0%
Taylor expanded in x around inf 77.3%
unpow277.3%
Simplified77.3%
if -1 < x < -1.34999999999999998e-90Initial program 86.6%
associate-+r+86.6%
*-commutative86.6%
frac-times99.9%
associate-*l/95.0%
times-frac99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 43.9%
*-commutative43.9%
distribute-lft-in43.9%
*-rgt-identity43.9%
Simplified43.9%
Taylor expanded in x around 0 43.9%
neg-mul-143.9%
unsub-neg43.9%
Simplified43.9%
if -1.34999999999999998e-90 < x < -1.05999999999999997e-139 or 1.59999999999999994e-104 < x Initial program 74.3%
associate-/r*78.4%
+-commutative78.4%
+-commutative78.4%
+-commutative78.4%
associate-/r*74.3%
associate-*l/87.3%
*-commutative87.3%
*-commutative87.3%
distribute-rgt1-in84.9%
fma-def87.3%
+-commutative87.3%
+-commutative87.3%
cube-unmult87.3%
+-commutative87.3%
Simplified87.3%
Taylor expanded in y around inf 25.8%
unpow225.8%
Simplified25.8%
if -1.05999999999999997e-139 < x < -2.00000000000000003e-155Initial program 52.2%
associate-+r+52.2%
*-commutative52.2%
frac-times100.0%
associate-*l/52.2%
times-frac100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 51.4%
*-commutative51.4%
distribute-lft-in51.4%
*-rgt-identity51.4%
Simplified51.4%
Taylor expanded in x around 0 51.4%
if -2.00000000000000003e-155 < x < 1.59999999999999994e-104Initial program 64.2%
times-frac79.8%
associate-+l+79.8%
Simplified79.8%
Taylor expanded in x around 0 83.3%
+-commutative83.3%
Simplified83.3%
Taylor expanded in y around 0 66.1%
Final simplification53.3%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (* y y))))
(if (<= x -1.0)
(/ (/ y x) x)
(if (<= x -1.12e-90)
(- (/ y x) y)
(if (<= x -2.5e-139)
t_0
(if (<= x -6.8e-155) (/ y x) (if (<= x 1.02e-104) (/ x y) t_0)))))))
double code(double x, double y) {
double t_0 = x / (y * y);
double tmp;
if (x <= -1.0) {
tmp = (y / x) / x;
} else if (x <= -1.12e-90) {
tmp = (y / x) - y;
} else if (x <= -2.5e-139) {
tmp = t_0;
} else if (x <= -6.8e-155) {
tmp = y / x;
} else if (x <= 1.02e-104) {
tmp = x / y;
} else {
tmp = 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) :: tmp
t_0 = x / (y * y)
if (x <= (-1.0d0)) then
tmp = (y / x) / x
else if (x <= (-1.12d-90)) then
tmp = (y / x) - y
else if (x <= (-2.5d-139)) then
tmp = t_0
else if (x <= (-6.8d-155)) then
tmp = y / x
else if (x <= 1.02d-104) then
tmp = x / y
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x / (y * y);
double tmp;
if (x <= -1.0) {
tmp = (y / x) / x;
} else if (x <= -1.12e-90) {
tmp = (y / x) - y;
} else if (x <= -2.5e-139) {
tmp = t_0;
} else if (x <= -6.8e-155) {
tmp = y / x;
} else if (x <= 1.02e-104) {
tmp = x / y;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = x / (y * y) tmp = 0 if x <= -1.0: tmp = (y / x) / x elif x <= -1.12e-90: tmp = (y / x) - y elif x <= -2.5e-139: tmp = t_0 elif x <= -6.8e-155: tmp = y / x elif x <= 1.02e-104: tmp = x / y else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(x / Float64(y * y)) tmp = 0.0 if (x <= -1.0) tmp = Float64(Float64(y / x) / x); elseif (x <= -1.12e-90) tmp = Float64(Float64(y / x) - y); elseif (x <= -2.5e-139) tmp = t_0; elseif (x <= -6.8e-155) tmp = Float64(y / x); elseif (x <= 1.02e-104) tmp = Float64(x / y); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = x / (y * y); tmp = 0.0; if (x <= -1.0) tmp = (y / x) / x; elseif (x <= -1.12e-90) tmp = (y / x) - y; elseif (x <= -2.5e-139) tmp = t_0; elseif (x <= -6.8e-155) tmp = y / x; elseif (x <= 1.02e-104) tmp = x / y; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.0], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -1.12e-90], N[(N[(y / x), $MachinePrecision] - y), $MachinePrecision], If[LessEqual[x, -2.5e-139], t$95$0, If[LessEqual[x, -6.8e-155], N[(y / x), $MachinePrecision], If[LessEqual[x, 1.02e-104], N[(x / y), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{y \cdot y}\\
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;x \leq -1.12 \cdot 10^{-90}:\\
\;\;\;\;\frac{y}{x} - y\\
\mathbf{elif}\;x \leq -2.5 \cdot 10^{-139}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -6.8 \cdot 10^{-155}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;x \leq 1.02 \cdot 10^{-104}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -1Initial program 61.8%
associate-+r+61.8%
*-commutative61.8%
frac-times92.3%
associate-*l/92.3%
times-frac99.8%
Applied egg-rr99.8%
clear-num99.0%
inv-pow99.0%
+-commutative99.0%
Applied egg-rr99.0%
unpow-199.0%
un-div-inv99.0%
+-commutative99.0%
div-inv99.0%
clear-num99.0%
Applied egg-rr99.0%
Taylor expanded in x around inf 77.3%
unpow277.3%
associate-/l/78.1%
Simplified78.1%
if -1 < x < -1.12e-90Initial program 86.6%
associate-+r+86.6%
*-commutative86.6%
frac-times99.9%
associate-*l/95.0%
times-frac99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 43.9%
*-commutative43.9%
distribute-lft-in43.9%
*-rgt-identity43.9%
Simplified43.9%
Taylor expanded in x around 0 43.9%
neg-mul-143.9%
unsub-neg43.9%
Simplified43.9%
if -1.12e-90 < x < -2.50000000000000017e-139 or 1.02000000000000001e-104 < x Initial program 74.3%
associate-/r*78.4%
+-commutative78.4%
+-commutative78.4%
+-commutative78.4%
associate-/r*74.3%
associate-*l/87.3%
*-commutative87.3%
*-commutative87.3%
distribute-rgt1-in84.9%
fma-def87.3%
+-commutative87.3%
+-commutative87.3%
cube-unmult87.3%
+-commutative87.3%
Simplified87.3%
Taylor expanded in y around inf 25.8%
unpow225.8%
Simplified25.8%
if -2.50000000000000017e-139 < x < -6.8e-155Initial program 52.2%
associate-+r+52.2%
*-commutative52.2%
frac-times100.0%
associate-*l/52.2%
times-frac100.0%
Applied egg-rr100.0%
Taylor expanded in y around 0 51.4%
*-commutative51.4%
distribute-lft-in51.4%
*-rgt-identity51.4%
Simplified51.4%
Taylor expanded in x around 0 51.4%
if -6.8e-155 < x < 1.02000000000000001e-104Initial program 64.2%
times-frac79.8%
associate-+l+79.8%
Simplified79.8%
Taylor expanded in x around 0 83.3%
+-commutative83.3%
Simplified83.3%
Taylor expanded in y around 0 66.1%
Final simplification53.5%
(FPCore (x y) :precision binary64 (if (<= y 4.2e-82) (/ (/ y (+ y x)) (+ x (+ y (+ y 1.0)))) (/ (/ x (+ x (+ y 1.0))) y)))
double code(double x, double y) {
double tmp;
if (y <= 4.2e-82) {
tmp = (y / (y + x)) / (x + (y + (y + 1.0)));
} else {
tmp = (x / (x + (y + 1.0))) / y;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 4.2d-82) then
tmp = (y / (y + x)) / (x + (y + (y + 1.0d0)))
else
tmp = (x / (x + (y + 1.0d0))) / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 4.2e-82) {
tmp = (y / (y + x)) / (x + (y + (y + 1.0)));
} else {
tmp = (x / (x + (y + 1.0))) / y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 4.2e-82: tmp = (y / (y + x)) / (x + (y + (y + 1.0))) else: tmp = (x / (x + (y + 1.0))) / y return tmp
function code(x, y) tmp = 0.0 if (y <= 4.2e-82) tmp = Float64(Float64(y / Float64(y + x)) / Float64(x + Float64(y + Float64(y + 1.0)))); else tmp = Float64(Float64(x / Float64(x + Float64(y + 1.0))) / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 4.2e-82) tmp = (y / (y + x)) / (x + (y + (y + 1.0))); else tmp = (x / (x + (y + 1.0))) / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 4.2e-82], N[(N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(x + N[(y + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.2 \cdot 10^{-82}:\\
\;\;\;\;\frac{\frac{y}{y + x}}{x + \left(y + \left(y + 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + \left(y + 1\right)}}{y}\\
\end{array}
\end{array}
if y < 4.2000000000000001e-82Initial program 65.3%
associate-+r+65.3%
*-commutative65.3%
frac-times87.3%
associate-*l/79.4%
times-frac99.8%
Applied egg-rr99.8%
clear-num99.8%
inv-pow99.8%
+-commutative99.8%
Applied egg-rr99.8%
unpow-199.8%
un-div-inv99.8%
+-commutative99.8%
div-inv99.7%
clear-num99.7%
Applied egg-rr99.7%
Taylor expanded in x around -inf 62.6%
+-commutative62.6%
neg-mul-162.6%
+-commutative62.6%
distribute-lft-in62.6%
mul-1-neg62.6%
remove-double-neg62.6%
distribute-lft-in62.6%
metadata-eval62.6%
neg-mul-162.6%
distribute-lft-in62.6%
metadata-eval62.6%
mul-1-neg62.6%
remove-double-neg62.6%
+-commutative62.6%
Simplified62.6%
if 4.2000000000000001e-82 < y Initial program 77.7%
associate-/r*82.7%
+-commutative82.7%
+-commutative82.7%
+-commutative82.7%
associate-/l/77.7%
times-frac95.0%
*-commutative95.0%
+-commutative95.0%
+-commutative95.0%
+-commutative95.0%
associate-+l+95.0%
Simplified95.0%
Taylor expanded in y around inf 66.2%
associate-*l/66.3%
*-un-lft-identity66.3%
Applied egg-rr66.3%
Final simplification63.6%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (* y y))))
(if (<= y -8e+144)
t_0
(if (<= y 3.4e-222)
(/ y x)
(if (<= y 52000000000.0) (- (/ x y) x) t_0)))))
double code(double x, double y) {
double t_0 = x / (y * y);
double tmp;
if (y <= -8e+144) {
tmp = t_0;
} else if (y <= 3.4e-222) {
tmp = y / x;
} else if (y <= 52000000000.0) {
tmp = (x / y) - x;
} else {
tmp = 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) :: tmp
t_0 = x / (y * y)
if (y <= (-8d+144)) then
tmp = t_0
else if (y <= 3.4d-222) then
tmp = y / x
else if (y <= 52000000000.0d0) then
tmp = (x / y) - x
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x / (y * y);
double tmp;
if (y <= -8e+144) {
tmp = t_0;
} else if (y <= 3.4e-222) {
tmp = y / x;
} else if (y <= 52000000000.0) {
tmp = (x / y) - x;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = x / (y * y) tmp = 0 if y <= -8e+144: tmp = t_0 elif y <= 3.4e-222: tmp = y / x elif y <= 52000000000.0: tmp = (x / y) - x else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(x / Float64(y * y)) tmp = 0.0 if (y <= -8e+144) tmp = t_0; elseif (y <= 3.4e-222) tmp = Float64(y / x); elseif (y <= 52000000000.0) tmp = Float64(Float64(x / y) - x); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = x / (y * y); tmp = 0.0; if (y <= -8e+144) tmp = t_0; elseif (y <= 3.4e-222) tmp = y / x; elseif (y <= 52000000000.0) tmp = (x / y) - x; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -8e+144], t$95$0, If[LessEqual[y, 3.4e-222], N[(y / x), $MachinePrecision], If[LessEqual[y, 52000000000.0], N[(N[(x / y), $MachinePrecision] - x), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{y \cdot y}\\
\mathbf{if}\;y \leq -8 \cdot 10^{+144}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 3.4 \cdot 10^{-222}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;y \leq 52000000000:\\
\;\;\;\;\frac{x}{y} - x\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if y < -8.00000000000000019e144 or 5.2e10 < y Initial program 60.8%
associate-/r*64.3%
+-commutative64.3%
+-commutative64.3%
+-commutative64.3%
associate-/r*60.8%
associate-*l/82.0%
*-commutative82.0%
*-commutative82.0%
distribute-rgt1-in46.6%
fma-def82.0%
+-commutative82.0%
+-commutative82.0%
cube-unmult82.0%
+-commutative82.0%
Simplified82.0%
Taylor expanded in y around inf 78.4%
unpow278.4%
Simplified78.4%
if -8.00000000000000019e144 < y < 3.4000000000000001e-222Initial program 67.4%
associate-+r+67.4%
*-commutative67.4%
frac-times90.9%
associate-*l/79.3%
times-frac99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 66.7%
*-commutative66.7%
distribute-lft-in66.6%
*-rgt-identity66.6%
Simplified66.6%
Taylor expanded in x around 0 41.8%
if 3.4000000000000001e-222 < y < 5.2e10Initial program 83.4%
times-frac90.3%
associate-+l+90.3%
Simplified90.3%
Taylor expanded in x around 0 28.9%
+-commutative28.9%
Simplified28.9%
Taylor expanded in y around 0 28.4%
neg-mul-128.4%
unsub-neg28.4%
Simplified28.4%
Final simplification50.2%
(FPCore (x y) :precision binary64 (if (<= x -1.0) (/ (/ y x) x) (if (<= x -7.7e-91) (- (/ y x) y) (/ x (* y (+ y 1.0))))))
double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = (y / x) / x;
} else if (x <= -7.7e-91) {
tmp = (y / x) - y;
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.0d0)) then
tmp = (y / x) / x
else if (x <= (-7.7d-91)) then
tmp = (y / x) - y
else
tmp = x / (y * (y + 1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.0) {
tmp = (y / x) / x;
} else if (x <= -7.7e-91) {
tmp = (y / x) - y;
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.0: tmp = (y / x) / x elif x <= -7.7e-91: tmp = (y / x) - y else: tmp = x / (y * (y + 1.0)) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.0) tmp = Float64(Float64(y / x) / x); elseif (x <= -7.7e-91) tmp = Float64(Float64(y / x) - y); else tmp = Float64(x / Float64(y * Float64(y + 1.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.0) tmp = (y / x) / x; elseif (x <= -7.7e-91) tmp = (y / x) - y; else tmp = x / (y * (y + 1.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.0], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -7.7e-91], N[(N[(y / x), $MachinePrecision] - y), $MachinePrecision], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;x \leq -7.7 \cdot 10^{-91}:\\
\;\;\;\;\frac{y}{x} - y\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if x < -1Initial program 61.8%
associate-+r+61.8%
*-commutative61.8%
frac-times92.3%
associate-*l/92.3%
times-frac99.8%
Applied egg-rr99.8%
clear-num99.0%
inv-pow99.0%
+-commutative99.0%
Applied egg-rr99.0%
unpow-199.0%
un-div-inv99.0%
+-commutative99.0%
div-inv99.0%
clear-num99.0%
Applied egg-rr99.0%
Taylor expanded in x around inf 77.3%
unpow277.3%
associate-/l/78.1%
Simplified78.1%
if -1 < x < -7.6999999999999997e-91Initial program 86.6%
associate-+r+86.6%
*-commutative86.6%
frac-times99.9%
associate-*l/95.0%
times-frac99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 43.9%
*-commutative43.9%
distribute-lft-in43.9%
*-rgt-identity43.9%
Simplified43.9%
Taylor expanded in x around 0 43.9%
neg-mul-143.9%
unsub-neg43.9%
Simplified43.9%
if -7.6999999999999997e-91 < x Initial program 69.2%
times-frac86.9%
associate-+l+86.9%
Simplified86.9%
Taylor expanded in x around 0 55.0%
+-commutative55.0%
Simplified55.0%
Final simplification60.2%
(FPCore (x y) :precision binary64 (if (<= x -4.25e+167) (/ (/ y x) x) (if (<= x -1.4e-90) (/ y (* x (+ x 1.0))) (/ x (* y (+ y 1.0))))))
double code(double x, double y) {
double tmp;
if (x <= -4.25e+167) {
tmp = (y / x) / x;
} else if (x <= -1.4e-90) {
tmp = y / (x * (x + 1.0));
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-4.25d+167)) then
tmp = (y / x) / x
else if (x <= (-1.4d-90)) then
tmp = y / (x * (x + 1.0d0))
else
tmp = x / (y * (y + 1.0d0))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -4.25e+167) {
tmp = (y / x) / x;
} else if (x <= -1.4e-90) {
tmp = y / (x * (x + 1.0));
} else {
tmp = x / (y * (y + 1.0));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -4.25e+167: tmp = (y / x) / x elif x <= -1.4e-90: tmp = y / (x * (x + 1.0)) else: tmp = x / (y * (y + 1.0)) return tmp
function code(x, y) tmp = 0.0 if (x <= -4.25e+167) tmp = Float64(Float64(y / x) / x); elseif (x <= -1.4e-90) tmp = Float64(y / Float64(x * Float64(x + 1.0))); else tmp = Float64(x / Float64(y * Float64(y + 1.0))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -4.25e+167) tmp = (y / x) / x; elseif (x <= -1.4e-90) tmp = y / (x * (x + 1.0)); else tmp = x / (y * (y + 1.0)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -4.25e+167], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -1.4e-90], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.25 \cdot 10^{+167}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;x \leq -1.4 \cdot 10^{-90}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\end{array}
\end{array}
if x < -4.25000000000000003e167Initial program 53.3%
associate-+r+53.3%
*-commutative53.3%
frac-times85.9%
associate-*l/85.9%
times-frac99.9%
Applied egg-rr99.9%
clear-num97.9%
inv-pow97.9%
+-commutative97.9%
Applied egg-rr97.9%
unpow-197.9%
un-div-inv97.9%
+-commutative97.9%
div-inv97.9%
clear-num97.9%
Applied egg-rr97.9%
Taylor expanded in x around inf 85.9%
unpow285.9%
associate-/l/87.5%
Simplified87.5%
if -4.25000000000000003e167 < x < -1.3999999999999999e-90Initial program 74.9%
associate-+r+74.9%
*-commutative74.9%
frac-times98.2%
associate-*l/96.5%
times-frac99.8%
Applied egg-rr99.8%
clear-num99.8%
inv-pow99.8%
+-commutative99.8%
Applied egg-rr99.8%
unpow-199.8%
un-div-inv99.8%
+-commutative99.8%
div-inv99.8%
clear-num99.7%
Applied egg-rr99.7%
Taylor expanded in y around 0 62.5%
*-commutative62.5%
Simplified62.5%
if -1.3999999999999999e-90 < x Initial program 69.2%
times-frac86.9%
associate-+l+86.9%
Simplified86.9%
Taylor expanded in x around 0 55.0%
+-commutative55.0%
Simplified55.0%
Final simplification60.5%
(FPCore (x y) :precision binary64 (if (<= x -1.65e+167) (/ (/ y x) x) (if (<= x -9.8e-91) (/ y (* x (+ x 1.0))) (/ (/ x y) (+ y 1.0)))))
double code(double x, double y) {
double tmp;
if (x <= -1.65e+167) {
tmp = (y / x) / x;
} else if (x <= -9.8e-91) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.65d+167)) then
tmp = (y / x) / x
else if (x <= (-9.8d-91)) then
tmp = y / (x * (x + 1.0d0))
else
tmp = (x / y) / (y + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.65e+167) {
tmp = (y / x) / x;
} else if (x <= -9.8e-91) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.65e+167: tmp = (y / x) / x elif x <= -9.8e-91: tmp = y / (x * (x + 1.0)) else: tmp = (x / y) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (x <= -1.65e+167) tmp = Float64(Float64(y / x) / x); elseif (x <= -9.8e-91) tmp = Float64(y / Float64(x * Float64(x + 1.0))); else tmp = Float64(Float64(x / y) / Float64(y + 1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.65e+167) tmp = (y / x) / x; elseif (x <= -9.8e-91) tmp = y / (x * (x + 1.0)); else tmp = (x / y) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.65e+167], N[(N[(y / x), $MachinePrecision] / x), $MachinePrecision], If[LessEqual[x, -9.8e-91], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.65 \cdot 10^{+167}:\\
\;\;\;\;\frac{\frac{y}{x}}{x}\\
\mathbf{elif}\;x \leq -9.8 \cdot 10^{-91}:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if x < -1.65000000000000009e167Initial program 53.3%
associate-+r+53.3%
*-commutative53.3%
frac-times85.9%
associate-*l/85.9%
times-frac99.9%
Applied egg-rr99.9%
clear-num97.9%
inv-pow97.9%
+-commutative97.9%
Applied egg-rr97.9%
unpow-197.9%
un-div-inv97.9%
+-commutative97.9%
div-inv97.9%
clear-num97.9%
Applied egg-rr97.9%
Taylor expanded in x around inf 85.9%
unpow285.9%
associate-/l/87.5%
Simplified87.5%
if -1.65000000000000009e167 < x < -9.7999999999999996e-91Initial program 74.9%
associate-+r+74.9%
*-commutative74.9%
frac-times98.2%
associate-*l/96.5%
times-frac99.8%
Applied egg-rr99.8%
clear-num99.8%
inv-pow99.8%
+-commutative99.8%
Applied egg-rr99.8%
unpow-199.8%
un-div-inv99.8%
+-commutative99.8%
div-inv99.8%
clear-num99.7%
Applied egg-rr99.7%
Taylor expanded in y around 0 62.5%
*-commutative62.5%
Simplified62.5%
if -9.7999999999999996e-91 < x Initial program 69.2%
associate-+r+69.2%
*-commutative69.2%
frac-times86.9%
associate-*l/77.5%
times-frac99.8%
Applied egg-rr99.8%
clear-num99.4%
inv-pow99.4%
+-commutative99.4%
Applied egg-rr99.4%
unpow-199.4%
un-div-inv99.4%
+-commutative99.4%
div-inv99.3%
clear-num99.4%
Applied egg-rr99.4%
Taylor expanded in x around 0 55.0%
associate-/r*55.6%
+-commutative55.6%
Simplified55.6%
Final simplification60.9%
(FPCore (x y) :precision binary64 (if (<= y 4.2e-82) (/ (/ y (+ x 1.0)) x) (/ (/ x (+ x (+ y 1.0))) y)))
double code(double x, double y) {
double tmp;
if (y <= 4.2e-82) {
tmp = (y / (x + 1.0)) / x;
} else {
tmp = (x / (x + (y + 1.0))) / y;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 4.2d-82) then
tmp = (y / (x + 1.0d0)) / x
else
tmp = (x / (x + (y + 1.0d0))) / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 4.2e-82) {
tmp = (y / (x + 1.0)) / x;
} else {
tmp = (x / (x + (y + 1.0))) / y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 4.2e-82: tmp = (y / (x + 1.0)) / x else: tmp = (x / (x + (y + 1.0))) / y return tmp
function code(x, y) tmp = 0.0 if (y <= 4.2e-82) tmp = Float64(Float64(y / Float64(x + 1.0)) / x); else tmp = Float64(Float64(x / Float64(x + Float64(y + 1.0))) / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 4.2e-82) tmp = (y / (x + 1.0)) / x; else tmp = (x / (x + (y + 1.0))) / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 4.2e-82], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(x / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.2 \cdot 10^{-82}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{x + \left(y + 1\right)}}{y}\\
\end{array}
\end{array}
if y < 4.2000000000000001e-82Initial program 65.3%
associate-+r+65.3%
*-commutative65.3%
frac-times87.3%
associate-*l/79.4%
times-frac99.8%
Applied egg-rr99.8%
clear-num99.8%
inv-pow99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 60.2%
associate-/r*61.6%
Simplified61.6%
if 4.2000000000000001e-82 < y Initial program 77.7%
associate-/r*82.7%
+-commutative82.7%
+-commutative82.7%
+-commutative82.7%
associate-/l/77.7%
times-frac95.0%
*-commutative95.0%
+-commutative95.0%
+-commutative95.0%
+-commutative95.0%
associate-+l+95.0%
Simplified95.0%
Taylor expanded in y around inf 66.2%
associate-*l/66.3%
*-un-lft-identity66.3%
Applied egg-rr66.3%
Final simplification62.8%
(FPCore (x y) :precision binary64 (if (<= y 3.2e-82) (/ (/ y (+ x 1.0)) x) (/ (/ x y) (+ y 1.0))))
double code(double x, double y) {
double tmp;
if (y <= 3.2e-82) {
tmp = (y / (x + 1.0)) / x;
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 3.2d-82) then
tmp = (y / (x + 1.0d0)) / x
else
tmp = (x / y) / (y + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 3.2e-82) {
tmp = (y / (x + 1.0)) / x;
} else {
tmp = (x / y) / (y + 1.0);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 3.2e-82: tmp = (y / (x + 1.0)) / x else: tmp = (x / y) / (y + 1.0) return tmp
function code(x, y) tmp = 0.0 if (y <= 3.2e-82) tmp = Float64(Float64(y / Float64(x + 1.0)) / x); else tmp = Float64(Float64(x / y) / Float64(y + 1.0)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 3.2e-82) tmp = (y / (x + 1.0)) / x; else tmp = (x / y) / (y + 1.0); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 3.2e-82], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], N[(N[(x / y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.2 \cdot 10^{-82}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + 1}\\
\end{array}
\end{array}
if y < 3.2000000000000001e-82Initial program 65.3%
associate-+r+65.3%
*-commutative65.3%
frac-times87.3%
associate-*l/79.4%
times-frac99.8%
Applied egg-rr99.8%
clear-num99.8%
inv-pow99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in y around 0 60.2%
associate-/r*61.6%
Simplified61.6%
if 3.2000000000000001e-82 < y Initial program 77.7%
associate-+r+77.7%
*-commutative77.7%
frac-times95.0%
associate-*l/92.3%
times-frac99.9%
Applied egg-rr99.9%
clear-num98.0%
inv-pow98.0%
+-commutative98.0%
Applied egg-rr98.0%
unpow-198.0%
un-div-inv98.1%
+-commutative98.1%
div-inv98.1%
clear-num98.1%
Applied egg-rr98.1%
Taylor expanded in x around 0 63.6%
associate-/r*65.7%
+-commutative65.7%
Simplified65.7%
Final simplification62.7%
(FPCore (x y) :precision binary64 (if (<= x -1.45) (/ 1.0 x) (/ x y)))
double code(double x, double y) {
double tmp;
if (x <= -1.45) {
tmp = 1.0 / x;
} else {
tmp = x / y;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-1.45d0)) then
tmp = 1.0d0 / x
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -1.45) {
tmp = 1.0 / x;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -1.45: tmp = 1.0 / x else: tmp = x / y return tmp
function code(x, y) tmp = 0.0 if (x <= -1.45) tmp = Float64(1.0 / x); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -1.45) tmp = 1.0 / x; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -1.45], N[(1.0 / x), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.45:\\
\;\;\;\;\frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if x < -1.44999999999999996Initial program 61.8%
associate-+r+61.8%
*-commutative61.8%
frac-times92.3%
associate-*l/92.3%
times-frac99.8%
Applied egg-rr99.8%
Taylor expanded in x around inf 78.3%
Taylor expanded in y around inf 5.7%
if -1.44999999999999996 < x Initial program 71.1%
times-frac88.3%
associate-+l+88.3%
Simplified88.3%
Taylor expanded in x around 0 55.5%
+-commutative55.5%
Simplified55.5%
Taylor expanded in y around 0 32.4%
Final simplification25.3%
(FPCore (x y) :precision binary64 (if (<= x -5.8e-155) (/ y x) (/ x y)))
double code(double x, double y) {
double tmp;
if (x <= -5.8e-155) {
tmp = y / x;
} else {
tmp = x / y;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-5.8d-155)) then
tmp = y / x
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -5.8e-155) {
tmp = y / x;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -5.8e-155: tmp = y / x else: tmp = x / y return tmp
function code(x, y) tmp = 0.0 if (x <= -5.8e-155) tmp = Float64(y / x); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -5.8e-155) tmp = y / x; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -5.8e-155], N[(y / x), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.8 \cdot 10^{-155}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if x < -5.80000000000000021e-155Initial program 69.6%
associate-+r+69.6%
*-commutative69.6%
frac-times94.7%
associate-*l/91.8%
times-frac99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 65.2%
*-commutative65.2%
distribute-lft-in65.2%
*-rgt-identity65.2%
Simplified65.2%
Taylor expanded in x around 0 29.6%
if -5.80000000000000021e-155 < x Initial program 68.0%
times-frac85.9%
associate-+l+85.9%
Simplified85.9%
Taylor expanded in x around 0 53.4%
+-commutative53.4%
Simplified53.4%
Taylor expanded in y around 0 34.6%
Final simplification32.6%
(FPCore (x y) :precision binary64 (/ 1.0 x))
double code(double x, double y) {
return 1.0 / x;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 / x
end function
public static double code(double x, double y) {
return 1.0 / x;
}
def code(x, y): return 1.0 / x
function code(x, y) return Float64(1.0 / x) end
function tmp = code(x, y) tmp = 1.0 / x; end
code[x_, y_] := N[(1.0 / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{x}
\end{array}
Initial program 68.6%
associate-+r+68.6%
*-commutative68.6%
frac-times89.4%
associate-*l/82.9%
times-frac99.9%
Applied egg-rr99.9%
Taylor expanded in x around inf 41.3%
Taylor expanded in y around inf 4.2%
Final simplification4.2%
(FPCore (x y) :precision binary64 (/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x)))))
double code(double x, double y) {
return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((x / ((y + 1.0d0) + x)) / (y + x)) / (1.0d0 / (y / (y + x)))
end function
public static double code(double x, double y) {
return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)));
}
def code(x, y): return ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x)))
function code(x, y) return Float64(Float64(Float64(x / Float64(Float64(y + 1.0) + x)) / Float64(y + x)) / Float64(1.0 / Float64(y / Float64(y + x)))) end
function tmp = code(x, y) tmp = ((x / ((y + 1.0) + x)) / (y + x)) / (1.0 / (y / (y + x))); end
code[x_, y_] := N[(N[(N[(x / N[(N[(y + 1.0), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(1.0 / N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{\frac{x}{\left(y + 1\right) + x}}{y + x}}{\frac{1}{\frac{y}{y + x}}}
\end{array}
herbie shell --seed 2023279
(FPCore (x y)
:name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, A"
:precision binary64
:herbie-target
(/ (/ (/ x (+ (+ y 1.0) x)) (+ y x)) (/ 1.0 (/ y (+ y x))))
(/ (* x y) (* (* (+ x y) (+ x y)) (+ (+ x y) 1.0))))