
(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 14 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
(let* ((t_1 (/ x (+ x 1.0))) (t_2 (- (* z t) x)))
(if (<= (/ (- (/ (- x (* y z)) t_2) x) (- -1.0 x)) INFINITY)
(+ t_1 (+ (* y (/ z (* t_2 (+ x 1.0)))) (/ t_1 (- x (* z t)))))
(+ t_1 (/ y (* t (+ x 1.0)))))))
double code(double x, double y, double z, double t) {
double t_1 = x / (x + 1.0);
double t_2 = (z * t) - x;
double tmp;
if (((((x - (y * z)) / t_2) - x) / (-1.0 - x)) <= ((double) INFINITY)) {
tmp = t_1 + ((y * (z / (t_2 * (x + 1.0)))) + (t_1 / (x - (z * t))));
} else {
tmp = t_1 + (y / (t * (x + 1.0)));
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = x / (x + 1.0);
double t_2 = (z * t) - x;
double tmp;
if (((((x - (y * z)) / t_2) - x) / (-1.0 - x)) <= Double.POSITIVE_INFINITY) {
tmp = t_1 + ((y * (z / (t_2 * (x + 1.0)))) + (t_1 / (x - (z * t))));
} else {
tmp = t_1 + (y / (t * (x + 1.0)));
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (x + 1.0) t_2 = (z * t) - x tmp = 0 if ((((x - (y * z)) / t_2) - x) / (-1.0 - x)) <= math.inf: tmp = t_1 + ((y * (z / (t_2 * (x + 1.0)))) + (t_1 / (x - (z * t)))) else: tmp = t_1 + (y / (t * (x + 1.0))) return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(x + 1.0)) t_2 = Float64(Float64(z * t) - x) tmp = 0.0 if (Float64(Float64(Float64(Float64(x - Float64(y * z)) / t_2) - x) / Float64(-1.0 - x)) <= Inf) tmp = Float64(t_1 + Float64(Float64(y * Float64(z / Float64(t_2 * Float64(x + 1.0)))) + Float64(t_1 / Float64(x - Float64(z * t))))); else tmp = Float64(t_1 + Float64(y / Float64(t * Float64(x + 1.0)))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (x + 1.0); t_2 = (z * t) - x; tmp = 0.0; if (((((x - (y * z)) / t_2) - x) / (-1.0 - x)) <= Inf) tmp = t_1 + ((y * (z / (t_2 * (x + 1.0)))) + (t_1 / (x - (z * t)))); else tmp = t_1 + (y / (t * (x + 1.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]}, If[LessEqual[N[(N[(N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision] - x), $MachinePrecision] / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$1 + N[(N[(y * N[(z / N[(t$95$2 * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 / N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(y / N[(t * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{x + 1}\\
t_2 := z \cdot t - x\\
\mathbf{if}\;\frac{\frac{x - y \cdot z}{t\_2} - x}{-1 - x} \leq \infty:\\
\;\;\;\;t\_1 + \left(y \cdot \frac{z}{t\_2 \cdot \left(x + 1\right)} + \frac{t\_1}{x - z \cdot t}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \frac{y}{t \cdot \left(x + 1\right)}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < +inf.0Initial program 94.7%
*-commutative94.7%
Simplified94.7%
Taylor expanded in y around 0 94.7%
associate--l+94.7%
+-commutative94.7%
associate-/l*99.8%
+-commutative99.8%
associate-/r*99.8%
+-commutative99.8%
Simplified99.8%
if +inf.0 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) Initial program 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in t around inf 100.0%
+-commutative100.0%
+-commutative100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in z around inf 100.0%
+-commutative100.0%
+-commutative100.0%
+-commutative100.0%
Simplified100.0%
Final simplification99.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* z t) x)) (t_2 (/ (- (/ (- x (* y z)) t_1) x) (- -1.0 x))))
(if (<= t_2 -1e+16)
(* (/ y (+ x 1.0)) (/ z t_1))
(if (<= t_2 2e+196) t_2 (+ (/ x (+ x 1.0)) (/ y (* t (+ x 1.0))))))))
double code(double x, double y, double z, double t) {
double t_1 = (z * t) - x;
double t_2 = (((x - (y * z)) / t_1) - x) / (-1.0 - x);
double tmp;
if (t_2 <= -1e+16) {
tmp = (y / (x + 1.0)) * (z / t_1);
} else if (t_2 <= 2e+196) {
tmp = t_2;
} else {
tmp = (x / (x + 1.0)) + (y / (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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (z * t) - x
t_2 = (((x - (y * z)) / t_1) - x) / ((-1.0d0) - x)
if (t_2 <= (-1d+16)) then
tmp = (y / (x + 1.0d0)) * (z / t_1)
else if (t_2 <= 2d+196) then
tmp = t_2
else
tmp = (x / (x + 1.0d0)) + (y / (t * (x + 1.0d0)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (z * t) - x;
double t_2 = (((x - (y * z)) / t_1) - x) / (-1.0 - x);
double tmp;
if (t_2 <= -1e+16) {
tmp = (y / (x + 1.0)) * (z / t_1);
} else if (t_2 <= 2e+196) {
tmp = t_2;
} else {
tmp = (x / (x + 1.0)) + (y / (t * (x + 1.0)));
}
return tmp;
}
def code(x, y, z, t): t_1 = (z * t) - x t_2 = (((x - (y * z)) / t_1) - x) / (-1.0 - x) tmp = 0 if t_2 <= -1e+16: tmp = (y / (x + 1.0)) * (z / t_1) elif t_2 <= 2e+196: tmp = t_2 else: tmp = (x / (x + 1.0)) + (y / (t * (x + 1.0))) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z * t) - x) t_2 = Float64(Float64(Float64(Float64(x - Float64(y * z)) / t_1) - x) / Float64(-1.0 - x)) tmp = 0.0 if (t_2 <= -1e+16) tmp = Float64(Float64(y / Float64(x + 1.0)) * Float64(z / t_1)); elseif (t_2 <= 2e+196) tmp = t_2; else tmp = Float64(Float64(x / Float64(x + 1.0)) + Float64(y / Float64(t * Float64(x + 1.0)))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z * t) - x; t_2 = (((x - (y * z)) / t_1) - x) / (-1.0 - x); tmp = 0.0; if (t_2 <= -1e+16) tmp = (y / (x + 1.0)) * (z / t_1); elseif (t_2 <= 2e+196) tmp = t_2; else tmp = (x / (x + 1.0)) + (y / (t * (x + 1.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision] - x), $MachinePrecision] / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+16], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] * N[(z / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+196], t$95$2, N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] + N[(y / N[(t * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot t - x\\
t_2 := \frac{\frac{x - y \cdot z}{t\_1} - x}{-1 - x}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+16}:\\
\;\;\;\;\frac{y}{x + 1} \cdot \frac{z}{t\_1}\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+196}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + 1} + \frac{y}{t \cdot \left(x + 1\right)}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < -1e16Initial program 84.9%
*-commutative84.9%
Simplified84.9%
Taylor expanded in y around inf 84.9%
times-frac99.7%
+-commutative99.7%
*-commutative99.7%
Applied egg-rr99.7%
if -1e16 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 1.9999999999999999e196Initial program 99.8%
if 1.9999999999999999e196 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) Initial program 22.1%
*-commutative22.1%
Simplified22.1%
Taylor expanded in t around inf 96.6%
+-commutative96.6%
+-commutative96.6%
+-commutative96.6%
Simplified96.6%
Taylor expanded in z around inf 96.6%
+-commutative96.6%
+-commutative96.6%
+-commutative96.6%
Simplified96.6%
Final simplification99.4%
(FPCore (x y z t)
:precision binary64
(if (<= z -1.05e+64)
(/ (+ x (/ y t)) (+ x 1.0))
(if (<= z 6.5e-6)
(/ (+ x (/ (* y z) (- (* z t) x))) (+ x 1.0))
(+ (/ x (+ x 1.0)) (/ y (* t (+ x 1.0)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.05e+64) {
tmp = (x + (y / t)) / (x + 1.0);
} else if (z <= 6.5e-6) {
tmp = (x + ((y * z) / ((z * t) - x))) / (x + 1.0);
} else {
tmp = (x / (x + 1.0)) + (y / (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 (z <= (-1.05d+64)) then
tmp = (x + (y / t)) / (x + 1.0d0)
else if (z <= 6.5d-6) then
tmp = (x + ((y * z) / ((z * t) - x))) / (x + 1.0d0)
else
tmp = (x / (x + 1.0d0)) + (y / (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 (z <= -1.05e+64) {
tmp = (x + (y / t)) / (x + 1.0);
} else if (z <= 6.5e-6) {
tmp = (x + ((y * z) / ((z * t) - x))) / (x + 1.0);
} else {
tmp = (x / (x + 1.0)) + (y / (t * (x + 1.0)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.05e+64: tmp = (x + (y / t)) / (x + 1.0) elif z <= 6.5e-6: tmp = (x + ((y * z) / ((z * t) - x))) / (x + 1.0) else: tmp = (x / (x + 1.0)) + (y / (t * (x + 1.0))) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.05e+64) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); elseif (z <= 6.5e-6) tmp = Float64(Float64(x + Float64(Float64(y * z) / Float64(Float64(z * t) - x))) / Float64(x + 1.0)); else tmp = Float64(Float64(x / Float64(x + 1.0)) + Float64(y / Float64(t * Float64(x + 1.0)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.05e+64) tmp = (x + (y / t)) / (x + 1.0); elseif (z <= 6.5e-6) tmp = (x + ((y * z) / ((z * t) - x))) / (x + 1.0); else tmp = (x / (x + 1.0)) + (y / (t * (x + 1.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.05e+64], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.5e-6], N[(N[(x + N[(N[(y * z), $MachinePrecision] / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] + N[(y / N[(t * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{+64}:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-6}:\\
\;\;\;\;\frac{x + \frac{y \cdot z}{z \cdot t - x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + 1} + \frac{y}{t \cdot \left(x + 1\right)}\\
\end{array}
\end{array}
if z < -1.05e64Initial program 75.7%
*-commutative75.7%
Simplified75.7%
Taylor expanded in z around inf 91.7%
if -1.05e64 < z < 6.4999999999999996e-6Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in y around inf 86.1%
*-commutative86.1%
Simplified86.1%
if 6.4999999999999996e-6 < z Initial program 79.9%
*-commutative79.9%
Simplified79.9%
Taylor expanded in t around inf 87.6%
+-commutative87.6%
+-commutative87.6%
+-commutative87.6%
Simplified87.6%
Taylor expanded in z around inf 94.4%
+-commutative94.4%
+-commutative94.4%
+-commutative94.4%
Simplified94.4%
Final simplification89.5%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.3e-28) (not (<= z 3.5e-102))) (+ (/ x (+ x 1.0)) (/ y (* t (+ x 1.0)))) (/ (+ x (/ x (- x (* z t)))) (+ x 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.3e-28) || !(z <= 3.5e-102)) {
tmp = (x / (x + 1.0)) + (y / (t * (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 ((z <= (-1.3d-28)) .or. (.not. (z <= 3.5d-102))) then
tmp = (x / (x + 1.0d0)) + (y / (t * (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 ((z <= -1.3e-28) || !(z <= 3.5e-102)) {
tmp = (x / (x + 1.0)) + (y / (t * (x + 1.0)));
} else {
tmp = (x + (x / (x - (z * t)))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.3e-28) or not (z <= 3.5e-102): tmp = (x / (x + 1.0)) + (y / (t * (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 ((z <= -1.3e-28) || !(z <= 3.5e-102)) tmp = Float64(Float64(x / Float64(x + 1.0)) + Float64(y / Float64(t * 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 ((z <= -1.3e-28) || ~((z <= 3.5e-102))) tmp = (x / (x + 1.0)) + (y / (t * (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[z, -1.3e-28], N[Not[LessEqual[z, 3.5e-102]], $MachinePrecision]], N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] + N[(y / N[(t * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $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}\;z \leq -1.3 \cdot 10^{-28} \lor \neg \left(z \leq 3.5 \cdot 10^{-102}\right):\\
\;\;\;\;\frac{x}{x + 1} + \frac{y}{t \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{x}{x - z \cdot t}}{x + 1}\\
\end{array}
\end{array}
if z < -1.3e-28 or 3.49999999999999986e-102 < z Initial program 83.1%
*-commutative83.1%
Simplified83.1%
Taylor expanded in t around inf 84.9%
+-commutative84.9%
+-commutative84.9%
+-commutative84.9%
Simplified84.9%
Taylor expanded in z around inf 90.1%
+-commutative90.1%
+-commutative90.1%
+-commutative90.1%
Simplified90.1%
if -1.3e-28 < z < 3.49999999999999986e-102Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in y around 0 80.0%
+-commutative80.0%
Simplified80.0%
Final simplification86.5%
(FPCore (x y z t) :precision binary64 (if (or (<= z -8.8e-29) (not (<= z 5.6e-161))) (+ (/ x (+ x 1.0)) (/ y (* t (+ x 1.0)))) (/ (- (+ x 1.0) (* y (/ z x))) (+ x 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -8.8e-29) || !(z <= 5.6e-161)) {
tmp = (x / (x + 1.0)) + (y / (t * (x + 1.0)));
} else {
tmp = ((x + 1.0) - (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 ((z <= (-8.8d-29)) .or. (.not. (z <= 5.6d-161))) then
tmp = (x / (x + 1.0d0)) + (y / (t * (x + 1.0d0)))
else
tmp = ((x + 1.0d0) - (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 ((z <= -8.8e-29) || !(z <= 5.6e-161)) {
tmp = (x / (x + 1.0)) + (y / (t * (x + 1.0)));
} else {
tmp = ((x + 1.0) - (y * (z / x))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -8.8e-29) or not (z <= 5.6e-161): tmp = (x / (x + 1.0)) + (y / (t * (x + 1.0))) else: tmp = ((x + 1.0) - (y * (z / x))) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -8.8e-29) || !(z <= 5.6e-161)) tmp = Float64(Float64(x / Float64(x + 1.0)) + Float64(y / Float64(t * Float64(x + 1.0)))); else tmp = Float64(Float64(Float64(x + 1.0) - 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 ((z <= -8.8e-29) || ~((z <= 5.6e-161))) tmp = (x / (x + 1.0)) + (y / (t * (x + 1.0))); else tmp = ((x + 1.0) - (y * (z / x))) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -8.8e-29], N[Not[LessEqual[z, 5.6e-161]], $MachinePrecision]], N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] + N[(y / N[(t * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x + 1.0), $MachinePrecision] - N[(y * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.8 \cdot 10^{-29} \lor \neg \left(z \leq 5.6 \cdot 10^{-161}\right):\\
\;\;\;\;\frac{x}{x + 1} + \frac{y}{t \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x + 1\right) - y \cdot \frac{z}{x}}{x + 1}\\
\end{array}
\end{array}
if z < -8.79999999999999961e-29 or 5.59999999999999984e-161 < z Initial program 83.7%
*-commutative83.7%
Simplified83.7%
Taylor expanded in t around inf 83.7%
+-commutative83.7%
+-commutative83.7%
+-commutative83.7%
Simplified83.7%
Taylor expanded in z around inf 89.3%
+-commutative89.3%
+-commutative89.3%
+-commutative89.3%
Simplified89.3%
if -8.79999999999999961e-29 < z < 5.59999999999999984e-161Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around 0 82.8%
associate-+r+82.8%
mul-1-neg82.8%
unsub-neg82.8%
+-commutative82.8%
associate-/l*82.8%
+-commutative82.8%
Simplified82.8%
Final simplification87.1%
(FPCore (x y z t)
:precision binary64
(if (<= x -2.35e-27)
1.0
(if (<= x 8.3e-109)
(/ 1.0 (/ t y))
(if (<= x 2.5e-9) (* x (- 1.0 x)) 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.35e-27) {
tmp = 1.0;
} else if (x <= 8.3e-109) {
tmp = 1.0 / (t / y);
} else if (x <= 2.5e-9) {
tmp = x * (1.0 - 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) :: tmp
if (x <= (-2.35d-27)) then
tmp = 1.0d0
else if (x <= 8.3d-109) then
tmp = 1.0d0 / (t / y)
else if (x <= 2.5d-9) then
tmp = x * (1.0d0 - x)
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 (x <= -2.35e-27) {
tmp = 1.0;
} else if (x <= 8.3e-109) {
tmp = 1.0 / (t / y);
} else if (x <= 2.5e-9) {
tmp = x * (1.0 - x);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -2.35e-27: tmp = 1.0 elif x <= 8.3e-109: tmp = 1.0 / (t / y) elif x <= 2.5e-9: tmp = x * (1.0 - x) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -2.35e-27) tmp = 1.0; elseif (x <= 8.3e-109) tmp = Float64(1.0 / Float64(t / y)); elseif (x <= 2.5e-9) tmp = Float64(x * Float64(1.0 - x)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -2.35e-27) tmp = 1.0; elseif (x <= 8.3e-109) tmp = 1.0 / (t / y); elseif (x <= 2.5e-9) tmp = x * (1.0 - x); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -2.35e-27], 1.0, If[LessEqual[x, 8.3e-109], N[(1.0 / N[(t / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.5e-9], N[(x * N[(1.0 - x), $MachinePrecision]), $MachinePrecision], 1.0]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.35 \cdot 10^{-27}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 8.3 \cdot 10^{-109}:\\
\;\;\;\;\frac{1}{\frac{t}{y}}\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{-9}:\\
\;\;\;\;x \cdot \left(1 - x\right)\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -2.35000000000000016e-27 or 2.5000000000000001e-9 < x Initial program 87.7%
*-commutative87.7%
Simplified87.7%
Taylor expanded in t around inf 87.0%
+-commutative87.0%
Simplified87.0%
Taylor expanded in x around inf 87.2%
if -2.35000000000000016e-27 < x < 8.29999999999999963e-109Initial program 91.9%
*-commutative91.9%
Simplified91.9%
clear-num91.8%
inv-pow91.8%
fma-neg91.8%
Applied egg-rr91.8%
unpow-191.8%
fma-neg91.8%
*-commutative91.8%
*-commutative91.8%
Simplified91.8%
Taylor expanded in x around 0 57.7%
if 8.29999999999999963e-109 < x < 2.5000000000000001e-9Initial program 85.6%
*-commutative85.6%
Simplified85.6%
Taylor expanded in t around inf 55.7%
+-commutative55.7%
Simplified55.7%
Taylor expanded in x around 0 55.7%
neg-mul-155.7%
sub-neg55.7%
Simplified55.7%
Final simplification73.3%
(FPCore (x y z t) :precision binary64 (if (<= x -7e+14) 1.0 (if (<= x 2.5e-5) (/ (+ x (/ y t)) (+ x 1.0)) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -7e+14) {
tmp = 1.0;
} else if (x <= 2.5e-5) {
tmp = (x + (y / t)) / (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 (x <= (-7d+14)) then
tmp = 1.0d0
else if (x <= 2.5d-5) then
tmp = (x + (y / t)) / (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 (x <= -7e+14) {
tmp = 1.0;
} else if (x <= 2.5e-5) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -7e+14: tmp = 1.0 elif x <= 2.5e-5: tmp = (x + (y / t)) / (x + 1.0) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -7e+14) tmp = 1.0; elseif (x <= 2.5e-5) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -7e+14) tmp = 1.0; elseif (x <= 2.5e-5) tmp = (x + (y / t)) / (x + 1.0); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -7e+14], 1.0, If[LessEqual[x, 2.5e-5], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7 \cdot 10^{+14}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{-5}:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -7e14 or 2.50000000000000012e-5 < x Initial program 88.8%
*-commutative88.8%
Simplified88.8%
Taylor expanded in t around inf 91.8%
+-commutative91.8%
Simplified91.8%
Taylor expanded in x around inf 92.4%
if -7e14 < x < 2.50000000000000012e-5Initial program 89.5%
*-commutative89.5%
Simplified89.5%
Taylor expanded in z around inf 75.3%
Final simplification83.6%
(FPCore (x y z t) :precision binary64 (if (or (<= x -3.8e-63) (not (<= x 6.1e-109))) (/ x (+ x 1.0)) (/ y (* t (+ x 1.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.8e-63) || !(x <= 6.1e-109)) {
tmp = x / (x + 1.0);
} else {
tmp = y / (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 ((x <= (-3.8d-63)) .or. (.not. (x <= 6.1d-109))) then
tmp = x / (x + 1.0d0)
else
tmp = y / (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 ((x <= -3.8e-63) || !(x <= 6.1e-109)) {
tmp = x / (x + 1.0);
} else {
tmp = y / (t * (x + 1.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -3.8e-63) or not (x <= 6.1e-109): tmp = x / (x + 1.0) else: tmp = y / (t * (x + 1.0)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -3.8e-63) || !(x <= 6.1e-109)) tmp = Float64(x / Float64(x + 1.0)); else tmp = Float64(y / Float64(t * Float64(x + 1.0))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -3.8e-63) || ~((x <= 6.1e-109))) tmp = x / (x + 1.0); else tmp = y / (t * (x + 1.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -3.8e-63], N[Not[LessEqual[x, 6.1e-109]], $MachinePrecision]], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(y / N[(t * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.8 \cdot 10^{-63} \lor \neg \left(x \leq 6.1 \cdot 10^{-109}\right):\\
\;\;\;\;\frac{x}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{t \cdot \left(x + 1\right)}\\
\end{array}
\end{array}
if x < -3.80000000000000017e-63 or 6.0999999999999997e-109 < x Initial program 88.1%
*-commutative88.1%
Simplified88.1%
Taylor expanded in t around inf 81.6%
+-commutative81.6%
Simplified81.6%
if -3.80000000000000017e-63 < x < 6.0999999999999997e-109Initial program 91.1%
*-commutative91.1%
Simplified91.1%
clear-num91.0%
inv-pow91.0%
fma-neg91.0%
Applied egg-rr91.0%
unpow-191.0%
fma-neg91.0%
*-commutative91.0%
*-commutative91.0%
Simplified91.0%
Taylor expanded in z around inf 76.4%
+-commutative76.4%
Simplified76.4%
Taylor expanded in y around inf 62.2%
+-commutative62.2%
Simplified62.2%
Final simplification74.8%
(FPCore (x y z t) :precision binary64 (/ 1.0 (/ (+ x 1.0) (+ x (* y (/ z (- (* z t) x)))))))
double code(double x, double y, double z, double t) {
return 1.0 / ((x + 1.0) / (x + (y * (z / ((z * t) - 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 = 1.0d0 / ((x + 1.0d0) / (x + (y * (z / ((z * t) - x)))))
end function
public static double code(double x, double y, double z, double t) {
return 1.0 / ((x + 1.0) / (x + (y * (z / ((z * t) - x)))));
}
def code(x, y, z, t): return 1.0 / ((x + 1.0) / (x + (y * (z / ((z * t) - x)))))
function code(x, y, z, t) return Float64(1.0 / Float64(Float64(x + 1.0) / Float64(x + Float64(y * Float64(z / Float64(Float64(z * t) - x)))))) end
function tmp = code(x, y, z, t) tmp = 1.0 / ((x + 1.0) / (x + (y * (z / ((z * t) - x))))); end
code[x_, y_, z_, t_] := N[(1.0 / N[(N[(x + 1.0), $MachinePrecision] / N[(x + N[(y * N[(z / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{\frac{x + 1}{x + y \cdot \frac{z}{z \cdot t - x}}}
\end{array}
Initial program 89.1%
*-commutative89.1%
Simplified89.1%
clear-num89.1%
inv-pow89.1%
fma-neg89.1%
Applied egg-rr89.1%
unpow-189.1%
fma-neg89.1%
*-commutative89.1%
*-commutative89.1%
Simplified89.1%
Taylor expanded in y around inf 81.8%
associate-/l*90.6%
Simplified90.6%
Final simplification90.6%
(FPCore (x y z t) :precision binary64 (if (or (<= x -3.1e-62) (not (<= x 9.2e-109))) (/ x (+ x 1.0)) (/ 1.0 (/ t y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.1e-62) || !(x <= 9.2e-109)) {
tmp = x / (x + 1.0);
} else {
tmp = 1.0 / (t / y);
}
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 <= (-3.1d-62)) .or. (.not. (x <= 9.2d-109))) then
tmp = x / (x + 1.0d0)
else
tmp = 1.0d0 / (t / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.1e-62) || !(x <= 9.2e-109)) {
tmp = x / (x + 1.0);
} else {
tmp = 1.0 / (t / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -3.1e-62) or not (x <= 9.2e-109): tmp = x / (x + 1.0) else: tmp = 1.0 / (t / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -3.1e-62) || !(x <= 9.2e-109)) tmp = Float64(x / Float64(x + 1.0)); else tmp = Float64(1.0 / Float64(t / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -3.1e-62) || ~((x <= 9.2e-109))) tmp = x / (x + 1.0); else tmp = 1.0 / (t / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -3.1e-62], N[Not[LessEqual[x, 9.2e-109]], $MachinePrecision]], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(t / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.1 \cdot 10^{-62} \lor \neg \left(x \leq 9.2 \cdot 10^{-109}\right):\\
\;\;\;\;\frac{x}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{t}{y}}\\
\end{array}
\end{array}
if x < -3.0999999999999999e-62 or 9.2000000000000006e-109 < x Initial program 88.1%
*-commutative88.1%
Simplified88.1%
Taylor expanded in t around inf 81.6%
+-commutative81.6%
Simplified81.6%
if -3.0999999999999999e-62 < x < 9.2000000000000006e-109Initial program 91.1%
*-commutative91.1%
Simplified91.1%
clear-num91.0%
inv-pow91.0%
fma-neg91.0%
Applied egg-rr91.0%
unpow-191.0%
fma-neg91.0%
*-commutative91.0%
*-commutative91.0%
Simplified91.0%
Taylor expanded in x around 0 62.0%
Final simplification74.7%
(FPCore (x y z t) :precision binary64 (if (<= x -4e-41) 1.0 (if (<= x 1.8e-10) (* x (- 1.0 x)) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -4e-41) {
tmp = 1.0;
} else if (x <= 1.8e-10) {
tmp = x * (1.0 - 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) :: tmp
if (x <= (-4d-41)) then
tmp = 1.0d0
else if (x <= 1.8d-10) then
tmp = x * (1.0d0 - x)
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 (x <= -4e-41) {
tmp = 1.0;
} else if (x <= 1.8e-10) {
tmp = x * (1.0 - x);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -4e-41: tmp = 1.0 elif x <= 1.8e-10: tmp = x * (1.0 - x) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -4e-41) tmp = 1.0; elseif (x <= 1.8e-10) tmp = Float64(x * Float64(1.0 - x)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -4e-41) tmp = 1.0; elseif (x <= 1.8e-10) tmp = x * (1.0 - x); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -4e-41], 1.0, If[LessEqual[x, 1.8e-10], N[(x * N[(1.0 - x), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4 \cdot 10^{-41}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{-10}:\\
\;\;\;\;x \cdot \left(1 - x\right)\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -4.00000000000000002e-41 or 1.8e-10 < x Initial program 87.9%
*-commutative87.9%
Simplified87.9%
Taylor expanded in t around inf 85.8%
+-commutative85.8%
Simplified85.8%
Taylor expanded in x around inf 86.0%
if -4.00000000000000002e-41 < x < 1.8e-10Initial program 90.6%
*-commutative90.6%
Simplified90.6%
Taylor expanded in t around inf 26.5%
+-commutative26.5%
Simplified26.5%
Taylor expanded in x around 0 26.5%
neg-mul-126.5%
sub-neg26.5%
Simplified26.5%
Final simplification58.8%
(FPCore (x y z t) :precision binary64 (if (<= x -0.9) (- 1.0 (/ 1.0 x)) (if (<= x 6e-11) (* x (- 1.0 x)) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -0.9) {
tmp = 1.0 - (1.0 / x);
} else if (x <= 6e-11) {
tmp = x * (1.0 - 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) :: tmp
if (x <= (-0.9d0)) then
tmp = 1.0d0 - (1.0d0 / x)
else if (x <= 6d-11) then
tmp = x * (1.0d0 - x)
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 (x <= -0.9) {
tmp = 1.0 - (1.0 / x);
} else if (x <= 6e-11) {
tmp = x * (1.0 - x);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -0.9: tmp = 1.0 - (1.0 / x) elif x <= 6e-11: tmp = x * (1.0 - x) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -0.9) tmp = Float64(1.0 - Float64(1.0 / x)); elseif (x <= 6e-11) tmp = Float64(x * Float64(1.0 - x)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -0.9) tmp = 1.0 - (1.0 / x); elseif (x <= 6e-11) tmp = x * (1.0 - x); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -0.9], N[(1.0 - N[(1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6e-11], N[(x * N[(1.0 - x), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.9:\\
\;\;\;\;1 - \frac{1}{x}\\
\mathbf{elif}\;x \leq 6 \cdot 10^{-11}:\\
\;\;\;\;x \cdot \left(1 - x\right)\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -0.900000000000000022Initial program 82.6%
*-commutative82.6%
Simplified82.6%
Taylor expanded in t around inf 87.6%
+-commutative87.6%
Simplified87.6%
Taylor expanded in x around inf 87.5%
if -0.900000000000000022 < x < 6e-11Initial program 90.6%
*-commutative90.6%
Simplified90.6%
Taylor expanded in t around inf 26.2%
+-commutative26.2%
Simplified26.2%
Taylor expanded in x around 0 26.0%
neg-mul-126.0%
sub-neg26.0%
Simplified26.0%
if 6e-11 < x Initial program 92.6%
*-commutative92.6%
Simplified92.6%
Taylor expanded in t around inf 92.4%
+-commutative92.4%
Simplified92.4%
Taylor expanded in x around inf 93.7%
Final simplification58.8%
(FPCore (x y z t) :precision binary64 (if (<= x -3.2e-40) 1.0 (if (<= x 3.6e-11) x 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -3.2e-40) {
tmp = 1.0;
} else if (x <= 3.6e-11) {
tmp = 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) :: tmp
if (x <= (-3.2d-40)) then
tmp = 1.0d0
else if (x <= 3.6d-11) then
tmp = x
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 (x <= -3.2e-40) {
tmp = 1.0;
} else if (x <= 3.6e-11) {
tmp = x;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -3.2e-40: tmp = 1.0 elif x <= 3.6e-11: tmp = x else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -3.2e-40) tmp = 1.0; elseif (x <= 3.6e-11) tmp = x; else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -3.2e-40) tmp = 1.0; elseif (x <= 3.6e-11) tmp = x; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -3.2e-40], 1.0, If[LessEqual[x, 3.6e-11], x, 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.2 \cdot 10^{-40}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 3.6 \cdot 10^{-11}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -3.20000000000000002e-40 or 3.59999999999999985e-11 < x Initial program 87.9%
*-commutative87.9%
Simplified87.9%
Taylor expanded in t around inf 85.8%
+-commutative85.8%
Simplified85.8%
Taylor expanded in x around inf 86.0%
if -3.20000000000000002e-40 < x < 3.59999999999999985e-11Initial program 90.6%
*-commutative90.6%
Simplified90.6%
Taylor expanded in t around inf 26.5%
+-commutative26.5%
Simplified26.5%
Taylor expanded in x around 0 26.3%
Final simplification58.7%
(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 89.1%
*-commutative89.1%
Simplified89.1%
Taylor expanded in t around inf 58.7%
+-commutative58.7%
Simplified58.7%
Taylor expanded in x around inf 52.1%
Final simplification52.1%
(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 2024059
(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)))