
(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 1.0))) (/ x (+ y x))) (+ y x)))
double code(double x, double y) {
return ((y / (y + (x + 1.0))) * (x / (y + x))) / (y + x);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((y / (y + (x + 1.0d0))) * (x / (y + x))) / (y + x)
end function
public static double code(double x, double y) {
return ((y / (y + (x + 1.0))) * (x / (y + x))) / (y + x);
}
def code(x, y): return ((y / (y + (x + 1.0))) * (x / (y + x))) / (y + x)
function code(x, y) return Float64(Float64(Float64(y / Float64(y + Float64(x + 1.0))) * Float64(x / Float64(y + x))) / Float64(y + x)) end
function tmp = code(x, y) tmp = ((y / (y + (x + 1.0))) * (x / (y + x))) / (y + x); end
code[x_, y_] := N[(N[(N[(y / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{y}{y + \left(x + 1\right)} \cdot \frac{x}{y + x}}{y + x}
\end{array}
Initial program 65.7%
associate-*r/79.2%
*-commutative79.2%
distribute-rgt1-in53.2%
fma-def79.2%
cube-unmult79.3%
Simplified79.3%
associate-*r/65.7%
fma-udef46.9%
cube-mult46.8%
distribute-rgt1-in65.7%
associate-+r+65.7%
*-commutative65.7%
frac-times87.0%
*-commutative87.0%
associate-/r*99.8%
associate-*r/99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (* (+ y x) (+ 1.0 (+ y x))))))
(if (<= x -3.3e-63)
t_0
(if (<= x -3.8e-76)
(/ x (* y y))
(if (<= x -2.4e-236) t_0 (/ (/ x (+ y x)) (+ y (+ x (- x -1.0)))))))))
double code(double x, double y) {
double t_0 = y / ((y + x) * (1.0 + (y + x)));
double tmp;
if (x <= -3.3e-63) {
tmp = t_0;
} else if (x <= -3.8e-76) {
tmp = x / (y * y);
} else if (x <= -2.4e-236) {
tmp = t_0;
} else {
tmp = (x / (y + x)) / (y + (x + (x - -1.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 = y / ((y + x) * (1.0d0 + (y + x)))
if (x <= (-3.3d-63)) then
tmp = t_0
else if (x <= (-3.8d-76)) then
tmp = x / (y * y)
else if (x <= (-2.4d-236)) then
tmp = t_0
else
tmp = (x / (y + x)) / (y + (x + (x - (-1.0d0))))
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y / ((y + x) * (1.0 + (y + x)));
double tmp;
if (x <= -3.3e-63) {
tmp = t_0;
} else if (x <= -3.8e-76) {
tmp = x / (y * y);
} else if (x <= -2.4e-236) {
tmp = t_0;
} else {
tmp = (x / (y + x)) / (y + (x + (x - -1.0)));
}
return tmp;
}
def code(x, y): t_0 = y / ((y + x) * (1.0 + (y + x))) tmp = 0 if x <= -3.3e-63: tmp = t_0 elif x <= -3.8e-76: tmp = x / (y * y) elif x <= -2.4e-236: tmp = t_0 else: tmp = (x / (y + x)) / (y + (x + (x - -1.0))) return tmp
function code(x, y) t_0 = Float64(y / Float64(Float64(y + x) * Float64(1.0 + Float64(y + x)))) tmp = 0.0 if (x <= -3.3e-63) tmp = t_0; elseif (x <= -3.8e-76) tmp = Float64(x / Float64(y * y)); elseif (x <= -2.4e-236) tmp = t_0; else tmp = Float64(Float64(x / Float64(y + x)) / Float64(y + Float64(x + Float64(x - -1.0)))); end return tmp end
function tmp_2 = code(x, y) t_0 = y / ((y + x) * (1.0 + (y + x))); tmp = 0.0; if (x <= -3.3e-63) tmp = t_0; elseif (x <= -3.8e-76) tmp = x / (y * y); elseif (x <= -2.4e-236) tmp = t_0; else tmp = (x / (y + x)) / (y + (x + (x - -1.0))); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y / N[(N[(y + x), $MachinePrecision] * N[(1.0 + N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.3e-63], t$95$0, If[LessEqual[x, -3.8e-76], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.4e-236], t$95$0, N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(y + N[(x + N[(x - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y}{\left(y + x\right) \cdot \left(1 + \left(y + x\right)\right)}\\
\mathbf{if}\;x \leq -3.3 \cdot 10^{-63}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -3.8 \cdot 10^{-76}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\mathbf{elif}\;x \leq -2.4 \cdot 10^{-236}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{y + \left(x + \left(x - -1\right)\right)}\\
\end{array}
\end{array}
if x < -3.29999999999999994e-63 or -3.8000000000000002e-76 < x < -2.4000000000000002e-236Initial program 66.5%
associate-*r/82.8%
*-commutative82.8%
distribute-rgt1-in39.3%
fma-def82.8%
cube-unmult82.9%
Simplified82.9%
associate-*r/66.5%
fma-udef38.2%
cube-mult38.2%
distribute-rgt1-in66.5%
associate-+r+66.5%
*-commutative66.5%
frac-times90.7%
*-commutative90.7%
clear-num90.6%
associate-/r*99.8%
frac-times99.1%
*-un-lft-identity99.1%
+-commutative99.1%
+-commutative99.1%
associate-+l+99.1%
+-commutative99.1%
Applied egg-rr99.1%
Taylor expanded in x around inf 63.2%
expm1-log1p-u63.2%
expm1-udef61.3%
metadata-eval61.3%
frac-times61.3%
clear-num61.3%
div-inv61.3%
+-commutative61.3%
Applied egg-rr61.3%
expm1-def64.0%
expm1-log1p64.0%
associate-/l/82.7%
associate-+r+82.7%
Simplified82.7%
if -3.29999999999999994e-63 < x < -3.8000000000000002e-76Initial program 99.4%
associate-*r/99.8%
*-commutative99.8%
distribute-rgt1-in99.8%
fma-def99.8%
cube-unmult99.8%
Simplified99.8%
Taylor expanded in y around inf 87.7%
unpow287.7%
Simplified87.7%
if -2.4000000000000002e-236 < x Initial program 63.0%
associate-*r/74.9%
*-commutative74.9%
distribute-rgt1-in62.2%
fma-def75.0%
cube-unmult75.0%
Simplified75.0%
associate-*r/63.0%
fma-udef51.1%
cube-mult51.1%
distribute-rgt1-in63.0%
associate-+r+63.0%
*-commutative63.0%
frac-times83.1%
*-commutative83.1%
clear-num83.1%
associate-/r*99.7%
frac-times99.8%
*-un-lft-identity99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in y around -inf 56.4%
mul-1-neg56.4%
unsub-neg56.4%
neg-mul-156.4%
unsub-neg56.4%
distribute-lft-in56.4%
metadata-eval56.4%
neg-mul-156.4%
unsub-neg56.4%
Simplified56.4%
Final simplification69.1%
(FPCore (x y) :precision binary64 (if (<= x -6.4e-21) (* (/ x (* (+ y x) (+ y x))) (/ y (+ x (+ y 1.0)))) (/ (/ x (+ y x)) (* (+ y x) (/ (+ y 1.0) y)))))
double code(double x, double y) {
double tmp;
if (x <= -6.4e-21) {
tmp = (x / ((y + x) * (y + x))) * (y / (x + (y + 1.0)));
} else {
tmp = (x / (y + x)) / ((y + 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 <= (-6.4d-21)) then
tmp = (x / ((y + x) * (y + x))) * (y / (x + (y + 1.0d0)))
else
tmp = (x / (y + x)) / ((y + x) * ((y + 1.0d0) / y))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -6.4e-21) {
tmp = (x / ((y + x) * (y + x))) * (y / (x + (y + 1.0)));
} else {
tmp = (x / (y + x)) / ((y + x) * ((y + 1.0) / y));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -6.4e-21: tmp = (x / ((y + x) * (y + x))) * (y / (x + (y + 1.0))) else: tmp = (x / (y + x)) / ((y + x) * ((y + 1.0) / y)) return tmp
function code(x, y) tmp = 0.0 if (x <= -6.4e-21) tmp = Float64(Float64(x / Float64(Float64(y + x) * Float64(y + x))) * Float64(y / Float64(x + Float64(y + 1.0)))); else tmp = Float64(Float64(x / Float64(y + x)) / Float64(Float64(y + x) * Float64(Float64(y + 1.0) / y))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -6.4e-21) tmp = (x / ((y + x) * (y + x))) * (y / (x + (y + 1.0))); else tmp = (x / (y + x)) / ((y + x) * ((y + 1.0) / y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -6.4e-21], N[(N[(x / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y / N[(x + N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] * N[(N[(y + 1.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.4 \cdot 10^{-21}:\\
\;\;\;\;\frac{x}{\left(y + x\right) \cdot \left(y + x\right)} \cdot \frac{y}{x + \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{\left(y + x\right) \cdot \frac{y + 1}{y}}\\
\end{array}
\end{array}
if x < -6.4000000000000003e-21Initial program 58.2%
times-frac91.4%
/-rgt-identity91.4%
associate-/l/91.4%
*-lft-identity91.4%
associate-+l+91.4%
Simplified91.4%
if -6.4000000000000003e-21 < x Initial program 68.9%
associate-*r/79.0%
*-commutative79.0%
distribute-rgt1-in65.5%
fma-def79.0%
cube-unmult79.0%
Simplified79.0%
associate-*r/68.9%
fma-udef56.1%
cube-mult56.1%
distribute-rgt1-in68.9%
associate-+r+68.9%
*-commutative68.9%
frac-times85.1%
*-commutative85.1%
clear-num85.1%
associate-/r*99.6%
frac-times99.8%
*-un-lft-identity99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 84.4%
+-commutative84.4%
Simplified84.4%
Final simplification86.5%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ x (* y (+ y 1.0)))))
(if (<= x -1.0)
(/ y (* x x))
(if (<= x -2.5e-32)
(- (/ y x) y)
(if (<= x -8.5e-77)
t_0
(if (<= x -1.6e-105)
(/ y x)
(if (<= x 1.05e+18) t_0 (* (/ 1.0 y) (/ x y)))))))))
double code(double x, double y) {
double t_0 = x / (y * (y + 1.0));
double tmp;
if (x <= -1.0) {
tmp = y / (x * x);
} else if (x <= -2.5e-32) {
tmp = (y / x) - y;
} else if (x <= -8.5e-77) {
tmp = t_0;
} else if (x <= -1.6e-105) {
tmp = y / x;
} else if (x <= 1.05e+18) {
tmp = t_0;
} else {
tmp = (1.0 / y) * (x / 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 * (y + 1.0d0))
if (x <= (-1.0d0)) then
tmp = y / (x * x)
else if (x <= (-2.5d-32)) then
tmp = (y / x) - y
else if (x <= (-8.5d-77)) then
tmp = t_0
else if (x <= (-1.6d-105)) then
tmp = y / x
else if (x <= 1.05d+18) then
tmp = t_0
else
tmp = (1.0d0 / y) * (x / y)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x / (y * (y + 1.0));
double tmp;
if (x <= -1.0) {
tmp = y / (x * x);
} else if (x <= -2.5e-32) {
tmp = (y / x) - y;
} else if (x <= -8.5e-77) {
tmp = t_0;
} else if (x <= -1.6e-105) {
tmp = y / x;
} else if (x <= 1.05e+18) {
tmp = t_0;
} else {
tmp = (1.0 / y) * (x / y);
}
return tmp;
}
def code(x, y): t_0 = x / (y * (y + 1.0)) tmp = 0 if x <= -1.0: tmp = y / (x * x) elif x <= -2.5e-32: tmp = (y / x) - y elif x <= -8.5e-77: tmp = t_0 elif x <= -1.6e-105: tmp = y / x elif x <= 1.05e+18: tmp = t_0 else: tmp = (1.0 / y) * (x / y) return tmp
function code(x, y) t_0 = Float64(x / Float64(y * Float64(y + 1.0))) tmp = 0.0 if (x <= -1.0) tmp = Float64(y / Float64(x * x)); elseif (x <= -2.5e-32) tmp = Float64(Float64(y / x) - y); elseif (x <= -8.5e-77) tmp = t_0; elseif (x <= -1.6e-105) tmp = Float64(y / x); elseif (x <= 1.05e+18) tmp = t_0; else tmp = Float64(Float64(1.0 / y) * Float64(x / y)); end return tmp end
function tmp_2 = code(x, y) t_0 = x / (y * (y + 1.0)); tmp = 0.0; if (x <= -1.0) tmp = y / (x * x); elseif (x <= -2.5e-32) tmp = (y / x) - y; elseif (x <= -8.5e-77) tmp = t_0; elseif (x <= -1.6e-105) tmp = y / x; elseif (x <= 1.05e+18) tmp = t_0; else tmp = (1.0 / y) * (x / y); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.0], N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.5e-32], N[(N[(y / x), $MachinePrecision] - y), $MachinePrecision], If[LessEqual[x, -8.5e-77], t$95$0, If[LessEqual[x, -1.6e-105], N[(y / x), $MachinePrecision], If[LessEqual[x, 1.05e+18], t$95$0, N[(N[(1.0 / y), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{y}{x \cdot x}\\
\mathbf{elif}\;x \leq -2.5 \cdot 10^{-32}:\\
\;\;\;\;\frac{y}{x} - y\\
\mathbf{elif}\;x \leq -8.5 \cdot 10^{-77}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -1.6 \cdot 10^{-105}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{+18}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{y} \cdot \frac{x}{y}\\
\end{array}
\end{array}
if x < -1Initial program 56.6%
associate-*r/79.0%
*-commutative79.0%
distribute-rgt1-in21.4%
fma-def79.0%
cube-unmult79.0%
Simplified79.0%
Taylor expanded in x around inf 77.8%
unpow277.8%
Simplified77.8%
if -1 < x < -2.5e-32Initial program 99.1%
times-frac99.1%
/-rgt-identity99.1%
associate-/l/99.1%
*-lft-identity99.1%
associate-+l+99.1%
Simplified99.1%
Taylor expanded in y around 0 99.7%
Taylor expanded in x around 0 90.9%
neg-mul-190.9%
unsub-neg90.9%
Simplified90.9%
if -2.5e-32 < x < -8.4999999999999998e-77 or -1.59999999999999991e-105 < x < 1.05e18Initial program 76.3%
times-frac87.2%
/-rgt-identity87.2%
associate-/l/87.2%
*-lft-identity87.2%
associate-+l+87.2%
Simplified87.2%
Taylor expanded in x around 0 80.0%
+-commutative80.0%
Simplified80.0%
if -8.4999999999999998e-77 < x < -1.59999999999999991e-105Initial program 88.0%
times-frac100.0%
/-rgt-identity100.0%
associate-/l/100.0%
*-lft-identity100.0%
associate-+l+100.0%
Simplified100.0%
Taylor expanded in y around 0 51.8%
Taylor expanded in x around 0 51.8%
if 1.05e18 < x Initial program 50.8%
associate-*r/63.9%
*-commutative63.9%
distribute-rgt1-in62.0%
fma-def63.9%
cube-unmult63.9%
Simplified63.9%
Taylor expanded in y around inf 17.8%
unpow217.8%
Simplified17.8%
associate-/r*20.2%
div-inv20.2%
Applied egg-rr20.2%
Final simplification65.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (* (+ y x) (+ 1.0 (+ y x))))))
(if (<= x -1e-58)
t_0
(if (<= x -2.15e-75)
(/ x (* y y))
(if (<= x -2.4e-236)
t_0
(if (<= x 2.05e+17)
(/ x (* y (+ y 1.0)))
(* (/ x (+ y x)) (/ 1.0 y))))))))
double code(double x, double y) {
double t_0 = y / ((y + x) * (1.0 + (y + x)));
double tmp;
if (x <= -1e-58) {
tmp = t_0;
} else if (x <= -2.15e-75) {
tmp = x / (y * y);
} else if (x <= -2.4e-236) {
tmp = t_0;
} else if (x <= 2.05e+17) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / (y + x)) * (1.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 = y / ((y + x) * (1.0d0 + (y + x)))
if (x <= (-1d-58)) then
tmp = t_0
else if (x <= (-2.15d-75)) then
tmp = x / (y * y)
else if (x <= (-2.4d-236)) then
tmp = t_0
else if (x <= 2.05d+17) then
tmp = x / (y * (y + 1.0d0))
else
tmp = (x / (y + x)) * (1.0d0 / y)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y / ((y + x) * (1.0 + (y + x)));
double tmp;
if (x <= -1e-58) {
tmp = t_0;
} else if (x <= -2.15e-75) {
tmp = x / (y * y);
} else if (x <= -2.4e-236) {
tmp = t_0;
} else if (x <= 2.05e+17) {
tmp = x / (y * (y + 1.0));
} else {
tmp = (x / (y + x)) * (1.0 / y);
}
return tmp;
}
def code(x, y): t_0 = y / ((y + x) * (1.0 + (y + x))) tmp = 0 if x <= -1e-58: tmp = t_0 elif x <= -2.15e-75: tmp = x / (y * y) elif x <= -2.4e-236: tmp = t_0 elif x <= 2.05e+17: tmp = x / (y * (y + 1.0)) else: tmp = (x / (y + x)) * (1.0 / y) return tmp
function code(x, y) t_0 = Float64(y / Float64(Float64(y + x) * Float64(1.0 + Float64(y + x)))) tmp = 0.0 if (x <= -1e-58) tmp = t_0; elseif (x <= -2.15e-75) tmp = Float64(x / Float64(y * y)); elseif (x <= -2.4e-236) tmp = t_0; elseif (x <= 2.05e+17) tmp = Float64(x / Float64(y * Float64(y + 1.0))); else tmp = Float64(Float64(x / Float64(y + x)) * Float64(1.0 / y)); end return tmp end
function tmp_2 = code(x, y) t_0 = y / ((y + x) * (1.0 + (y + x))); tmp = 0.0; if (x <= -1e-58) tmp = t_0; elseif (x <= -2.15e-75) tmp = x / (y * y); elseif (x <= -2.4e-236) tmp = t_0; elseif (x <= 2.05e+17) tmp = x / (y * (y + 1.0)); else tmp = (x / (y + x)) * (1.0 / y); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y / N[(N[(y + x), $MachinePrecision] * N[(1.0 + N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1e-58], t$95$0, If[LessEqual[x, -2.15e-75], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.4e-236], t$95$0, If[LessEqual[x, 2.05e+17], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y}{\left(y + x\right) \cdot \left(1 + \left(y + x\right)\right)}\\
\mathbf{if}\;x \leq -1 \cdot 10^{-58}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -2.15 \cdot 10^{-75}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\mathbf{elif}\;x \leq -2.4 \cdot 10^{-236}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 2.05 \cdot 10^{+17}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y + x} \cdot \frac{1}{y}\\
\end{array}
\end{array}
if x < -1e-58 or -2.15e-75 < x < -2.4000000000000002e-236Initial program 66.5%
associate-*r/82.8%
*-commutative82.8%
distribute-rgt1-in39.3%
fma-def82.8%
cube-unmult82.9%
Simplified82.9%
associate-*r/66.5%
fma-udef38.2%
cube-mult38.2%
distribute-rgt1-in66.5%
associate-+r+66.5%
*-commutative66.5%
frac-times90.7%
*-commutative90.7%
clear-num90.6%
associate-/r*99.8%
frac-times99.1%
*-un-lft-identity99.1%
+-commutative99.1%
+-commutative99.1%
associate-+l+99.1%
+-commutative99.1%
Applied egg-rr99.1%
Taylor expanded in x around inf 63.2%
expm1-log1p-u63.2%
expm1-udef61.3%
metadata-eval61.3%
frac-times61.3%
clear-num61.3%
div-inv61.3%
+-commutative61.3%
Applied egg-rr61.3%
expm1-def64.0%
expm1-log1p64.0%
associate-/l/82.7%
associate-+r+82.7%
Simplified82.7%
if -1e-58 < x < -2.15e-75Initial program 99.4%
associate-*r/99.8%
*-commutative99.8%
distribute-rgt1-in99.8%
fma-def99.8%
cube-unmult99.8%
Simplified99.8%
Taylor expanded in y around inf 87.7%
unpow287.7%
Simplified87.7%
if -2.4000000000000002e-236 < x < 2.05e17Initial program 72.1%
times-frac86.5%
/-rgt-identity86.5%
associate-/l/86.5%
*-lft-identity86.5%
associate-+l+86.5%
Simplified86.5%
Taylor expanded in x around 0 80.1%
+-commutative80.1%
Simplified80.1%
if 2.05e17 < x Initial program 50.8%
associate-*r/63.9%
*-commutative63.9%
distribute-rgt1-in62.0%
fma-def63.9%
cube-unmult63.9%
Simplified63.9%
associate-*r/50.8%
fma-udef50.8%
cube-mult50.8%
distribute-rgt1-in50.8%
associate-+r+50.8%
*-commutative50.8%
frac-times78.6%
*-commutative78.6%
clear-num78.6%
associate-/r*99.6%
frac-times99.7%
*-un-lft-identity99.7%
+-commutative99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 21.2%
div-inv21.3%
Applied egg-rr21.3%
Final simplification68.4%
(FPCore (x y) :precision binary64 (if (<= x -7.2e-25) (/ (/ y (+ x 1.0)) (+ y x)) (/ (/ x (+ y x)) (* (+ y x) (/ (+ y 1.0) y)))))
double code(double x, double y) {
double tmp;
if (x <= -7.2e-25) {
tmp = (y / (x + 1.0)) / (y + x);
} else {
tmp = (x / (y + x)) / ((y + 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 <= (-7.2d-25)) then
tmp = (y / (x + 1.0d0)) / (y + x)
else
tmp = (x / (y + x)) / ((y + x) * ((y + 1.0d0) / y))
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= -7.2e-25) {
tmp = (y / (x + 1.0)) / (y + x);
} else {
tmp = (x / (y + x)) / ((y + x) * ((y + 1.0) / y));
}
return tmp;
}
def code(x, y): tmp = 0 if x <= -7.2e-25: tmp = (y / (x + 1.0)) / (y + x) else: tmp = (x / (y + x)) / ((y + x) * ((y + 1.0) / y)) return tmp
function code(x, y) tmp = 0.0 if (x <= -7.2e-25) tmp = Float64(Float64(y / Float64(x + 1.0)) / Float64(y + x)); else tmp = Float64(Float64(x / Float64(y + x)) / Float64(Float64(y + x) * Float64(Float64(y + 1.0) / y))); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= -7.2e-25) tmp = (y / (x + 1.0)) / (y + x); else tmp = (x / (y + x)) / ((y + x) * ((y + 1.0) / y)); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, -7.2e-25], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] * N[(N[(y + 1.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.2 \cdot 10^{-25}:\\
\;\;\;\;\frac{\frac{y}{x + 1}}{y + x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{\left(y + x\right) \cdot \frac{y + 1}{y}}\\
\end{array}
\end{array}
if x < -7.1999999999999998e-25Initial program 58.2%
associate-*r/79.8%
*-commutative79.8%
distribute-rgt1-in24.4%
fma-def79.8%
cube-unmult79.8%
Simplified79.8%
associate-*r/58.3%
fma-udef25.4%
cube-mult25.4%
distribute-rgt1-in58.2%
associate-+r+58.2%
*-commutative58.2%
frac-times91.4%
*-commutative91.4%
associate-/r*99.9%
associate-*r/99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
+-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 76.6%
if -7.1999999999999998e-25 < x Initial program 68.9%
associate-*r/79.0%
*-commutative79.0%
distribute-rgt1-in65.5%
fma-def79.0%
cube-unmult79.0%
Simplified79.0%
associate-*r/68.9%
fma-udef56.1%
cube-mult56.1%
distribute-rgt1-in68.9%
associate-+r+68.9%
*-commutative68.9%
frac-times85.1%
*-commutative85.1%
clear-num85.1%
associate-/r*99.6%
frac-times99.8%
*-un-lft-identity99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 84.4%
+-commutative84.4%
Simplified84.4%
Final simplification82.1%
(FPCore (x y) :precision binary64 (* (/ x (+ y x)) (/ (/ y (+ y (+ x 1.0))) (+ y x))))
double code(double x, double y) {
return (x / (y + x)) * ((y / (y + (x + 1.0))) / (y + x));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x / (y + x)) * ((y / (y + (x + 1.0d0))) / (y + x))
end function
public static double code(double x, double y) {
return (x / (y + x)) * ((y / (y + (x + 1.0))) / (y + x));
}
def code(x, y): return (x / (y + x)) * ((y / (y + (x + 1.0))) / (y + x))
function code(x, y) return Float64(Float64(x / Float64(y + x)) * Float64(Float64(y / Float64(y + Float64(x + 1.0))) / Float64(y + x))) end
function tmp = code(x, y) tmp = (x / (y + x)) * ((y / (y + (x + 1.0))) / (y + x)); end
code[x_, y_] := N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] * N[(N[(y / N[(y + N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y + x} \cdot \frac{\frac{y}{y + \left(x + 1\right)}}{y + x}
\end{array}
Initial program 65.7%
times-frac87.0%
associate-+r+87.0%
associate-*l/83.0%
times-frac99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (* x (+ x 1.0)))))
(if (<= y -9.5e-7)
(/ (/ y x) (+ y x))
(if (<= y 5.2e-41)
t_0
(if (<= y 3.2e-21)
(/ x (* y (+ y 1.0)))
(if (<= y 30000000.0) t_0 (/ (/ x (+ y x)) y)))))))
double code(double x, double y) {
double t_0 = y / (x * (x + 1.0));
double tmp;
if (y <= -9.5e-7) {
tmp = (y / x) / (y + x);
} else if (y <= 5.2e-41) {
tmp = t_0;
} else if (y <= 3.2e-21) {
tmp = x / (y * (y + 1.0));
} else if (y <= 30000000.0) {
tmp = t_0;
} else {
tmp = (x / (y + x)) / 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 / (x * (x + 1.0d0))
if (y <= (-9.5d-7)) then
tmp = (y / x) / (y + x)
else if (y <= 5.2d-41) then
tmp = t_0
else if (y <= 3.2d-21) then
tmp = x / (y * (y + 1.0d0))
else if (y <= 30000000.0d0) then
tmp = t_0
else
tmp = (x / (y + x)) / y
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y / (x * (x + 1.0));
double tmp;
if (y <= -9.5e-7) {
tmp = (y / x) / (y + x);
} else if (y <= 5.2e-41) {
tmp = t_0;
} else if (y <= 3.2e-21) {
tmp = x / (y * (y + 1.0));
} else if (y <= 30000000.0) {
tmp = t_0;
} else {
tmp = (x / (y + x)) / y;
}
return tmp;
}
def code(x, y): t_0 = y / (x * (x + 1.0)) tmp = 0 if y <= -9.5e-7: tmp = (y / x) / (y + x) elif y <= 5.2e-41: tmp = t_0 elif y <= 3.2e-21: tmp = x / (y * (y + 1.0)) elif y <= 30000000.0: tmp = t_0 else: tmp = (x / (y + x)) / y return tmp
function code(x, y) t_0 = Float64(y / Float64(x * Float64(x + 1.0))) tmp = 0.0 if (y <= -9.5e-7) tmp = Float64(Float64(y / x) / Float64(y + x)); elseif (y <= 5.2e-41) tmp = t_0; elseif (y <= 3.2e-21) tmp = Float64(x / Float64(y * Float64(y + 1.0))); elseif (y <= 30000000.0) tmp = t_0; else tmp = Float64(Float64(x / Float64(y + x)) / y); end return tmp end
function tmp_2 = code(x, y) t_0 = y / (x * (x + 1.0)); tmp = 0.0; if (y <= -9.5e-7) tmp = (y / x) / (y + x); elseif (y <= 5.2e-41) tmp = t_0; elseif (y <= 3.2e-21) tmp = x / (y * (y + 1.0)); elseif (y <= 30000000.0) tmp = t_0; else tmp = (x / (y + x)) / y; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -9.5e-7], N[(N[(y / x), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.2e-41], t$95$0, If[LessEqual[y, 3.2e-21], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 30000000.0], t$95$0, N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{if}\;y \leq -9.5 \cdot 10^{-7}:\\
\;\;\;\;\frac{\frac{y}{x}}{y + x}\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{-41}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{-21}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{elif}\;y \leq 30000000:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{y}\\
\end{array}
\end{array}
if y < -9.5000000000000001e-7Initial program 54.0%
associate-*r/76.3%
*-commutative76.3%
distribute-rgt1-in21.5%
fma-def76.3%
cube-unmult76.4%
Simplified76.4%
associate-*r/54.0%
fma-udef18.5%
cube-mult18.5%
distribute-rgt1-in54.0%
associate-+r+54.0%
*-commutative54.0%
frac-times87.6%
*-commutative87.6%
associate-/r*99.9%
associate-*r/99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
+-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in x around inf 32.3%
if -9.5000000000000001e-7 < y < 5.1999999999999999e-41 or 3.2000000000000002e-21 < y < 3e7Initial program 77.9%
times-frac88.4%
/-rgt-identity88.4%
associate-/l/88.4%
*-lft-identity88.4%
associate-+l+88.4%
Simplified88.4%
Taylor expanded in y around 0 73.2%
if 5.1999999999999999e-41 < y < 3.2000000000000002e-21Initial program 99.5%
times-frac99.5%
/-rgt-identity99.5%
associate-/l/99.5%
*-lft-identity99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in x around 0 34.6%
+-commutative34.6%
Simplified34.6%
if 3e7 < y Initial program 52.0%
associate-*r/72.4%
*-commutative72.4%
distribute-rgt1-in63.1%
fma-def72.4%
cube-unmult72.4%
Simplified72.4%
associate-*r/52.0%
fma-udef50.2%
cube-mult50.1%
distribute-rgt1-in52.0%
associate-+r+52.0%
*-commutative52.0%
frac-times82.6%
*-commutative82.6%
clear-num82.5%
associate-/r*99.7%
frac-times99.7%
*-un-lft-identity99.7%
+-commutative99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 68.4%
Final simplification59.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (/ y (+ x 1.0)) (+ y x))))
(if (<= y 5.4e-41)
t_0
(if (<= y 2e-18)
(/ x (* y (+ y 1.0)))
(if (<= y 30000000.0) t_0 (/ (/ x (+ y x)) y))))))
double code(double x, double y) {
double t_0 = (y / (x + 1.0)) / (y + x);
double tmp;
if (y <= 5.4e-41) {
tmp = t_0;
} else if (y <= 2e-18) {
tmp = x / (y * (y + 1.0));
} else if (y <= 30000000.0) {
tmp = t_0;
} else {
tmp = (x / (y + x)) / 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 / (x + 1.0d0)) / (y + x)
if (y <= 5.4d-41) then
tmp = t_0
else if (y <= 2d-18) then
tmp = x / (y * (y + 1.0d0))
else if (y <= 30000000.0d0) then
tmp = t_0
else
tmp = (x / (y + x)) / y
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = (y / (x + 1.0)) / (y + x);
double tmp;
if (y <= 5.4e-41) {
tmp = t_0;
} else if (y <= 2e-18) {
tmp = x / (y * (y + 1.0));
} else if (y <= 30000000.0) {
tmp = t_0;
} else {
tmp = (x / (y + x)) / y;
}
return tmp;
}
def code(x, y): t_0 = (y / (x + 1.0)) / (y + x) tmp = 0 if y <= 5.4e-41: tmp = t_0 elif y <= 2e-18: tmp = x / (y * (y + 1.0)) elif y <= 30000000.0: tmp = t_0 else: tmp = (x / (y + x)) / y return tmp
function code(x, y) t_0 = Float64(Float64(y / Float64(x + 1.0)) / Float64(y + x)) tmp = 0.0 if (y <= 5.4e-41) tmp = t_0; elseif (y <= 2e-18) tmp = Float64(x / Float64(y * Float64(y + 1.0))); elseif (y <= 30000000.0) tmp = t_0; else tmp = Float64(Float64(x / Float64(y + x)) / y); end return tmp end
function tmp_2 = code(x, y) t_0 = (y / (x + 1.0)) / (y + x); tmp = 0.0; if (y <= 5.4e-41) tmp = t_0; elseif (y <= 2e-18) tmp = x / (y * (y + 1.0)); elseif (y <= 30000000.0) tmp = t_0; else tmp = (x / (y + x)) / y; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 5.4e-41], t$95$0, If[LessEqual[y, 2e-18], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 30000000.0], t$95$0, N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\frac{y}{x + 1}}{y + x}\\
\mathbf{if}\;y \leq 5.4 \cdot 10^{-41}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 2 \cdot 10^{-18}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{elif}\;y \leq 30000000:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{y}\\
\end{array}
\end{array}
if y < 5.4e-41 or 2.0000000000000001e-18 < y < 3e7Initial program 69.0%
associate-*r/80.8%
*-commutative80.8%
distribute-rgt1-in50.2%
fma-def80.8%
cube-unmult80.9%
Simplified80.9%
associate-*r/69.0%
fma-udef45.6%
cube-mult45.6%
distribute-rgt1-in69.0%
associate-+r+69.0%
*-commutative69.0%
frac-times88.1%
*-commutative88.1%
associate-/r*99.8%
associate-*r/99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
+-commutative99.9%
Applied egg-rr99.9%
Taylor expanded in y around 0 58.0%
if 5.4e-41 < y < 2.0000000000000001e-18Initial program 99.5%
times-frac99.5%
/-rgt-identity99.5%
associate-/l/99.5%
*-lft-identity99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in x around 0 34.6%
+-commutative34.6%
Simplified34.6%
if 3e7 < y Initial program 52.0%
associate-*r/72.4%
*-commutative72.4%
distribute-rgt1-in63.1%
fma-def72.4%
cube-unmult72.4%
Simplified72.4%
associate-*r/52.0%
fma-udef50.2%
cube-mult50.1%
distribute-rgt1-in52.0%
associate-+r+52.0%
*-commutative52.0%
frac-times82.6%
*-commutative82.6%
clear-num82.5%
associate-/r*99.7%
frac-times99.7%
*-un-lft-identity99.7%
+-commutative99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 68.4%
Final simplification60.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (* x (+ x 1.0)))))
(if (<= y 5e-41)
t_0
(if (<= y 1.55e-18)
(/ x (* y (+ y 1.0)))
(if (<= y 27000000.0) t_0 (/ (/ x y) y))))))
double code(double x, double y) {
double t_0 = y / (x * (x + 1.0));
double tmp;
if (y <= 5e-41) {
tmp = t_0;
} else if (y <= 1.55e-18) {
tmp = x / (y * (y + 1.0));
} else if (y <= 27000000.0) {
tmp = t_0;
} 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) :: t_0
real(8) :: tmp
t_0 = y / (x * (x + 1.0d0))
if (y <= 5d-41) then
tmp = t_0
else if (y <= 1.55d-18) then
tmp = x / (y * (y + 1.0d0))
else if (y <= 27000000.0d0) then
tmp = t_0
else
tmp = (x / y) / y
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y / (x * (x + 1.0));
double tmp;
if (y <= 5e-41) {
tmp = t_0;
} else if (y <= 1.55e-18) {
tmp = x / (y * (y + 1.0));
} else if (y <= 27000000.0) {
tmp = t_0;
} else {
tmp = (x / y) / y;
}
return tmp;
}
def code(x, y): t_0 = y / (x * (x + 1.0)) tmp = 0 if y <= 5e-41: tmp = t_0 elif y <= 1.55e-18: tmp = x / (y * (y + 1.0)) elif y <= 27000000.0: tmp = t_0 else: tmp = (x / y) / y return tmp
function code(x, y) t_0 = Float64(y / Float64(x * Float64(x + 1.0))) tmp = 0.0 if (y <= 5e-41) tmp = t_0; elseif (y <= 1.55e-18) tmp = Float64(x / Float64(y * Float64(y + 1.0))); elseif (y <= 27000000.0) tmp = t_0; else tmp = Float64(Float64(x / y) / y); end return tmp end
function tmp_2 = code(x, y) t_0 = y / (x * (x + 1.0)); tmp = 0.0; if (y <= 5e-41) tmp = t_0; elseif (y <= 1.55e-18) tmp = x / (y * (y + 1.0)); elseif (y <= 27000000.0) tmp = t_0; else tmp = (x / y) / y; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 5e-41], t$95$0, If[LessEqual[y, 1.55e-18], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 27000000.0], t$95$0, N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{if}\;y \leq 5 \cdot 10^{-41}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 1.55 \cdot 10^{-18}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{elif}\;y \leq 27000000:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if y < 4.9999999999999996e-41 or 1.55000000000000003e-18 < y < 2.7e7Initial program 69.0%
times-frac88.1%
/-rgt-identity88.1%
associate-/l/88.1%
*-lft-identity88.1%
associate-+l+88.1%
Simplified88.1%
Taylor expanded in y around 0 56.5%
if 4.9999999999999996e-41 < y < 1.55000000000000003e-18Initial program 99.5%
times-frac99.5%
/-rgt-identity99.5%
associate-/l/99.5%
*-lft-identity99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in x around 0 34.6%
+-commutative34.6%
Simplified34.6%
if 2.7e7 < y Initial program 52.0%
associate-*r/72.4%
*-commutative72.4%
distribute-rgt1-in63.1%
fma-def72.4%
cube-unmult72.4%
Simplified72.4%
Taylor expanded in y around inf 65.3%
unpow265.3%
Simplified65.3%
*-un-lft-identity65.3%
times-frac68.0%
Applied egg-rr68.0%
*-commutative68.0%
associate-*r/68.0%
*-rgt-identity68.0%
Simplified68.0%
Final simplification58.7%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (* x (+ x 1.0)))))
(if (<= y 5.4e-41)
t_0
(if (<= y 3.5e-22)
(/ x (* y (+ y 1.0)))
(if (<= y 30000000.0) t_0 (/ (/ x y) (+ y x)))))))
double code(double x, double y) {
double t_0 = y / (x * (x + 1.0));
double tmp;
if (y <= 5.4e-41) {
tmp = t_0;
} else if (y <= 3.5e-22) {
tmp = x / (y * (y + 1.0));
} else if (y <= 30000000.0) {
tmp = t_0;
} else {
tmp = (x / y) / (y + x);
}
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 / (x * (x + 1.0d0))
if (y <= 5.4d-41) then
tmp = t_0
else if (y <= 3.5d-22) then
tmp = x / (y * (y + 1.0d0))
else if (y <= 30000000.0d0) then
tmp = t_0
else
tmp = (x / y) / (y + x)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y / (x * (x + 1.0));
double tmp;
if (y <= 5.4e-41) {
tmp = t_0;
} else if (y <= 3.5e-22) {
tmp = x / (y * (y + 1.0));
} else if (y <= 30000000.0) {
tmp = t_0;
} else {
tmp = (x / y) / (y + x);
}
return tmp;
}
def code(x, y): t_0 = y / (x * (x + 1.0)) tmp = 0 if y <= 5.4e-41: tmp = t_0 elif y <= 3.5e-22: tmp = x / (y * (y + 1.0)) elif y <= 30000000.0: tmp = t_0 else: tmp = (x / y) / (y + x) return tmp
function code(x, y) t_0 = Float64(y / Float64(x * Float64(x + 1.0))) tmp = 0.0 if (y <= 5.4e-41) tmp = t_0; elseif (y <= 3.5e-22) tmp = Float64(x / Float64(y * Float64(y + 1.0))); elseif (y <= 30000000.0) tmp = t_0; else tmp = Float64(Float64(x / y) / Float64(y + x)); end return tmp end
function tmp_2 = code(x, y) t_0 = y / (x * (x + 1.0)); tmp = 0.0; if (y <= 5.4e-41) tmp = t_0; elseif (y <= 3.5e-22) tmp = x / (y * (y + 1.0)); elseif (y <= 30000000.0) tmp = t_0; else tmp = (x / y) / (y + x); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 5.4e-41], t$95$0, If[LessEqual[y, 3.5e-22], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 30000000.0], t$95$0, N[(N[(x / y), $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{if}\;y \leq 5.4 \cdot 10^{-41}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{-22}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{elif}\;y \leq 30000000:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y + x}\\
\end{array}
\end{array}
if y < 5.4e-41 or 3.50000000000000005e-22 < y < 3e7Initial program 69.0%
times-frac88.1%
/-rgt-identity88.1%
associate-/l/88.1%
*-lft-identity88.1%
associate-+l+88.1%
Simplified88.1%
Taylor expanded in y around 0 56.5%
if 5.4e-41 < y < 3.50000000000000005e-22Initial program 99.5%
times-frac99.5%
/-rgt-identity99.5%
associate-/l/99.5%
*-lft-identity99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in x around 0 34.6%
+-commutative34.6%
Simplified34.6%
if 3e7 < y Initial program 52.0%
associate-*r/72.4%
*-commutative72.4%
distribute-rgt1-in63.1%
fma-def72.4%
cube-unmult72.4%
Simplified72.4%
associate-*r/52.0%
fma-udef50.2%
cube-mult50.1%
distribute-rgt1-in52.0%
associate-+r+52.0%
*-commutative52.0%
frac-times82.6%
*-commutative82.6%
associate-/r*99.7%
associate-*r/99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
+-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 68.4%
Final simplification58.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (* x (+ x 1.0)))))
(if (<= y 5.2e-41)
t_0
(if (<= y 3.7e-19)
(/ x (* y (+ y 1.0)))
(if (<= y 22000000.0) t_0 (/ (/ x (+ y x)) y))))))
double code(double x, double y) {
double t_0 = y / (x * (x + 1.0));
double tmp;
if (y <= 5.2e-41) {
tmp = t_0;
} else if (y <= 3.7e-19) {
tmp = x / (y * (y + 1.0));
} else if (y <= 22000000.0) {
tmp = t_0;
} else {
tmp = (x / (y + x)) / 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 / (x * (x + 1.0d0))
if (y <= 5.2d-41) then
tmp = t_0
else if (y <= 3.7d-19) then
tmp = x / (y * (y + 1.0d0))
else if (y <= 22000000.0d0) then
tmp = t_0
else
tmp = (x / (y + x)) / y
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y / (x * (x + 1.0));
double tmp;
if (y <= 5.2e-41) {
tmp = t_0;
} else if (y <= 3.7e-19) {
tmp = x / (y * (y + 1.0));
} else if (y <= 22000000.0) {
tmp = t_0;
} else {
tmp = (x / (y + x)) / y;
}
return tmp;
}
def code(x, y): t_0 = y / (x * (x + 1.0)) tmp = 0 if y <= 5.2e-41: tmp = t_0 elif y <= 3.7e-19: tmp = x / (y * (y + 1.0)) elif y <= 22000000.0: tmp = t_0 else: tmp = (x / (y + x)) / y return tmp
function code(x, y) t_0 = Float64(y / Float64(x * Float64(x + 1.0))) tmp = 0.0 if (y <= 5.2e-41) tmp = t_0; elseif (y <= 3.7e-19) tmp = Float64(x / Float64(y * Float64(y + 1.0))); elseif (y <= 22000000.0) tmp = t_0; else tmp = Float64(Float64(x / Float64(y + x)) / y); end return tmp end
function tmp_2 = code(x, y) t_0 = y / (x * (x + 1.0)); tmp = 0.0; if (y <= 5.2e-41) tmp = t_0; elseif (y <= 3.7e-19) tmp = x / (y * (y + 1.0)); elseif (y <= 22000000.0) tmp = t_0; else tmp = (x / (y + x)) / y; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 5.2e-41], t$95$0, If[LessEqual[y, 3.7e-19], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 22000000.0], t$95$0, N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{if}\;y \leq 5.2 \cdot 10^{-41}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 3.7 \cdot 10^{-19}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{elif}\;y \leq 22000000:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{y}\\
\end{array}
\end{array}
if y < 5.1999999999999999e-41 or 3.70000000000000005e-19 < y < 2.2e7Initial program 69.0%
times-frac88.1%
/-rgt-identity88.1%
associate-/l/88.1%
*-lft-identity88.1%
associate-+l+88.1%
Simplified88.1%
Taylor expanded in y around 0 56.5%
if 5.1999999999999999e-41 < y < 3.70000000000000005e-19Initial program 99.5%
times-frac99.5%
/-rgt-identity99.5%
associate-/l/99.5%
*-lft-identity99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in x around 0 34.6%
+-commutative34.6%
Simplified34.6%
if 2.2e7 < y Initial program 52.0%
associate-*r/72.4%
*-commutative72.4%
distribute-rgt1-in63.1%
fma-def72.4%
cube-unmult72.4%
Simplified72.4%
associate-*r/52.0%
fma-udef50.2%
cube-mult50.1%
distribute-rgt1-in52.0%
associate-+r+52.0%
*-commutative52.0%
frac-times82.6%
*-commutative82.6%
clear-num82.5%
associate-/r*99.7%
frac-times99.7%
*-un-lft-identity99.7%
+-commutative99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 68.4%
Final simplification58.8%
(FPCore (x y)
:precision binary64
(if (<= y 5.4e-41)
(* (/ y (+ x 1.0)) (/ 1.0 x))
(if (<= y 3e-20)
(/ x (* y (+ y 1.0)))
(if (<= y 30000000.0) (/ y (* x (+ x 1.0))) (/ (/ x (+ y x)) y)))))
double code(double x, double y) {
double tmp;
if (y <= 5.4e-41) {
tmp = (y / (x + 1.0)) * (1.0 / x);
} else if (y <= 3e-20) {
tmp = x / (y * (y + 1.0));
} else if (y <= 30000000.0) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / (y + x)) / y;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= 5.4d-41) then
tmp = (y / (x + 1.0d0)) * (1.0d0 / x)
else if (y <= 3d-20) then
tmp = x / (y * (y + 1.0d0))
else if (y <= 30000000.0d0) then
tmp = y / (x * (x + 1.0d0))
else
tmp = (x / (y + x)) / y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= 5.4e-41) {
tmp = (y / (x + 1.0)) * (1.0 / x);
} else if (y <= 3e-20) {
tmp = x / (y * (y + 1.0));
} else if (y <= 30000000.0) {
tmp = y / (x * (x + 1.0));
} else {
tmp = (x / (y + x)) / y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= 5.4e-41: tmp = (y / (x + 1.0)) * (1.0 / x) elif y <= 3e-20: tmp = x / (y * (y + 1.0)) elif y <= 30000000.0: tmp = y / (x * (x + 1.0)) else: tmp = (x / (y + x)) / y return tmp
function code(x, y) tmp = 0.0 if (y <= 5.4e-41) tmp = Float64(Float64(y / Float64(x + 1.0)) * Float64(1.0 / x)); elseif (y <= 3e-20) tmp = Float64(x / Float64(y * Float64(y + 1.0))); elseif (y <= 30000000.0) tmp = Float64(y / Float64(x * Float64(x + 1.0))); else tmp = Float64(Float64(x / Float64(y + x)) / y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= 5.4e-41) tmp = (y / (x + 1.0)) * (1.0 / x); elseif (y <= 3e-20) tmp = x / (y * (y + 1.0)); elseif (y <= 30000000.0) tmp = y / (x * (x + 1.0)); else tmp = (x / (y + x)) / y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, 5.4e-41], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3e-20], N[(x / N[(y * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 30000000.0], N[(y / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(y + x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.4 \cdot 10^{-41}:\\
\;\;\;\;\frac{y}{x + 1} \cdot \frac{1}{x}\\
\mathbf{elif}\;y \leq 3 \cdot 10^{-20}:\\
\;\;\;\;\frac{x}{y \cdot \left(y + 1\right)}\\
\mathbf{elif}\;y \leq 30000000:\\
\;\;\;\;\frac{y}{x \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y + x}}{y}\\
\end{array}
\end{array}
if y < 5.4e-41Initial program 69.2%
times-frac87.8%
/-rgt-identity87.8%
associate-/l/87.8%
*-lft-identity87.8%
associate-+l+87.8%
Simplified87.8%
Taylor expanded in y around 0 56.3%
associate-/r*57.5%
div-inv57.5%
Applied egg-rr57.5%
if 5.4e-41 < y < 3.00000000000000029e-20Initial program 99.5%
times-frac99.5%
/-rgt-identity99.5%
associate-/l/99.5%
*-lft-identity99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in x around 0 34.6%
+-commutative34.6%
Simplified34.6%
if 3.00000000000000029e-20 < y < 3e7Initial program 62.3%
times-frac99.4%
/-rgt-identity99.4%
associate-/l/99.4%
*-lft-identity99.4%
associate-+l+99.4%
Simplified99.4%
Taylor expanded in y around 0 61.3%
if 3e7 < y Initial program 52.0%
associate-*r/72.4%
*-commutative72.4%
distribute-rgt1-in63.1%
fma-def72.4%
cube-unmult72.4%
Simplified72.4%
associate-*r/52.0%
fma-udef50.2%
cube-mult50.1%
distribute-rgt1-in52.0%
associate-+r+52.0%
*-commutative52.0%
frac-times82.6%
*-commutative82.6%
clear-num82.5%
associate-/r*99.7%
frac-times99.7%
*-un-lft-identity99.7%
+-commutative99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 68.4%
Final simplification59.6%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (* x x))))
(if (<= y -1.06e-181)
t_0
(if (<= y 1.7e-118) (/ y x) (if (<= y 30000000.0) t_0 (/ x (* y y)))))))
double code(double x, double y) {
double t_0 = y / (x * x);
double tmp;
if (y <= -1.06e-181) {
tmp = t_0;
} else if (y <= 1.7e-118) {
tmp = y / x;
} else if (y <= 30000000.0) {
tmp = t_0;
} 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) :: t_0
real(8) :: tmp
t_0 = y / (x * x)
if (y <= (-1.06d-181)) then
tmp = t_0
else if (y <= 1.7d-118) then
tmp = y / x
else if (y <= 30000000.0d0) then
tmp = t_0
else
tmp = x / (y * y)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y / (x * x);
double tmp;
if (y <= -1.06e-181) {
tmp = t_0;
} else if (y <= 1.7e-118) {
tmp = y / x;
} else if (y <= 30000000.0) {
tmp = t_0;
} else {
tmp = x / (y * y);
}
return tmp;
}
def code(x, y): t_0 = y / (x * x) tmp = 0 if y <= -1.06e-181: tmp = t_0 elif y <= 1.7e-118: tmp = y / x elif y <= 30000000.0: tmp = t_0 else: tmp = x / (y * y) return tmp
function code(x, y) t_0 = Float64(y / Float64(x * x)) tmp = 0.0 if (y <= -1.06e-181) tmp = t_0; elseif (y <= 1.7e-118) tmp = Float64(y / x); elseif (y <= 30000000.0) tmp = t_0; else tmp = Float64(x / Float64(y * y)); end return tmp end
function tmp_2 = code(x, y) t_0 = y / (x * x); tmp = 0.0; if (y <= -1.06e-181) tmp = t_0; elseif (y <= 1.7e-118) tmp = y / x; elseif (y <= 30000000.0) tmp = t_0; else tmp = x / (y * y); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.06e-181], t$95$0, If[LessEqual[y, 1.7e-118], N[(y / x), $MachinePrecision], If[LessEqual[y, 30000000.0], t$95$0, N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y}{x \cdot x}\\
\mathbf{if}\;y \leq -1.06 \cdot 10^{-181}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{-118}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;y \leq 30000000:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot y}\\
\end{array}
\end{array}
if y < -1.06000000000000001e-181 or 1.69999999999999995e-118 < y < 3e7Initial program 65.7%
associate-*r/81.0%
*-commutative81.0%
distribute-rgt1-in44.2%
fma-def81.0%
cube-unmult81.0%
Simplified81.0%
Taylor expanded in x around inf 34.5%
unpow234.5%
Simplified34.5%
if -1.06000000000000001e-181 < y < 1.69999999999999995e-118Initial program 75.5%
times-frac81.6%
/-rgt-identity81.6%
associate-/l/81.6%
*-lft-identity81.6%
associate-+l+81.6%
Simplified81.6%
Taylor expanded in y around 0 86.6%
Taylor expanded in x around 0 76.0%
if 3e7 < y Initial program 52.0%
associate-*r/72.4%
*-commutative72.4%
distribute-rgt1-in63.1%
fma-def72.4%
cube-unmult72.4%
Simplified72.4%
Taylor expanded in y around inf 65.3%
unpow265.3%
Simplified65.3%
Final simplification53.6%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ y (* x x))))
(if (<= y -3e-182)
t_0
(if (<= y 1.05e-116) (/ y x) (if (<= y 30000000.0) t_0 (/ (/ x y) y))))))
double code(double x, double y) {
double t_0 = y / (x * x);
double tmp;
if (y <= -3e-182) {
tmp = t_0;
} else if (y <= 1.05e-116) {
tmp = y / x;
} else if (y <= 30000000.0) {
tmp = t_0;
} 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) :: t_0
real(8) :: tmp
t_0 = y / (x * x)
if (y <= (-3d-182)) then
tmp = t_0
else if (y <= 1.05d-116) then
tmp = y / x
else if (y <= 30000000.0d0) then
tmp = t_0
else
tmp = (x / y) / y
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y / (x * x);
double tmp;
if (y <= -3e-182) {
tmp = t_0;
} else if (y <= 1.05e-116) {
tmp = y / x;
} else if (y <= 30000000.0) {
tmp = t_0;
} else {
tmp = (x / y) / y;
}
return tmp;
}
def code(x, y): t_0 = y / (x * x) tmp = 0 if y <= -3e-182: tmp = t_0 elif y <= 1.05e-116: tmp = y / x elif y <= 30000000.0: tmp = t_0 else: tmp = (x / y) / y return tmp
function code(x, y) t_0 = Float64(y / Float64(x * x)) tmp = 0.0 if (y <= -3e-182) tmp = t_0; elseif (y <= 1.05e-116) tmp = Float64(y / x); elseif (y <= 30000000.0) tmp = t_0; else tmp = Float64(Float64(x / y) / y); end return tmp end
function tmp_2 = code(x, y) t_0 = y / (x * x); tmp = 0.0; if (y <= -3e-182) tmp = t_0; elseif (y <= 1.05e-116) tmp = y / x; elseif (y <= 30000000.0) tmp = t_0; else tmp = (x / y) / y; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y / N[(x * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3e-182], t$95$0, If[LessEqual[y, 1.05e-116], N[(y / x), $MachinePrecision], If[LessEqual[y, 30000000.0], t$95$0, N[(N[(x / y), $MachinePrecision] / y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{y}{x \cdot x}\\
\mathbf{if}\;y \leq -3 \cdot 10^{-182}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{-116}:\\
\;\;\;\;\frac{y}{x}\\
\mathbf{elif}\;y \leq 30000000:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{y}}{y}\\
\end{array}
\end{array}
if y < -3.0000000000000001e-182 or 1.05e-116 < y < 3e7Initial program 65.7%
associate-*r/81.0%
*-commutative81.0%
distribute-rgt1-in44.2%
fma-def81.0%
cube-unmult81.0%
Simplified81.0%
Taylor expanded in x around inf 34.5%
unpow234.5%
Simplified34.5%
if -3.0000000000000001e-182 < y < 1.05e-116Initial program 75.5%
times-frac81.6%
/-rgt-identity81.6%
associate-/l/81.6%
*-lft-identity81.6%
associate-+l+81.6%
Simplified81.6%
Taylor expanded in y around 0 86.6%
Taylor expanded in x around 0 76.0%
if 3e7 < y Initial program 52.0%
associate-*r/72.4%
*-commutative72.4%
distribute-rgt1-in63.1%
fma-def72.4%
cube-unmult72.4%
Simplified72.4%
Taylor expanded in y around inf 65.3%
unpow265.3%
Simplified65.3%
*-un-lft-identity65.3%
times-frac68.0%
Applied egg-rr68.0%
*-commutative68.0%
associate-*r/68.0%
*-rgt-identity68.0%
Simplified68.0%
Final simplification54.2%
(FPCore (x y) :precision binary64 (if (or (<= y -4.9e+142) (not (<= y 6e-54))) (/ x (* y y)) (/ y x)))
double code(double x, double y) {
double tmp;
if ((y <= -4.9e+142) || !(y <= 6e-54)) {
tmp = x / (y * y);
} else {
tmp = y / x;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((y <= (-4.9d+142)) .or. (.not. (y <= 6d-54))) then
tmp = x / (y * y)
else
tmp = y / x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -4.9e+142) || !(y <= 6e-54)) {
tmp = x / (y * y);
} else {
tmp = y / x;
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -4.9e+142) or not (y <= 6e-54): tmp = x / (y * y) else: tmp = y / x return tmp
function code(x, y) tmp = 0.0 if ((y <= -4.9e+142) || !(y <= 6e-54)) tmp = Float64(x / Float64(y * y)); else tmp = Float64(y / x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -4.9e+142) || ~((y <= 6e-54))) tmp = x / (y * y); else tmp = y / x; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -4.9e+142], N[Not[LessEqual[y, 6e-54]], $MachinePrecision]], N[(x / N[(y * y), $MachinePrecision]), $MachinePrecision], N[(y / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.9 \cdot 10^{+142} \lor \neg \left(y \leq 6 \cdot 10^{-54}\right):\\
\;\;\;\;\frac{x}{y \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{x}\\
\end{array}
\end{array}
if y < -4.90000000000000051e142 or 6.00000000000000018e-54 < y Initial program 56.2%
associate-*r/76.7%
*-commutative76.7%
distribute-rgt1-in37.5%
fma-def76.7%
cube-unmult76.7%
Simplified76.7%
Taylor expanded in y around inf 67.7%
unpow267.7%
Simplified67.7%
if -4.90000000000000051e142 < y < 6.00000000000000018e-54Initial program 73.0%
times-frac88.1%
/-rgt-identity88.1%
associate-/l/88.1%
*-lft-identity88.1%
associate-+l+88.1%
Simplified88.1%
Taylor expanded in y around 0 68.0%
Taylor expanded in x around 0 47.6%
Final simplification56.3%
(FPCore (x y) :precision binary64 (/ 1.0 y))
double code(double x, double y) {
return 1.0 / y;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 / y
end function
public static double code(double x, double y) {
return 1.0 / y;
}
def code(x, y): return 1.0 / y
function code(x, y) return Float64(1.0 / y) end
function tmp = code(x, y) tmp = 1.0 / y; end
code[x_, y_] := N[(1.0 / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{y}
\end{array}
Initial program 65.7%
times-frac87.0%
/-rgt-identity87.0%
associate-/l/87.0%
*-lft-identity87.0%
associate-+l+87.0%
Simplified87.0%
Taylor expanded in x around 0 45.2%
unpow245.2%
Simplified45.2%
Taylor expanded in x around inf 4.3%
Final simplification4.3%
(FPCore (x y) :precision binary64 (/ y x))
double code(double x, double y) {
return y / x;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = y / x
end function
public static double code(double x, double y) {
return y / x;
}
def code(x, y): return y / x
function code(x, y) return Float64(y / x) end
function tmp = code(x, y) tmp = y / x; end
code[x_, y_] := N[(y / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{y}{x}
\end{array}
Initial program 65.7%
times-frac87.0%
/-rgt-identity87.0%
associate-/l/87.0%
*-lft-identity87.0%
associate-+l+87.0%
Simplified87.0%
Taylor expanded in y around 0 50.7%
Taylor expanded in x around 0 28.2%
Final simplification28.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 2023171
(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))))