
(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 13 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 -1.4e+47) (not (<= z 6e+83))) (/ (+ x (/ y (- t (/ x z)))) (+ 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 <= -1.4e+47) || !(z <= 6e+83)) {
tmp = (x + (y / (t - (x / z)))) / (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 <= (-1.4d+47)) .or. (.not. (z <= 6d+83))) then
tmp = (x + (y / (t - (x / z)))) / (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 <= -1.4e+47) || !(z <= 6e+83)) {
tmp = (x + (y / (t - (x / z)))) / (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 <= -1.4e+47) or not (z <= 6e+83): tmp = (x + (y / (t - (x / z)))) / (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 <= -1.4e+47) || !(z <= 6e+83)) tmp = Float64(Float64(x + Float64(y / Float64(t - Float64(x / z)))) / 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 <= -1.4e+47) || ~((z <= 6e+83))) tmp = (x + (y / (t - (x / z)))) / (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, -1.4e+47], N[Not[LessEqual[z, 6e+83]], $MachinePrecision]], N[(N[(x + N[(y / N[(t - N[(x / z), $MachinePrecision]), $MachinePrecision]), $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 -1.4 \cdot 10^{+47} \lor \neg \left(z \leq 6 \cdot 10^{+83}\right):\\
\;\;\;\;\frac{x + \frac{y}{t - \frac{x}{z}}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{z \cdot y - x}{z \cdot t - x}}{x + 1}\\
\end{array}
\end{array}
if z < -1.39999999999999994e47 or 5.9999999999999999e83 < z Initial program 73.1%
*-commutative73.1%
Simplified73.1%
Taylor expanded in z around inf 73.1%
mul-1-neg73.1%
unsub-neg73.1%
Simplified73.1%
Taylor expanded in y around inf 100.0%
if -1.39999999999999994e47 < z < 5.9999999999999999e83Initial program 99.8%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- 1.0 (/ (* z y) x))))
(if (<= x -290000000.0)
(+ 1.0 (/ -1.0 x))
(if (<= x -1.4e-173)
t_1
(if (<= x 2.15e-120)
(/ (/ y t) (+ x 1.0))
(if (<= x 1.3e-34)
t_1
(if (<= x 780000.0)
(/ y (* t (+ x 1.0)))
(if (<= x 4.15e+40)
(+ 1.0 (/ (+ (/ y t) -1.0) x))
(if (<= x 9e+81) (- 1.0 (* (/ z x) (/ y x))) 1.0)))))))))
double code(double x, double y, double z, double t) {
double t_1 = 1.0 - ((z * y) / x);
double tmp;
if (x <= -290000000.0) {
tmp = 1.0 + (-1.0 / x);
} else if (x <= -1.4e-173) {
tmp = t_1;
} else if (x <= 2.15e-120) {
tmp = (y / t) / (x + 1.0);
} else if (x <= 1.3e-34) {
tmp = t_1;
} else if (x <= 780000.0) {
tmp = y / (t * (x + 1.0));
} else if (x <= 4.15e+40) {
tmp = 1.0 + (((y / t) + -1.0) / x);
} else if (x <= 9e+81) {
tmp = 1.0 - ((z / x) * (y / x));
} else {
tmp = 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) :: t_1
real(8) :: tmp
t_1 = 1.0d0 - ((z * y) / x)
if (x <= (-290000000.0d0)) then
tmp = 1.0d0 + ((-1.0d0) / x)
else if (x <= (-1.4d-173)) then
tmp = t_1
else if (x <= 2.15d-120) then
tmp = (y / t) / (x + 1.0d0)
else if (x <= 1.3d-34) then
tmp = t_1
else if (x <= 780000.0d0) then
tmp = y / (t * (x + 1.0d0))
else if (x <= 4.15d+40) then
tmp = 1.0d0 + (((y / t) + (-1.0d0)) / x)
else if (x <= 9d+81) then
tmp = 1.0d0 - ((z / x) * (y / x))
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = 1.0 - ((z * y) / x);
double tmp;
if (x <= -290000000.0) {
tmp = 1.0 + (-1.0 / x);
} else if (x <= -1.4e-173) {
tmp = t_1;
} else if (x <= 2.15e-120) {
tmp = (y / t) / (x + 1.0);
} else if (x <= 1.3e-34) {
tmp = t_1;
} else if (x <= 780000.0) {
tmp = y / (t * (x + 1.0));
} else if (x <= 4.15e+40) {
tmp = 1.0 + (((y / t) + -1.0) / x);
} else if (x <= 9e+81) {
tmp = 1.0 - ((z / x) * (y / x));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): t_1 = 1.0 - ((z * y) / x) tmp = 0 if x <= -290000000.0: tmp = 1.0 + (-1.0 / x) elif x <= -1.4e-173: tmp = t_1 elif x <= 2.15e-120: tmp = (y / t) / (x + 1.0) elif x <= 1.3e-34: tmp = t_1 elif x <= 780000.0: tmp = y / (t * (x + 1.0)) elif x <= 4.15e+40: tmp = 1.0 + (((y / t) + -1.0) / x) elif x <= 9e+81: tmp = 1.0 - ((z / x) * (y / x)) else: tmp = 1.0 return tmp
function code(x, y, z, t) t_1 = Float64(1.0 - Float64(Float64(z * y) / x)) tmp = 0.0 if (x <= -290000000.0) tmp = Float64(1.0 + Float64(-1.0 / x)); elseif (x <= -1.4e-173) tmp = t_1; elseif (x <= 2.15e-120) tmp = Float64(Float64(y / t) / Float64(x + 1.0)); elseif (x <= 1.3e-34) tmp = t_1; elseif (x <= 780000.0) tmp = Float64(y / Float64(t * Float64(x + 1.0))); elseif (x <= 4.15e+40) tmp = Float64(1.0 + Float64(Float64(Float64(y / t) + -1.0) / x)); elseif (x <= 9e+81) tmp = Float64(1.0 - Float64(Float64(z / x) * Float64(y / x))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 1.0 - ((z * y) / x); tmp = 0.0; if (x <= -290000000.0) tmp = 1.0 + (-1.0 / x); elseif (x <= -1.4e-173) tmp = t_1; elseif (x <= 2.15e-120) tmp = (y / t) / (x + 1.0); elseif (x <= 1.3e-34) tmp = t_1; elseif (x <= 780000.0) tmp = y / (t * (x + 1.0)); elseif (x <= 4.15e+40) tmp = 1.0 + (((y / t) + -1.0) / x); elseif (x <= 9e+81) tmp = 1.0 - ((z / x) * (y / x)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 - N[(N[(z * y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -290000000.0], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.4e-173], t$95$1, If[LessEqual[x, 2.15e-120], N[(N[(y / t), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.3e-34], t$95$1, If[LessEqual[x, 780000.0], N[(y / N[(t * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.15e+40], N[(1.0 + N[(N[(N[(y / t), $MachinePrecision] + -1.0), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 9e+81], N[(1.0 - N[(N[(z / x), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 - \frac{z \cdot y}{x}\\
\mathbf{if}\;x \leq -290000000:\\
\;\;\;\;1 + \frac{-1}{x}\\
\mathbf{elif}\;x \leq -1.4 \cdot 10^{-173}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 2.15 \cdot 10^{-120}:\\
\;\;\;\;\frac{\frac{y}{t}}{x + 1}\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{-34}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 780000:\\
\;\;\;\;\frac{y}{t \cdot \left(x + 1\right)}\\
\mathbf{elif}\;x \leq 4.15 \cdot 10^{+40}:\\
\;\;\;\;1 + \frac{\frac{y}{t} + -1}{x}\\
\mathbf{elif}\;x \leq 9 \cdot 10^{+81}:\\
\;\;\;\;1 - \frac{z}{x} \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -2.9e8Initial program 91.5%
*-commutative91.5%
Simplified91.5%
Taylor expanded in t around inf 100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
if -2.9e8 < x < -1.39999999999999995e-173 or 2.14999999999999991e-120 < x < 1.3e-34Initial program 93.7%
*-commutative93.7%
Simplified93.7%
Taylor expanded in t around 0 61.2%
mul-1-neg61.2%
unsub-neg61.2%
associate-/l*61.1%
+-commutative61.1%
Simplified61.1%
Taylor expanded in y around 0 61.2%
mul-1-neg61.2%
sub-neg61.2%
times-frac57.2%
+-commutative57.2%
Simplified57.2%
Taylor expanded in x around 0 60.1%
if -1.39999999999999995e-173 < x < 2.14999999999999991e-120Initial program 80.2%
*-commutative80.2%
Simplified80.2%
Taylor expanded in z around inf 81.6%
Taylor expanded in y around inf 68.8%
associate-/r*68.8%
+-commutative68.8%
Simplified68.8%
if 1.3e-34 < x < 7.8e5Initial program 87.2%
*-commutative87.2%
Simplified87.2%
Taylor expanded in z around inf 78.8%
Taylor expanded in y around inf 47.1%
if 7.8e5 < x < 4.1499999999999999e40Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in z around inf 95.5%
Taylor expanded in x around -inf 95.5%
mul-1-neg95.5%
unsub-neg95.5%
mul-1-neg95.5%
sub-neg95.5%
Simplified95.5%
if 4.1499999999999999e40 < x < 9.00000000000000034e81Initial program 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in t around 0 86.6%
mul-1-neg86.6%
unsub-neg86.6%
associate-/l*86.6%
+-commutative86.6%
Simplified86.6%
Taylor expanded in y around 0 86.6%
mul-1-neg86.6%
sub-neg86.6%
times-frac86.6%
+-commutative86.6%
Simplified86.6%
Taylor expanded in x around inf 86.6%
if 9.00000000000000034e81 < x Initial program 87.9%
*-commutative87.9%
Simplified87.9%
Taylor expanded in z around inf 87.9%
mul-1-neg87.9%
unsub-neg87.9%
Simplified87.9%
Taylor expanded in y around inf 100.0%
Taylor expanded in x around inf 95.7%
Final simplification79.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ y t)) (+ x 1.0))))
(if (<= x -2.8e-17)
1.0
(if (<= x 6.7e-105)
t_1
(if (<= x 7e-48)
(+ 1.0 (* (/ y x) (/ z (- -1.0 x))))
(if (<= x 1.95e+40) t_1 1.0))))))
double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double tmp;
if (x <= -2.8e-17) {
tmp = 1.0;
} else if (x <= 6.7e-105) {
tmp = t_1;
} else if (x <= 7e-48) {
tmp = 1.0 + ((y / x) * (z / (-1.0 - x)));
} else if (x <= 1.95e+40) {
tmp = t_1;
} else {
tmp = 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) :: t_1
real(8) :: tmp
t_1 = (x + (y / t)) / (x + 1.0d0)
if (x <= (-2.8d-17)) then
tmp = 1.0d0
else if (x <= 6.7d-105) then
tmp = t_1
else if (x <= 7d-48) then
tmp = 1.0d0 + ((y / x) * (z / ((-1.0d0) - x)))
else if (x <= 1.95d+40) then
tmp = t_1
else
tmp = 1.0d0
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 tmp;
if (x <= -2.8e-17) {
tmp = 1.0;
} else if (x <= 6.7e-105) {
tmp = t_1;
} else if (x <= 7e-48) {
tmp = 1.0 + ((y / x) * (z / (-1.0 - x)));
} else if (x <= 1.95e+40) {
tmp = t_1;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x + (y / t)) / (x + 1.0) tmp = 0 if x <= -2.8e-17: tmp = 1.0 elif x <= 6.7e-105: tmp = t_1 elif x <= 7e-48: tmp = 1.0 + ((y / x) * (z / (-1.0 - x))) elif x <= 1.95e+40: tmp = t_1 else: tmp = 1.0 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)) tmp = 0.0 if (x <= -2.8e-17) tmp = 1.0; elseif (x <= 6.7e-105) tmp = t_1; elseif (x <= 7e-48) tmp = Float64(1.0 + Float64(Float64(y / x) * Float64(z / Float64(-1.0 - x)))); elseif (x <= 1.95e+40) tmp = t_1; else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x + (y / t)) / (x + 1.0); tmp = 0.0; if (x <= -2.8e-17) tmp = 1.0; elseif (x <= 6.7e-105) tmp = t_1; elseif (x <= 7e-48) tmp = 1.0 + ((y / x) * (z / (-1.0 - x))); elseif (x <= 1.95e+40) tmp = t_1; else tmp = 1.0; 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]}, If[LessEqual[x, -2.8e-17], 1.0, If[LessEqual[x, 6.7e-105], t$95$1, If[LessEqual[x, 7e-48], N[(1.0 + N[(N[(y / x), $MachinePrecision] * N[(z / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.95e+40], t$95$1, 1.0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{if}\;x \leq -2.8 \cdot 10^{-17}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 6.7 \cdot 10^{-105}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 7 \cdot 10^{-48}:\\
\;\;\;\;1 + \frac{y}{x} \cdot \frac{z}{-1 - x}\\
\mathbf{elif}\;x \leq 1.95 \cdot 10^{+40}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -2.7999999999999999e-17 or 1.95e40 < x Initial program 91.0%
*-commutative91.0%
Simplified91.0%
Taylor expanded in z around inf 91.0%
mul-1-neg91.0%
unsub-neg91.0%
Simplified91.0%
Taylor expanded in y around inf 98.0%
Taylor expanded in x around inf 95.7%
if -2.7999999999999999e-17 < x < 6.7000000000000002e-105 or 6.99999999999999982e-48 < x < 1.95e40Initial program 84.4%
*-commutative84.4%
Simplified84.4%
Taylor expanded in z around inf 74.1%
if 6.7000000000000002e-105 < x < 6.99999999999999982e-48Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around 0 81.8%
mul-1-neg81.8%
unsub-neg81.8%
associate-/l*81.6%
+-commutative81.6%
Simplified81.6%
Taylor expanded in y around 0 81.8%
mul-1-neg81.8%
sub-neg81.8%
times-frac81.8%
+-commutative81.8%
Simplified81.8%
Final simplification84.7%
(FPCore (x y z t)
:precision binary64
(if (<= x -380000000.0)
(+ 1.0 (/ -1.0 x))
(if (<= x -7e-173)
(- 1.0 (/ (* z y) x))
(if (<= x 1.85e-125)
(/ (/ y t) (+ x 1.0))
(if (<= x 1.35e-46) (- 1.0 (* z (/ y x))) (/ x (+ x 1.0)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -380000000.0) {
tmp = 1.0 + (-1.0 / x);
} else if (x <= -7e-173) {
tmp = 1.0 - ((z * y) / x);
} else if (x <= 1.85e-125) {
tmp = (y / t) / (x + 1.0);
} else if (x <= 1.35e-46) {
tmp = 1.0 - (z * (y / x));
} 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 <= (-380000000.0d0)) then
tmp = 1.0d0 + ((-1.0d0) / x)
else if (x <= (-7d-173)) then
tmp = 1.0d0 - ((z * y) / x)
else if (x <= 1.85d-125) then
tmp = (y / t) / (x + 1.0d0)
else if (x <= 1.35d-46) then
tmp = 1.0d0 - (z * (y / x))
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 <= -380000000.0) {
tmp = 1.0 + (-1.0 / x);
} else if (x <= -7e-173) {
tmp = 1.0 - ((z * y) / x);
} else if (x <= 1.85e-125) {
tmp = (y / t) / (x + 1.0);
} else if (x <= 1.35e-46) {
tmp = 1.0 - (z * (y / x));
} else {
tmp = x / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -380000000.0: tmp = 1.0 + (-1.0 / x) elif x <= -7e-173: tmp = 1.0 - ((z * y) / x) elif x <= 1.85e-125: tmp = (y / t) / (x + 1.0) elif x <= 1.35e-46: tmp = 1.0 - (z * (y / x)) else: tmp = x / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -380000000.0) tmp = Float64(1.0 + Float64(-1.0 / x)); elseif (x <= -7e-173) tmp = Float64(1.0 - Float64(Float64(z * y) / x)); elseif (x <= 1.85e-125) tmp = Float64(Float64(y / t) / Float64(x + 1.0)); elseif (x <= 1.35e-46) tmp = Float64(1.0 - Float64(z * Float64(y / x))); 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 <= -380000000.0) tmp = 1.0 + (-1.0 / x); elseif (x <= -7e-173) tmp = 1.0 - ((z * y) / x); elseif (x <= 1.85e-125) tmp = (y / t) / (x + 1.0); elseif (x <= 1.35e-46) tmp = 1.0 - (z * (y / x)); else tmp = x / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -380000000.0], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -7e-173], N[(1.0 - N[(N[(z * y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.85e-125], N[(N[(y / t), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.35e-46], N[(1.0 - N[(z * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -380000000:\\
\;\;\;\;1 + \frac{-1}{x}\\
\mathbf{elif}\;x \leq -7 \cdot 10^{-173}:\\
\;\;\;\;1 - \frac{z \cdot y}{x}\\
\mathbf{elif}\;x \leq 1.85 \cdot 10^{-125}:\\
\;\;\;\;\frac{\frac{y}{t}}{x + 1}\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{-46}:\\
\;\;\;\;1 - z \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + 1}\\
\end{array}
\end{array}
if x < -3.8e8Initial program 91.5%
*-commutative91.5%
Simplified91.5%
Taylor expanded in t around inf 100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
if -3.8e8 < x < -7.00000000000000029e-173Initial program 90.3%
*-commutative90.3%
Simplified90.3%
Taylor expanded in t around 0 56.1%
mul-1-neg56.1%
unsub-neg56.1%
associate-/l*56.0%
+-commutative56.0%
Simplified56.0%
Taylor expanded in y around 0 56.1%
mul-1-neg56.1%
sub-neg56.1%
times-frac49.9%
+-commutative49.9%
Simplified49.9%
Taylor expanded in x around 0 54.5%
if -7.00000000000000029e-173 < x < 1.85e-125Initial program 80.2%
*-commutative80.2%
Simplified80.2%
Taylor expanded in z around inf 81.6%
Taylor expanded in y around inf 68.8%
associate-/r*68.8%
+-commutative68.8%
Simplified68.8%
if 1.85e-125 < x < 1.35e-46Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around 0 75.9%
mul-1-neg75.9%
unsub-neg75.9%
associate-/l*75.8%
+-commutative75.8%
Simplified75.8%
Taylor expanded in y around 0 75.9%
mul-1-neg75.9%
sub-neg75.9%
times-frac75.9%
+-commutative75.9%
Simplified75.9%
Taylor expanded in x around 0 75.9%
if 1.35e-46 < x Initial program 90.4%
*-commutative90.4%
Simplified90.4%
Taylor expanded in t around inf 78.6%
+-commutative78.6%
Simplified78.6%
Final simplification77.6%
(FPCore (x y z t)
:precision binary64
(if (<= x -15500000000.0)
(+ 1.0 (/ -1.0 x))
(if (<= x -7e-173)
(- 1.0 (/ (* z y) x))
(if (<= x 4.5e-125)
(/ y (* t (+ x 1.0)))
(if (<= x 1.45e-46) (- 1.0 (* z (/ y x))) (/ x (+ x 1.0)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -15500000000.0) {
tmp = 1.0 + (-1.0 / x);
} else if (x <= -7e-173) {
tmp = 1.0 - ((z * y) / x);
} else if (x <= 4.5e-125) {
tmp = y / (t * (x + 1.0));
} else if (x <= 1.45e-46) {
tmp = 1.0 - (z * (y / x));
} 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 <= (-15500000000.0d0)) then
tmp = 1.0d0 + ((-1.0d0) / x)
else if (x <= (-7d-173)) then
tmp = 1.0d0 - ((z * y) / x)
else if (x <= 4.5d-125) then
tmp = y / (t * (x + 1.0d0))
else if (x <= 1.45d-46) then
tmp = 1.0d0 - (z * (y / x))
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 <= -15500000000.0) {
tmp = 1.0 + (-1.0 / x);
} else if (x <= -7e-173) {
tmp = 1.0 - ((z * y) / x);
} else if (x <= 4.5e-125) {
tmp = y / (t * (x + 1.0));
} else if (x <= 1.45e-46) {
tmp = 1.0 - (z * (y / x));
} else {
tmp = x / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -15500000000.0: tmp = 1.0 + (-1.0 / x) elif x <= -7e-173: tmp = 1.0 - ((z * y) / x) elif x <= 4.5e-125: tmp = y / (t * (x + 1.0)) elif x <= 1.45e-46: tmp = 1.0 - (z * (y / x)) else: tmp = x / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -15500000000.0) tmp = Float64(1.0 + Float64(-1.0 / x)); elseif (x <= -7e-173) tmp = Float64(1.0 - Float64(Float64(z * y) / x)); elseif (x <= 4.5e-125) tmp = Float64(y / Float64(t * Float64(x + 1.0))); elseif (x <= 1.45e-46) tmp = Float64(1.0 - Float64(z * Float64(y / x))); 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 <= -15500000000.0) tmp = 1.0 + (-1.0 / x); elseif (x <= -7e-173) tmp = 1.0 - ((z * y) / x); elseif (x <= 4.5e-125) tmp = y / (t * (x + 1.0)); elseif (x <= 1.45e-46) tmp = 1.0 - (z * (y / x)); else tmp = x / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -15500000000.0], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -7e-173], N[(1.0 - N[(N[(z * y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.5e-125], N[(y / N[(t * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.45e-46], N[(1.0 - N[(z * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -15500000000:\\
\;\;\;\;1 + \frac{-1}{x}\\
\mathbf{elif}\;x \leq -7 \cdot 10^{-173}:\\
\;\;\;\;1 - \frac{z \cdot y}{x}\\
\mathbf{elif}\;x \leq 4.5 \cdot 10^{-125}:\\
\;\;\;\;\frac{y}{t \cdot \left(x + 1\right)}\\
\mathbf{elif}\;x \leq 1.45 \cdot 10^{-46}:\\
\;\;\;\;1 - z \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + 1}\\
\end{array}
\end{array}
if x < -1.55e10Initial program 91.5%
*-commutative91.5%
Simplified91.5%
Taylor expanded in t around inf 100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 100.0%
if -1.55e10 < x < -7.00000000000000029e-173Initial program 90.3%
*-commutative90.3%
Simplified90.3%
Taylor expanded in t around 0 56.1%
mul-1-neg56.1%
unsub-neg56.1%
associate-/l*56.0%
+-commutative56.0%
Simplified56.0%
Taylor expanded in y around 0 56.1%
mul-1-neg56.1%
sub-neg56.1%
times-frac49.9%
+-commutative49.9%
Simplified49.9%
Taylor expanded in x around 0 54.5%
if -7.00000000000000029e-173 < x < 4.50000000000000012e-125Initial program 80.2%
*-commutative80.2%
Simplified80.2%
Taylor expanded in z around inf 81.6%
Taylor expanded in y around inf 68.8%
if 4.50000000000000012e-125 < x < 1.45000000000000002e-46Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around 0 75.9%
mul-1-neg75.9%
unsub-neg75.9%
associate-/l*75.8%
+-commutative75.8%
Simplified75.8%
Taylor expanded in y around 0 75.9%
mul-1-neg75.9%
sub-neg75.9%
times-frac75.9%
+-commutative75.9%
Simplified75.9%
Taylor expanded in x around 0 75.9%
if 1.45000000000000002e-46 < x Initial program 90.4%
*-commutative90.4%
Simplified90.4%
Taylor expanded in t around inf 78.6%
+-commutative78.6%
Simplified78.6%
Final simplification77.6%
(FPCore (x y z t) :precision binary64 (if (or (<= y -5.5e-161) (not (<= y 4.9e-42))) (/ (+ x (/ y (- t (/ x z)))) (+ x 1.0)) (/ (+ x (/ x (- x (* z t)))) (+ x 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -5.5e-161) || !(y <= 4.9e-42)) {
tmp = (x + (y / (t - (x / z)))) / (x + 1.0);
} else {
tmp = (x + (x / (x - (z * t)))) / (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 ((y <= (-5.5d-161)) .or. (.not. (y <= 4.9d-42))) then
tmp = (x + (y / (t - (x / z)))) / (x + 1.0d0)
else
tmp = (x + (x / (x - (z * t)))) / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -5.5e-161) || !(y <= 4.9e-42)) {
tmp = (x + (y / (t - (x / z)))) / (x + 1.0);
} else {
tmp = (x + (x / (x - (z * t)))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -5.5e-161) or not (y <= 4.9e-42): tmp = (x + (y / (t - (x / z)))) / (x + 1.0) else: tmp = (x + (x / (x - (z * t)))) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -5.5e-161) || !(y <= 4.9e-42)) tmp = Float64(Float64(x + Float64(y / Float64(t - Float64(x / z)))) / Float64(x + 1.0)); else tmp = Float64(Float64(x + Float64(x / Float64(x - Float64(z * t)))) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -5.5e-161) || ~((y <= 4.9e-42))) tmp = (x + (y / (t - (x / z)))) / (x + 1.0); else tmp = (x + (x / (x - (z * t)))) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -5.5e-161], N[Not[LessEqual[y, 4.9e-42]], $MachinePrecision]], N[(N[(x + N[(y / N[(t - N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(x / N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.5 \cdot 10^{-161} \lor \neg \left(y \leq 4.9 \cdot 10^{-42}\right):\\
\;\;\;\;\frac{x + \frac{y}{t - \frac{x}{z}}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{x}{x - z \cdot t}}{x + 1}\\
\end{array}
\end{array}
if y < -5.5e-161 or 4.9e-42 < y Initial program 83.6%
*-commutative83.6%
Simplified83.6%
Taylor expanded in z around inf 83.6%
mul-1-neg83.6%
unsub-neg83.6%
Simplified83.6%
Taylor expanded in y around inf 93.0%
if -5.5e-161 < y < 4.9e-42Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 95.1%
+-commutative95.1%
Simplified95.1%
Final simplification93.6%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.6e-219) (not (<= z 1.65e-233))) (/ (+ x (/ y (- t (/ x z)))) (+ x 1.0)) (- 1.0 (* y (/ z x)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.6e-219) || !(z <= 1.65e-233)) {
tmp = (x + (y / (t - (x / z)))) / (x + 1.0);
} else {
tmp = 1.0 - (y * (z / 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 ((z <= (-1.6d-219)) .or. (.not. (z <= 1.65d-233))) then
tmp = (x + (y / (t - (x / z)))) / (x + 1.0d0)
else
tmp = 1.0d0 - (y * (z / x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.6e-219) || !(z <= 1.65e-233)) {
tmp = (x + (y / (t - (x / z)))) / (x + 1.0);
} else {
tmp = 1.0 - (y * (z / x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.6e-219) or not (z <= 1.65e-233): tmp = (x + (y / (t - (x / z)))) / (x + 1.0) else: tmp = 1.0 - (y * (z / x)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.6e-219) || !(z <= 1.65e-233)) tmp = Float64(Float64(x + Float64(y / Float64(t - Float64(x / z)))) / Float64(x + 1.0)); else tmp = Float64(1.0 - Float64(y * Float64(z / x))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.6e-219) || ~((z <= 1.65e-233))) tmp = (x + (y / (t - (x / z)))) / (x + 1.0); else tmp = 1.0 - (y * (z / x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.6e-219], N[Not[LessEqual[z, 1.65e-233]], $MachinePrecision]], N[(N[(x + N[(y / N[(t - N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(y * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{-219} \lor \neg \left(z \leq 1.65 \cdot 10^{-233}\right):\\
\;\;\;\;\frac{x + \frac{y}{t - \frac{x}{z}}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1 - y \cdot \frac{z}{x}\\
\end{array}
\end{array}
if z < -1.59999999999999999e-219 or 1.65e-233 < z Initial program 86.6%
*-commutative86.6%
Simplified86.6%
Taylor expanded in z around inf 86.6%
mul-1-neg86.6%
unsub-neg86.6%
Simplified86.6%
Taylor expanded in y around inf 92.6%
if -1.59999999999999999e-219 < z < 1.65e-233Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around 0 91.6%
mul-1-neg91.6%
unsub-neg91.6%
associate-/l*91.6%
+-commutative91.6%
Simplified91.6%
Taylor expanded in y around 0 91.6%
mul-1-neg91.6%
sub-neg91.6%
times-frac85.7%
+-commutative85.7%
Simplified85.7%
Taylor expanded in x around 0 91.6%
associate-/l*91.6%
Simplified91.6%
Final simplification92.5%
(FPCore (x y z t) :precision binary64 (if (or (<= t -2.3e-27) (not (<= t 1.15e-157))) (/ (+ x (/ y t)) (+ x 1.0)) (/ (+ 1.0 (- x (* y (/ z x)))) (+ x 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.3e-27) || !(t <= 1.15e-157)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = (1.0 + (x - (y * (z / 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 ((t <= (-2.3d-27)) .or. (.not. (t <= 1.15d-157))) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = (1.0d0 + (x - (y * (z / 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 ((t <= -2.3e-27) || !(t <= 1.15e-157)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = (1.0 + (x - (y * (z / x)))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -2.3e-27) or not (t <= 1.15e-157): tmp = (x + (y / t)) / (x + 1.0) else: tmp = (1.0 + (x - (y * (z / x)))) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -2.3e-27) || !(t <= 1.15e-157)) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = Float64(Float64(1.0 + Float64(x - Float64(y * Float64(z / x)))) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -2.3e-27) || ~((t <= 1.15e-157))) tmp = (x + (y / t)) / (x + 1.0); else tmp = (1.0 + (x - (y * (z / x)))) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -2.3e-27], N[Not[LessEqual[t, 1.15e-157]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(x - N[(y * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.3 \cdot 10^{-27} \lor \neg \left(t \leq 1.15 \cdot 10^{-157}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \left(x - y \cdot \frac{z}{x}\right)}{x + 1}\\
\end{array}
\end{array}
if t < -2.2999999999999999e-27 or 1.14999999999999994e-157 < t Initial program 84.2%
*-commutative84.2%
Simplified84.2%
Taylor expanded in z around inf 85.1%
if -2.2999999999999999e-27 < t < 1.14999999999999994e-157Initial program 95.7%
*-commutative95.7%
Simplified95.7%
Taylor expanded in t around 0 78.4%
mul-1-neg78.4%
unsub-neg78.4%
associate-/l*80.6%
+-commutative80.6%
Simplified80.6%
Final simplification83.5%
(FPCore (x y z t) :precision binary64 (if (or (<= z -6e-94) (not (<= z 8.5e-230))) (/ (+ x (/ y t)) (+ x 1.0)) (- 1.0 (* y (/ z x)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -6e-94) || !(z <= 8.5e-230)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0 - (y * (z / 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 ((z <= (-6d-94)) .or. (.not. (z <= 8.5d-230))) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = 1.0d0 - (y * (z / x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -6e-94) || !(z <= 8.5e-230)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0 - (y * (z / x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -6e-94) or not (z <= 8.5e-230): tmp = (x + (y / t)) / (x + 1.0) else: tmp = 1.0 - (y * (z / x)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -6e-94) || !(z <= 8.5e-230)) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = Float64(1.0 - Float64(y * Float64(z / x))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -6e-94) || ~((z <= 8.5e-230))) tmp = (x + (y / t)) / (x + 1.0); else tmp = 1.0 - (y * (z / x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -6e-94], N[Not[LessEqual[z, 8.5e-230]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(y * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{-94} \lor \neg \left(z \leq 8.5 \cdot 10^{-230}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1 - y \cdot \frac{z}{x}\\
\end{array}
\end{array}
if z < -6.0000000000000003e-94 or 8.4999999999999998e-230 < z Initial program 84.9%
*-commutative84.9%
Simplified84.9%
Taylor expanded in z around inf 80.5%
if -6.0000000000000003e-94 < z < 8.4999999999999998e-230Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around 0 83.2%
mul-1-neg83.2%
unsub-neg83.2%
associate-/l*83.2%
+-commutative83.2%
Simplified83.2%
Taylor expanded in y around 0 83.2%
mul-1-neg83.2%
sub-neg83.2%
times-frac78.1%
+-commutative78.1%
Simplified78.1%
Taylor expanded in x around 0 82.0%
associate-/l*82.0%
Simplified82.0%
Final simplification80.9%
(FPCore (x y z t) :precision binary64 (if (or (<= z -5.5e+26) (not (<= z 3.5e+85))) (/ x (+ x 1.0)) (- 1.0 (/ (* z y) x))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5.5e+26) || !(z <= 3.5e+85)) {
tmp = x / (x + 1.0);
} else {
tmp = 1.0 - ((z * y) / 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 ((z <= (-5.5d+26)) .or. (.not. (z <= 3.5d+85))) then
tmp = x / (x + 1.0d0)
else
tmp = 1.0d0 - ((z * y) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5.5e+26) || !(z <= 3.5e+85)) {
tmp = x / (x + 1.0);
} else {
tmp = 1.0 - ((z * y) / x);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -5.5e+26) or not (z <= 3.5e+85): tmp = x / (x + 1.0) else: tmp = 1.0 - ((z * y) / x) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -5.5e+26) || !(z <= 3.5e+85)) tmp = Float64(x / Float64(x + 1.0)); else tmp = Float64(1.0 - Float64(Float64(z * y) / x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -5.5e+26) || ~((z <= 3.5e+85))) tmp = x / (x + 1.0); else tmp = 1.0 - ((z * y) / x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -5.5e+26], N[Not[LessEqual[z, 3.5e+85]], $MachinePrecision]], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(N[(z * y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+26} \lor \neg \left(z \leq 3.5 \cdot 10^{+85}\right):\\
\;\;\;\;\frac{x}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{z \cdot y}{x}\\
\end{array}
\end{array}
if z < -5.4999999999999997e26 or 3.50000000000000005e85 < z Initial program 73.8%
*-commutative73.8%
Simplified73.8%
Taylor expanded in t around inf 58.5%
+-commutative58.5%
Simplified58.5%
if -5.4999999999999997e26 < z < 3.50000000000000005e85Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around 0 72.2%
mul-1-neg72.2%
unsub-neg72.2%
associate-/l*72.2%
+-commutative72.2%
Simplified72.2%
Taylor expanded in y around 0 72.2%
mul-1-neg72.2%
sub-neg72.2%
times-frac70.1%
+-commutative70.1%
Simplified70.1%
Taylor expanded in x around 0 68.1%
Final simplification63.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -7.4e+25) (not (<= z 6.8e-79))) (/ x (+ x 1.0)) (- 1.0 (* y (/ z x)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -7.4e+25) || !(z <= 6.8e-79)) {
tmp = x / (x + 1.0);
} else {
tmp = 1.0 - (y * (z / 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 ((z <= (-7.4d+25)) .or. (.not. (z <= 6.8d-79))) then
tmp = x / (x + 1.0d0)
else
tmp = 1.0d0 - (y * (z / x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -7.4e+25) || !(z <= 6.8e-79)) {
tmp = x / (x + 1.0);
} else {
tmp = 1.0 - (y * (z / x));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -7.4e+25) or not (z <= 6.8e-79): tmp = x / (x + 1.0) else: tmp = 1.0 - (y * (z / x)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -7.4e+25) || !(z <= 6.8e-79)) tmp = Float64(x / Float64(x + 1.0)); else tmp = Float64(1.0 - Float64(y * Float64(z / x))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -7.4e+25) || ~((z <= 6.8e-79))) tmp = x / (x + 1.0); else tmp = 1.0 - (y * (z / x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -7.4e+25], N[Not[LessEqual[z, 6.8e-79]], $MachinePrecision]], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(y * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.4 \cdot 10^{+25} \lor \neg \left(z \leq 6.8 \cdot 10^{-79}\right):\\
\;\;\;\;\frac{x}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1 - y \cdot \frac{z}{x}\\
\end{array}
\end{array}
if z < -7.3999999999999998e25 or 6.79999999999999951e-79 < z Initial program 79.3%
*-commutative79.3%
Simplified79.3%
Taylor expanded in t around inf 56.9%
+-commutative56.9%
Simplified56.9%
if -7.3999999999999998e25 < z < 6.79999999999999951e-79Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around 0 75.1%
mul-1-neg75.1%
unsub-neg75.1%
associate-/l*75.1%
+-commutative75.1%
Simplified75.1%
Taylor expanded in y around 0 75.1%
mul-1-neg75.1%
sub-neg75.1%
times-frac72.4%
+-commutative72.4%
Simplified72.4%
Taylor expanded in x around 0 72.6%
associate-/l*72.6%
Simplified72.6%
Final simplification63.8%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.85e-22) (not (<= z 1.6e-79))) (/ x (+ x 1.0)) 1.0))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.85e-22) || !(z <= 1.6e-79)) {
tmp = x / (x + 1.0);
} else {
tmp = 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 <= (-1.85d-22)) .or. (.not. (z <= 1.6d-79))) then
tmp = x / (x + 1.0d0)
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.85e-22) || !(z <= 1.6e-79)) {
tmp = x / (x + 1.0);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.85e-22) or not (z <= 1.6e-79): tmp = x / (x + 1.0) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.85e-22) || !(z <= 1.6e-79)) tmp = Float64(x / Float64(x + 1.0)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.85e-22) || ~((z <= 1.6e-79))) tmp = x / (x + 1.0); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.85e-22], N[Not[LessEqual[z, 1.6e-79]], $MachinePrecision]], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{-22} \lor \neg \left(z \leq 1.6 \cdot 10^{-79}\right):\\
\;\;\;\;\frac{x}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if z < -1.85e-22 or 1.59999999999999994e-79 < z Initial program 80.5%
*-commutative80.5%
Simplified80.5%
Taylor expanded in t around inf 57.8%
+-commutative57.8%
Simplified57.8%
if -1.85e-22 < z < 1.59999999999999994e-79Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around inf 99.8%
mul-1-neg99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in y around inf 76.2%
Taylor expanded in x around inf 63.8%
Final simplification60.2%
(FPCore (x y z t) :precision binary64 1.0)
double code(double x, double y, double z, double t) {
return 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 = 1.0d0
end function
public static double code(double x, double y, double z, double t) {
return 1.0;
}
def code(x, y, z, t): return 1.0
function code(x, y, z, t) return 1.0 end
function tmp = code(x, y, z, t) tmp = 1.0; end
code[x_, y_, z_, t_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 88.3%
*-commutative88.3%
Simplified88.3%
Taylor expanded in z around inf 88.3%
mul-1-neg88.3%
unsub-neg88.3%
Simplified88.3%
Taylor expanded in y around inf 88.7%
Taylor expanded in x around inf 54.5%
(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 2024085
(FPCore (x y z t)
:name "Diagrams.Trail:splitAtParam from diagrams-lib-1.3.0.3, A"
:precision binary64
:alt
(/ (+ x (- (/ y (- t (/ x z))) (/ x (- (* t z) x)))) (+ x 1.0))
(/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))