
(FPCore (x y z t) :precision binary64 (/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))
double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
def code(x, y, z, t): return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0)
function code(x, y, z, t) return Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / Float64(Float64(t * z) - x))) / Float64(x + 1.0)) end
function tmp = code(x, y, z, t) tmp = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0); end
code[x_, y_, z_, t_] := N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / N[(N[(t * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))
double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
def code(x, y, z, t): return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0)
function code(x, y, z, t) return Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / Float64(Float64(t * z) - x))) / Float64(x + 1.0)) end
function tmp = code(x, y, z, t) tmp = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0); end
code[x_, y_, z_, t_] := N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / N[(N[(t * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}
\end{array}
(FPCore (x y z t) :precision binary64 (if (or (<= z -850000000.0) (not (<= z 3.65e+161))) (/ (+ x (/ y t)) (+ x 1.0)) (/ (+ x (/ 1.0 (/ (- (* z t) x) (- (* z y) x)))) (+ x 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -850000000.0) || !(z <= 3.65e+161)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = (x + (1.0 / (((z * t) - x) / ((z * y) - x)))) / (x + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-850000000.0d0)) .or. (.not. (z <= 3.65d+161))) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = (x + (1.0d0 / (((z * t) - x) / ((z * y) - x)))) / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -850000000.0) || !(z <= 3.65e+161)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = (x + (1.0 / (((z * t) - x) / ((z * y) - x)))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -850000000.0) or not (z <= 3.65e+161): tmp = (x + (y / t)) / (x + 1.0) else: tmp = (x + (1.0 / (((z * t) - x) / ((z * y) - x)))) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -850000000.0) || !(z <= 3.65e+161)) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = Float64(Float64(x + Float64(1.0 / Float64(Float64(Float64(z * t) - x) / Float64(Float64(z * y) - x)))) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -850000000.0) || ~((z <= 3.65e+161))) tmp = (x + (y / t)) / (x + 1.0); else tmp = (x + (1.0 / (((z * t) - x) / ((z * y) - x)))) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -850000000.0], N[Not[LessEqual[z, 3.65e+161]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(1.0 / N[(N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision] / N[(N[(z * y), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -850000000 \lor \neg \left(z \leq 3.65 \cdot 10^{+161}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{1}{\frac{z \cdot t - x}{z \cdot y - x}}}{x + 1}\\
\end{array}
\end{array}
if z < -8.5e8 or 3.6499999999999998e161 < z Initial program 70.8%
*-commutative70.8%
Simplified70.8%
Taylor expanded in z around inf 90.8%
if -8.5e8 < z < 3.6499999999999998e161Initial program 97.1%
*-commutative97.1%
Simplified97.1%
clear-num97.1%
inv-pow97.1%
fma-neg97.1%
Applied egg-rr97.1%
unpow-197.1%
*-commutative97.1%
fma-neg97.1%
*-commutative97.1%
Simplified97.1%
Final simplification95.0%
(FPCore (x y z t) :precision binary64 (if (or (<= z -850000000.0) (not (<= z 8.2e+160))) (/ (+ x (/ y t)) (+ x 1.0)) (/ (+ x (/ (- (* z y) x) (- (* z t) x))) (+ x 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -850000000.0) || !(z <= 8.2e+160)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = (x + (((z * y) - x) / ((z * t) - x))) / (x + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-850000000.0d0)) .or. (.not. (z <= 8.2d+160))) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = (x + (((z * y) - x) / ((z * t) - x))) / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -850000000.0) || !(z <= 8.2e+160)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = (x + (((z * y) - x) / ((z * t) - x))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -850000000.0) or not (z <= 8.2e+160): tmp = (x + (y / t)) / (x + 1.0) else: tmp = (x + (((z * y) - x) / ((z * t) - x))) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -850000000.0) || !(z <= 8.2e+160)) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = Float64(Float64(x + Float64(Float64(Float64(z * y) - x) / Float64(Float64(z * t) - x))) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -850000000.0) || ~((z <= 8.2e+160))) tmp = (x + (y / t)) / (x + 1.0); else tmp = (x + (((z * y) - x) / ((z * t) - x))) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -850000000.0], N[Not[LessEqual[z, 8.2e+160]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(N[(N[(z * y), $MachinePrecision] - x), $MachinePrecision] / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -850000000 \lor \neg \left(z \leq 8.2 \cdot 10^{+160}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{z \cdot y - x}{z \cdot t - x}}{x + 1}\\
\end{array}
\end{array}
if z < -8.5e8 or 8.19999999999999996e160 < z Initial program 70.8%
*-commutative70.8%
Simplified70.8%
Taylor expanded in z around inf 90.8%
if -8.5e8 < z < 8.19999999999999996e160Initial program 97.1%
Final simplification95.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ y t)) (+ x 1.0))) (t_2 (/ x (+ x 1.0))))
(if (<= x -0.0016)
t_2
(if (<= x -4.8e-89)
(+ 1.0 (* z (- y (/ y x))))
(if (<= x -1.16e-124)
t_1
(if (<= x -8.6e-144)
(+ (* z y) (- 1.0 (/ y (/ x z))))
(if (<= x 1.35e+42) t_1 t_2)))))))
double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double t_2 = x / (x + 1.0);
double tmp;
if (x <= -0.0016) {
tmp = t_2;
} else if (x <= -4.8e-89) {
tmp = 1.0 + (z * (y - (y / x)));
} else if (x <= -1.16e-124) {
tmp = t_1;
} else if (x <= -8.6e-144) {
tmp = (z * y) + (1.0 - (y / (x / z)));
} else if (x <= 1.35e+42) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x + (y / t)) / (x + 1.0d0)
t_2 = x / (x + 1.0d0)
if (x <= (-0.0016d0)) then
tmp = t_2
else if (x <= (-4.8d-89)) then
tmp = 1.0d0 + (z * (y - (y / x)))
else if (x <= (-1.16d-124)) then
tmp = t_1
else if (x <= (-8.6d-144)) then
tmp = (z * y) + (1.0d0 - (y / (x / z)))
else if (x <= 1.35d+42) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double t_2 = x / (x + 1.0);
double tmp;
if (x <= -0.0016) {
tmp = t_2;
} else if (x <= -4.8e-89) {
tmp = 1.0 + (z * (y - (y / x)));
} else if (x <= -1.16e-124) {
tmp = t_1;
} else if (x <= -8.6e-144) {
tmp = (z * y) + (1.0 - (y / (x / z)));
} else if (x <= 1.35e+42) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x + (y / t)) / (x + 1.0) t_2 = x / (x + 1.0) tmp = 0 if x <= -0.0016: tmp = t_2 elif x <= -4.8e-89: tmp = 1.0 + (z * (y - (y / x))) elif x <= -1.16e-124: tmp = t_1 elif x <= -8.6e-144: tmp = (z * y) + (1.0 - (y / (x / z))) elif x <= 1.35e+42: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)) t_2 = Float64(x / Float64(x + 1.0)) tmp = 0.0 if (x <= -0.0016) tmp = t_2; elseif (x <= -4.8e-89) tmp = Float64(1.0 + Float64(z * Float64(y - Float64(y / x)))); elseif (x <= -1.16e-124) tmp = t_1; elseif (x <= -8.6e-144) tmp = Float64(Float64(z * y) + Float64(1.0 - Float64(y / Float64(x / z)))); elseif (x <= 1.35e+42) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x + (y / t)) / (x + 1.0); t_2 = x / (x + 1.0); tmp = 0.0; if (x <= -0.0016) tmp = t_2; elseif (x <= -4.8e-89) tmp = 1.0 + (z * (y - (y / x))); elseif (x <= -1.16e-124) tmp = t_1; elseif (x <= -8.6e-144) tmp = (z * y) + (1.0 - (y / (x / z))); elseif (x <= 1.35e+42) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -0.0016], t$95$2, If[LessEqual[x, -4.8e-89], N[(1.0 + N[(z * N[(y - N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.16e-124], t$95$1, If[LessEqual[x, -8.6e-144], N[(N[(z * y), $MachinePrecision] + N[(1.0 - N[(y / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.35e+42], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y}{t}}{x + 1}\\
t_2 := \frac{x}{x + 1}\\
\mathbf{if}\;x \leq -0.0016:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -4.8 \cdot 10^{-89}:\\
\;\;\;\;1 + z \cdot \left(y - \frac{y}{x}\right)\\
\mathbf{elif}\;x \leq -1.16 \cdot 10^{-124}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -8.6 \cdot 10^{-144}:\\
\;\;\;\;z \cdot y + \left(1 - \frac{y}{\frac{x}{z}}\right)\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{+42}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -0.00160000000000000008 or 1.35e42 < x Initial program 85.4%
*-commutative85.4%
Simplified85.4%
Taylor expanded in t around inf 87.7%
+-commutative87.7%
Simplified87.7%
if -0.00160000000000000008 < x < -4.80000000000000032e-89Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around 0 72.2%
fma-neg72.2%
associate-*r/72.2%
neg-mul-172.2%
neg-sub072.2%
fma-def72.2%
+-commutative72.2%
associate--r+72.2%
neg-sub072.2%
remove-double-neg72.2%
*-commutative72.2%
Simplified72.2%
Taylor expanded in x around 0 72.2%
mul-1-neg72.2%
*-commutative72.2%
sub-neg72.2%
associate-*r*72.2%
neg-mul-172.2%
cancel-sign-sub72.2%
*-commutative72.2%
associate-/l*72.2%
Simplified72.2%
Taylor expanded in z around 0 72.2%
if -4.80000000000000032e-89 < x < -1.1600000000000001e-124 or -8.5999999999999998e-144 < x < 1.35e42Initial program 88.3%
*-commutative88.3%
Simplified88.3%
Taylor expanded in z around inf 78.2%
if -1.1600000000000001e-124 < x < -8.5999999999999998e-144Initial program 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in t around 0 95.3%
fma-neg95.3%
associate-*r/95.3%
neg-mul-195.3%
neg-sub095.3%
fma-def95.3%
+-commutative95.3%
associate--r+95.3%
neg-sub095.3%
remove-double-neg95.3%
*-commutative95.3%
Simplified95.3%
Taylor expanded in x around 0 95.3%
mul-1-neg95.3%
*-commutative95.3%
sub-neg95.3%
associate-*r*95.3%
neg-mul-195.3%
cancel-sign-sub95.3%
*-commutative95.3%
associate-/l*95.6%
Simplified95.6%
Final simplification82.3%
(FPCore (x y z t) :precision binary64 (if (or (<= t -4e-116) (not (<= t 3.5e-16))) (/ (+ x (/ y t)) (+ x 1.0)) (/ (- (+ x 1.0) (/ y (/ x z))) (+ x 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -4e-116) || !(t <= 3.5e-16)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = ((x + 1.0) - (y / (x / z))) / (x + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-4d-116)) .or. (.not. (t <= 3.5d-16))) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = ((x + 1.0d0) - (y / (x / z))) / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -4e-116) || !(t <= 3.5e-16)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = ((x + 1.0) - (y / (x / z))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -4e-116) or not (t <= 3.5e-16): tmp = (x + (y / t)) / (x + 1.0) else: tmp = ((x + 1.0) - (y / (x / z))) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -4e-116) || !(t <= 3.5e-16)) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = Float64(Float64(Float64(x + 1.0) - Float64(y / Float64(x / z))) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -4e-116) || ~((t <= 3.5e-16))) tmp = (x + (y / t)) / (x + 1.0); else tmp = ((x + 1.0) - (y / (x / z))) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -4e-116], N[Not[LessEqual[t, 3.5e-16]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x + 1.0), $MachinePrecision] - N[(y / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4 \cdot 10^{-116} \lor \neg \left(t \leq 3.5 \cdot 10^{-16}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x + 1\right) - \frac{y}{\frac{x}{z}}}{x + 1}\\
\end{array}
\end{array}
if t < -4e-116 or 3.50000000000000017e-16 < t Initial program 87.0%
*-commutative87.0%
Simplified87.0%
Taylor expanded in z around inf 86.9%
if -4e-116 < t < 3.50000000000000017e-16Initial program 90.2%
*-commutative90.2%
Simplified90.2%
Taylor expanded in t around 0 78.0%
associate-+r+78.0%
mul-1-neg78.0%
unsub-neg78.0%
+-commutative78.0%
associate-/l*84.8%
+-commutative84.8%
Simplified84.8%
Final simplification86.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (+ x 1.0))))
(if (<= x -0.0225)
t_1
(if (<= x -4.8e-89)
(+ 1.0 (* z (- y (/ y x))))
(if (<= x 2.75e+42) (/ (+ x (/ y t)) (+ x 1.0)) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x / (x + 1.0);
double tmp;
if (x <= -0.0225) {
tmp = t_1;
} else if (x <= -4.8e-89) {
tmp = 1.0 + (z * (y - (y / x)));
} else if (x <= 2.75e+42) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x / (x + 1.0d0)
if (x <= (-0.0225d0)) then
tmp = t_1
else if (x <= (-4.8d-89)) then
tmp = 1.0d0 + (z * (y - (y / x)))
else if (x <= 2.75d+42) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x / (x + 1.0);
double tmp;
if (x <= -0.0225) {
tmp = t_1;
} else if (x <= -4.8e-89) {
tmp = 1.0 + (z * (y - (y / x)));
} else if (x <= 2.75e+42) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (x + 1.0) tmp = 0 if x <= -0.0225: tmp = t_1 elif x <= -4.8e-89: tmp = 1.0 + (z * (y - (y / x))) elif x <= 2.75e+42: tmp = (x + (y / t)) / (x + 1.0) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(x + 1.0)) tmp = 0.0 if (x <= -0.0225) tmp = t_1; elseif (x <= -4.8e-89) tmp = Float64(1.0 + Float64(z * Float64(y - Float64(y / x)))); elseif (x <= 2.75e+42) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (x + 1.0); tmp = 0.0; if (x <= -0.0225) tmp = t_1; elseif (x <= -4.8e-89) tmp = 1.0 + (z * (y - (y / x))); elseif (x <= 2.75e+42) tmp = (x + (y / t)) / (x + 1.0); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -0.0225], t$95$1, If[LessEqual[x, -4.8e-89], N[(1.0 + N[(z * N[(y - N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.75e+42], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{x + 1}\\
\mathbf{if}\;x \leq -0.0225:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -4.8 \cdot 10^{-89}:\\
\;\;\;\;1 + z \cdot \left(y - \frac{y}{x}\right)\\
\mathbf{elif}\;x \leq 2.75 \cdot 10^{+42}:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -0.022499999999999999 or 2.75000000000000001e42 < x Initial program 85.4%
*-commutative85.4%
Simplified85.4%
Taylor expanded in t around inf 87.7%
+-commutative87.7%
Simplified87.7%
if -0.022499999999999999 < x < -4.80000000000000032e-89Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around 0 72.2%
fma-neg72.2%
associate-*r/72.2%
neg-mul-172.2%
neg-sub072.2%
fma-def72.2%
+-commutative72.2%
associate--r+72.2%
neg-sub072.2%
remove-double-neg72.2%
*-commutative72.2%
Simplified72.2%
Taylor expanded in x around 0 72.2%
mul-1-neg72.2%
*-commutative72.2%
sub-neg72.2%
associate-*r*72.2%
neg-mul-172.2%
cancel-sign-sub72.2%
*-commutative72.2%
associate-/l*72.2%
Simplified72.2%
Taylor expanded in z around 0 72.2%
if -4.80000000000000032e-89 < x < 2.75000000000000001e42Initial program 88.8%
*-commutative88.8%
Simplified88.8%
Taylor expanded in z around inf 75.4%
Final simplification80.6%
(FPCore (x y z t) :precision binary64 (if (or (<= t -5.8e-116) (not (<= t 1.5e-18))) (/ (+ x (/ y t)) (+ x 1.0)) (- 1.0 (* (/ y x) (/ z (+ x 1.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -5.8e-116) || !(t <= 1.5e-18)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0 - ((y / x) * (z / (x + 1.0)));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-5.8d-116)) .or. (.not. (t <= 1.5d-18))) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = 1.0d0 - ((y / x) * (z / (x + 1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -5.8e-116) || !(t <= 1.5e-18)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0 - ((y / x) * (z / (x + 1.0)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -5.8e-116) or not (t <= 1.5e-18): tmp = (x + (y / t)) / (x + 1.0) else: tmp = 1.0 - ((y / x) * (z / (x + 1.0))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -5.8e-116) || !(t <= 1.5e-18)) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = Float64(1.0 - Float64(Float64(y / x) * Float64(z / Float64(x + 1.0)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -5.8e-116) || ~((t <= 1.5e-18))) tmp = (x + (y / t)) / (x + 1.0); else tmp = 1.0 - ((y / x) * (z / (x + 1.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -5.8e-116], N[Not[LessEqual[t, 1.5e-18]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(y / x), $MachinePrecision] * N[(z / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.8 \cdot 10^{-116} \lor \neg \left(t \leq 1.5 \cdot 10^{-18}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{y}{x} \cdot \frac{z}{x + 1}\\
\end{array}
\end{array}
if t < -5.7999999999999996e-116 or 1.49999999999999991e-18 < t Initial program 87.0%
*-commutative87.0%
Simplified87.0%
Taylor expanded in z around inf 86.9%
if -5.7999999999999996e-116 < t < 1.49999999999999991e-18Initial program 90.2%
*-commutative90.2%
Simplified90.2%
Taylor expanded in t around 0 78.0%
fma-neg78.0%
associate-*r/78.0%
neg-mul-178.0%
neg-sub078.0%
fma-def78.0%
+-commutative78.0%
associate--r+78.0%
neg-sub078.0%
remove-double-neg78.0%
*-commutative78.0%
Simplified78.0%
Taylor expanded in z around 0 77.9%
mul-1-neg77.9%
sub-neg77.9%
times-frac83.9%
+-commutative83.9%
Simplified83.9%
Final simplification85.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (+ x 1.0))))
(if (<= x -0.000445)
t_1
(if (<= x -4.9e-144)
(+ 1.0 (* z (- y (/ y x))))
(if (<= x 5.8e-95) (/ y t) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x / (x + 1.0);
double tmp;
if (x <= -0.000445) {
tmp = t_1;
} else if (x <= -4.9e-144) {
tmp = 1.0 + (z * (y - (y / x)));
} else if (x <= 5.8e-95) {
tmp = y / t;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x / (x + 1.0d0)
if (x <= (-0.000445d0)) then
tmp = t_1
else if (x <= (-4.9d-144)) then
tmp = 1.0d0 + (z * (y - (y / x)))
else if (x <= 5.8d-95) then
tmp = y / t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x / (x + 1.0);
double tmp;
if (x <= -0.000445) {
tmp = t_1;
} else if (x <= -4.9e-144) {
tmp = 1.0 + (z * (y - (y / x)));
} else if (x <= 5.8e-95) {
tmp = y / t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (x + 1.0) tmp = 0 if x <= -0.000445: tmp = t_1 elif x <= -4.9e-144: tmp = 1.0 + (z * (y - (y / x))) elif x <= 5.8e-95: tmp = y / t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(x + 1.0)) tmp = 0.0 if (x <= -0.000445) tmp = t_1; elseif (x <= -4.9e-144) tmp = Float64(1.0 + Float64(z * Float64(y - Float64(y / x)))); elseif (x <= 5.8e-95) tmp = Float64(y / t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (x + 1.0); tmp = 0.0; if (x <= -0.000445) tmp = t_1; elseif (x <= -4.9e-144) tmp = 1.0 + (z * (y - (y / x))); elseif (x <= 5.8e-95) tmp = y / t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -0.000445], t$95$1, If[LessEqual[x, -4.9e-144], N[(1.0 + N[(z * N[(y - N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.8e-95], N[(y / t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{x + 1}\\
\mathbf{if}\;x \leq -0.000445:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -4.9 \cdot 10^{-144}:\\
\;\;\;\;1 + z \cdot \left(y - \frac{y}{x}\right)\\
\mathbf{elif}\;x \leq 5.8 \cdot 10^{-95}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -4.4499999999999997e-4 or 5.80000000000000004e-95 < x Initial program 84.4%
*-commutative84.4%
Simplified84.4%
Taylor expanded in t around inf 81.1%
+-commutative81.1%
Simplified81.1%
if -4.4499999999999997e-4 < x < -4.9000000000000001e-144Initial program 97.1%
*-commutative97.1%
Simplified97.1%
Taylor expanded in t around 0 63.3%
fma-neg63.3%
associate-*r/63.3%
neg-mul-163.3%
neg-sub063.3%
fma-def63.3%
+-commutative63.3%
associate--r+63.3%
neg-sub063.3%
remove-double-neg63.3%
*-commutative63.3%
Simplified63.3%
Taylor expanded in x around 0 63.3%
mul-1-neg63.3%
*-commutative63.3%
sub-neg63.3%
associate-*r*63.3%
neg-mul-163.3%
cancel-sign-sub63.3%
*-commutative63.3%
associate-/l*63.3%
Simplified63.3%
Taylor expanded in z around 0 60.5%
if -4.9000000000000001e-144 < x < 5.80000000000000004e-95Initial program 90.7%
*-commutative90.7%
Simplified90.7%
clear-num90.8%
inv-pow90.8%
fma-neg90.8%
Applied egg-rr90.8%
unpow-190.8%
*-commutative90.8%
fma-neg90.8%
*-commutative90.8%
Simplified90.8%
Taylor expanded in x around 0 57.7%
Final simplification70.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ 1.0 x))))
(if (<= x -2.85e-89)
t_1
(if (<= x 3.1e-94) (/ y t) (if (<= x 3.3e-29) x t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 / x);
double tmp;
if (x <= -2.85e-89) {
tmp = t_1;
} else if (x <= 3.1e-94) {
tmp = y / t;
} else if (x <= 3.3e-29) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * (1.0d0 / x)
if (x <= (-2.85d-89)) then
tmp = t_1
else if (x <= 3.1d-94) then
tmp = y / t
else if (x <= 3.3d-29) then
tmp = x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 / x);
double tmp;
if (x <= -2.85e-89) {
tmp = t_1;
} else if (x <= 3.1e-94) {
tmp = y / t;
} else if (x <= 3.3e-29) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 / x) tmp = 0 if x <= -2.85e-89: tmp = t_1 elif x <= 3.1e-94: tmp = y / t elif x <= 3.3e-29: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(1.0 / x)) tmp = 0.0 if (x <= -2.85e-89) tmp = t_1; elseif (x <= 3.1e-94) tmp = Float64(y / t); elseif (x <= 3.3e-29) tmp = x; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (1.0 / x); tmp = 0.0; if (x <= -2.85e-89) tmp = t_1; elseif (x <= 3.1e-94) tmp = y / t; elseif (x <= 3.3e-29) tmp = x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(1.0 / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.85e-89], t$95$1, If[LessEqual[x, 3.1e-94], N[(y / t), $MachinePrecision], If[LessEqual[x, 3.3e-29], x, t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{1}{x}\\
\mathbf{if}\;x \leq -2.85 \cdot 10^{-89}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 3.1 \cdot 10^{-94}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{elif}\;x \leq 3.3 \cdot 10^{-29}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -2.8500000000000001e-89 or 3.30000000000000028e-29 < x Initial program 86.7%
*-commutative86.7%
Simplified86.7%
Taylor expanded in t around inf 75.9%
+-commutative75.9%
Simplified75.9%
div-inv75.8%
Applied egg-rr75.8%
Taylor expanded in x around inf 79.3%
if -2.8500000000000001e-89 < x < 3.0999999999999998e-94Initial program 91.0%
*-commutative91.0%
Simplified91.0%
clear-num91.0%
inv-pow91.0%
fma-neg91.0%
Applied egg-rr91.0%
unpow-191.0%
*-commutative91.0%
fma-neg91.0%
*-commutative91.0%
Simplified91.0%
Taylor expanded in x around 0 54.1%
if 3.0999999999999998e-94 < x < 3.30000000000000028e-29Initial program 84.6%
*-commutative84.6%
Simplified84.6%
Taylor expanded in t around inf 55.6%
+-commutative55.6%
Simplified55.6%
Taylor expanded in x around 0 55.6%
Final simplification68.4%
(FPCore (x y z t) :precision binary64 (if (<= x -2.85e-89) (* x (/ 1.0 x)) (if (<= x 7.5e-92) (/ y t) (/ x (+ x 1.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.85e-89) {
tmp = x * (1.0 / x);
} else if (x <= 7.5e-92) {
tmp = y / t;
} else {
tmp = x / (x + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= (-2.85d-89)) then
tmp = x * (1.0d0 / x)
else if (x <= 7.5d-92) then
tmp = y / t
else
tmp = x / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.85e-89) {
tmp = x * (1.0 / x);
} else if (x <= 7.5e-92) {
tmp = y / t;
} else {
tmp = x / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -2.85e-89: tmp = x * (1.0 / x) elif x <= 7.5e-92: tmp = y / t else: tmp = x / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -2.85e-89) tmp = Float64(x * Float64(1.0 / x)); elseif (x <= 7.5e-92) tmp = Float64(y / t); else tmp = Float64(x / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -2.85e-89) tmp = x * (1.0 / x); elseif (x <= 7.5e-92) tmp = y / t; else tmp = x / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -2.85e-89], N[(x * N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7.5e-92], N[(y / t), $MachinePrecision], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.85 \cdot 10^{-89}:\\
\;\;\;\;x \cdot \frac{1}{x}\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{-92}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + 1}\\
\end{array}
\end{array}
if x < -2.8500000000000001e-89Initial program 90.7%
*-commutative90.7%
Simplified90.7%
Taylor expanded in t around inf 74.8%
+-commutative74.8%
Simplified74.8%
div-inv74.7%
Applied egg-rr74.7%
Taylor expanded in x around inf 79.0%
if -2.8500000000000001e-89 < x < 7.5000000000000005e-92Initial program 91.0%
*-commutative91.0%
Simplified91.0%
clear-num91.0%
inv-pow91.0%
fma-neg91.0%
Applied egg-rr91.0%
unpow-191.0%
*-commutative91.0%
fma-neg91.0%
*-commutative91.0%
Simplified91.0%
Taylor expanded in x around 0 54.1%
if 7.5000000000000005e-92 < x Initial program 81.8%
*-commutative81.8%
Simplified81.8%
Taylor expanded in t around inf 73.6%
+-commutative73.6%
Simplified73.6%
Final simplification67.9%
(FPCore (x y z t) :precision binary64 (if (<= x -2.85e-89) (/ (+ x 1.0) (+ x 1.0)) (if (<= x 1.35e-95) (/ y t) (/ x (+ x 1.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.85e-89) {
tmp = (x + 1.0) / (x + 1.0);
} else if (x <= 1.35e-95) {
tmp = y / t;
} else {
tmp = x / (x + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= (-2.85d-89)) then
tmp = (x + 1.0d0) / (x + 1.0d0)
else if (x <= 1.35d-95) then
tmp = y / t
else
tmp = x / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.85e-89) {
tmp = (x + 1.0) / (x + 1.0);
} else if (x <= 1.35e-95) {
tmp = y / t;
} else {
tmp = x / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -2.85e-89: tmp = (x + 1.0) / (x + 1.0) elif x <= 1.35e-95: tmp = y / t else: tmp = x / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -2.85e-89) tmp = Float64(Float64(x + 1.0) / Float64(x + 1.0)); elseif (x <= 1.35e-95) tmp = Float64(y / t); else tmp = Float64(x / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -2.85e-89) tmp = (x + 1.0) / (x + 1.0); elseif (x <= 1.35e-95) tmp = y / t; else tmp = x / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -2.85e-89], N[(N[(x + 1.0), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.35e-95], N[(y / t), $MachinePrecision], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.85 \cdot 10^{-89}:\\
\;\;\;\;\frac{x + 1}{x + 1}\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{-95}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + 1}\\
\end{array}
\end{array}
if x < -2.8500000000000001e-89Initial program 90.7%
*-commutative90.7%
Simplified90.7%
Taylor expanded in z around 0 79.1%
if -2.8500000000000001e-89 < x < 1.35e-95Initial program 91.0%
*-commutative91.0%
Simplified91.0%
clear-num91.0%
inv-pow91.0%
fma-neg91.0%
Applied egg-rr91.0%
unpow-191.0%
*-commutative91.0%
fma-neg91.0%
*-commutative91.0%
Simplified91.0%
Taylor expanded in x around 0 54.1%
if 1.35e-95 < x Initial program 81.8%
*-commutative81.8%
Simplified81.8%
Taylor expanded in t around inf 73.6%
+-commutative73.6%
Simplified73.6%
Final simplification68.0%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.55e+63) (not (<= y 3.05e-31))) (/ y t) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.55e+63) || !(y <= 3.05e-31)) {
tmp = y / t;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-1.55d+63)) .or. (.not. (y <= 3.05d-31))) then
tmp = y / t
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.55e+63) || !(y <= 3.05e-31)) {
tmp = y / t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.55e+63) or not (y <= 3.05e-31): tmp = y / t else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.55e+63) || !(y <= 3.05e-31)) tmp = Float64(y / t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.55e+63) || ~((y <= 3.05e-31))) tmp = y / t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.55e+63], N[Not[LessEqual[y, 3.05e-31]], $MachinePrecision]], N[(y / t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.55 \cdot 10^{+63} \lor \neg \left(y \leq 3.05 \cdot 10^{-31}\right):\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.55e63 or 3.0499999999999999e-31 < y Initial program 77.3%
*-commutative77.3%
Simplified77.3%
clear-num77.2%
inv-pow77.2%
fma-neg77.2%
Applied egg-rr77.2%
unpow-177.2%
*-commutative77.2%
fma-neg77.2%
*-commutative77.2%
Simplified77.2%
Taylor expanded in x around 0 33.1%
if -1.55e63 < y < 3.0499999999999999e-31Initial program 99.2%
*-commutative99.2%
Simplified99.2%
Taylor expanded in t around inf 69.9%
+-commutative69.9%
Simplified69.9%
Taylor expanded in x around 0 28.5%
Final simplification30.8%
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
return x;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x
end function
public static double code(double x, double y, double z, double t) {
return x;
}
def code(x, y, z, t): return x
function code(x, y, z, t) return x end
function tmp = code(x, y, z, t) tmp = x; end
code[x_, y_, z_, t_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 88.2%
*-commutative88.2%
Simplified88.2%
Taylor expanded in t around inf 55.8%
+-commutative55.8%
Simplified55.8%
Taylor expanded in x around 0 16.7%
Final simplification16.7%
(FPCore (x y z t) :precision binary64 (/ (+ x (- (/ y (- t (/ x z))) (/ x (- (* t z) x)))) (+ x 1.0)))
double code(double x, double y, double z, double t) {
return (x + ((y / (t - (x / z))) - (x / ((t * z) - x)))) / (x + 1.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x + ((y / (t - (x / z))) - (x / ((t * z) - x)))) / (x + 1.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x + ((y / (t - (x / z))) - (x / ((t * z) - x)))) / (x + 1.0);
}
def code(x, y, z, t): return (x + ((y / (t - (x / z))) - (x / ((t * z) - x)))) / (x + 1.0)
function code(x, y, z, t) return Float64(Float64(x + Float64(Float64(y / Float64(t - Float64(x / z))) - Float64(x / Float64(Float64(t * z) - x)))) / Float64(x + 1.0)) end
function tmp = code(x, y, z, t) tmp = (x + ((y / (t - (x / z))) - (x / ((t * z) - x)))) / (x + 1.0); end
code[x_, y_, z_, t_] := N[(N[(x + N[(N[(y / N[(t - N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[(N[(t * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \left(\frac{y}{t - \frac{x}{z}} - \frac{x}{t \cdot z - x}\right)}{x + 1}
\end{array}
herbie shell --seed 2023309
(FPCore (x y z t)
:name "Diagrams.Trail:splitAtParam from diagrams-lib-1.3.0.3, A"
:precision binary64
:herbie-target
(/ (+ x (- (/ y (- t (/ x z))) (/ x (- (* t z) x)))) (+ x 1.0))
(/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))