
(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
(let* ((t_1 (- (* z t) x)))
(if (<= (/ (+ x (/ (- (* y z) x) t_1)) (+ x 1.0)) INFINITY)
(/ (+ (* y (/ z t_1)) (- x (/ x t_1))) (+ x 1.0))
(/ (+ x (/ y t)) (+ x 1.0)))))
double code(double x, double y, double z, double t) {
double t_1 = (z * t) - x;
double tmp;
if (((x + (((y * z) - x) / t_1)) / (x + 1.0)) <= ((double) INFINITY)) {
tmp = ((y * (z / t_1)) + (x - (x / t_1))) / (x + 1.0);
} else {
tmp = (x + (y / t)) / (x + 1.0);
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (z * t) - x;
double tmp;
if (((x + (((y * z) - x) / t_1)) / (x + 1.0)) <= Double.POSITIVE_INFINITY) {
tmp = ((y * (z / t_1)) + (x - (x / t_1))) / (x + 1.0);
} else {
tmp = (x + (y / t)) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = (z * t) - x tmp = 0 if ((x + (((y * z) - x) / t_1)) / (x + 1.0)) <= math.inf: tmp = ((y * (z / t_1)) + (x - (x / t_1))) / (x + 1.0) else: tmp = (x + (y / t)) / (x + 1.0) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z * t) - x) tmp = 0.0 if (Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / t_1)) / Float64(x + 1.0)) <= Inf) tmp = Float64(Float64(Float64(y * Float64(z / t_1)) + Float64(x - Float64(x / t_1))) / Float64(x + 1.0)); else tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z * t) - x; tmp = 0.0; if (((x + (((y * z) - x) / t_1)) / (x + 1.0)) <= Inf) tmp = ((y * (z / t_1)) + (x - (x / t_1))) / (x + 1.0); else tmp = (x + (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]}, If[LessEqual[N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(y * N[(z / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x - N[(x / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot t - x\\
\mathbf{if}\;\frac{x + \frac{y \cdot z - x}{t_1}}{x + 1} \leq \infty:\\
\;\;\;\;\frac{y \cdot \frac{z}{t_1} + \left(x - \frac{x}{t_1}\right)}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < +inf.0Initial program 93.4%
*-commutative93.4%
Simplified93.4%
+-commutative93.4%
div-sub93.4%
associate-+l-93.4%
*-un-lft-identity93.4%
times-frac98.5%
fma-neg98.5%
Applied egg-rr98.5%
fma-udef98.5%
unsub-neg98.5%
/-rgt-identity98.5%
*-commutative98.5%
*-commutative98.5%
Simplified98.5%
if +inf.0 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) Initial program 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in z around inf 100.0%
Final simplification98.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* z t) x)) (t_2 (/ (+ x (/ (- (* y z) x) t_1)) (+ x 1.0))))
(if (<= t_2 -5e+133)
(/ (+ x (/ y (/ t_1 z))) (+ x 1.0))
(if (<= t_2 1e+267) t_2 (+ (/ x (+ x 1.0)) (/ y (+ t (* x t))))))))
double code(double x, double y, double z, double t) {
double t_1 = (z * t) - x;
double t_2 = (x + (((y * z) - x) / t_1)) / (x + 1.0);
double tmp;
if (t_2 <= -5e+133) {
tmp = (x + (y / (t_1 / z))) / (x + 1.0);
} else if (t_2 <= 1e+267) {
tmp = t_2;
} else {
tmp = (x / (x + 1.0)) + (y / (t + (x * t)));
}
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) - x) / t_1)) / (x + 1.0d0)
if (t_2 <= (-5d+133)) then
tmp = (x + (y / (t_1 / z))) / (x + 1.0d0)
else if (t_2 <= 1d+267) then
tmp = t_2
else
tmp = (x / (x + 1.0d0)) + (y / (t + (x * t)))
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) - x) / t_1)) / (x + 1.0);
double tmp;
if (t_2 <= -5e+133) {
tmp = (x + (y / (t_1 / z))) / (x + 1.0);
} else if (t_2 <= 1e+267) {
tmp = t_2;
} else {
tmp = (x / (x + 1.0)) + (y / (t + (x * t)));
}
return tmp;
}
def code(x, y, z, t): t_1 = (z * t) - x t_2 = (x + (((y * z) - x) / t_1)) / (x + 1.0) tmp = 0 if t_2 <= -5e+133: tmp = (x + (y / (t_1 / z))) / (x + 1.0) elif t_2 <= 1e+267: tmp = t_2 else: tmp = (x / (x + 1.0)) + (y / (t + (x * t))) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z * t) - x) t_2 = Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / t_1)) / Float64(x + 1.0)) tmp = 0.0 if (t_2 <= -5e+133) tmp = Float64(Float64(x + Float64(y / Float64(t_1 / z))) / Float64(x + 1.0)); elseif (t_2 <= 1e+267) tmp = t_2; else tmp = Float64(Float64(x / Float64(x + 1.0)) + Float64(y / Float64(t + Float64(x * t)))); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z * t) - x; t_2 = (x + (((y * z) - x) / t_1)) / (x + 1.0); tmp = 0.0; if (t_2 <= -5e+133) tmp = (x + (y / (t_1 / z))) / (x + 1.0); elseif (t_2 <= 1e+267) tmp = t_2; else tmp = (x / (x + 1.0)) + (y / (t + (x * t))); 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[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+133], N[(N[(x + N[(y / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+267], t$95$2, N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] + N[(y / N[(t + N[(x * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot t - x\\
t_2 := \frac{x + \frac{y \cdot z - x}{t_1}}{x + 1}\\
\mathbf{if}\;t_2 \leq -5 \cdot 10^{+133}:\\
\;\;\;\;\frac{x + \frac{y}{\frac{t_1}{z}}}{x + 1}\\
\mathbf{elif}\;t_2 \leq 10^{+267}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + 1} + \frac{y}{t + x \cdot t}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < -4.99999999999999961e133Initial program 73.3%
*-commutative73.3%
Simplified73.3%
Taylor expanded in y around inf 73.3%
associate-/l*99.6%
Simplified99.6%
if -4.99999999999999961e133 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < 9.9999999999999997e266Initial program 98.3%
if 9.9999999999999997e266 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) Initial program 22.9%
*-commutative22.9%
Simplified22.9%
Taylor expanded in y around inf 22.9%
associate-/l*68.7%
Simplified68.7%
Taylor expanded in t around inf 86.0%
+-commutative86.0%
distribute-lft-in86.0%
*-rgt-identity86.0%
Simplified86.0%
Final simplification97.1%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.85e+55) (not (<= t 4e-47))) (+ (/ x (+ x 1.0)) (/ y (+ t (* x t)))) (/ (+ x (/ y (/ (- (* z t) x) z))) (+ x 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.85e+55) || !(t <= 4e-47)) {
tmp = (x / (x + 1.0)) + (y / (t + (x * t)));
} else {
tmp = (x + (y / (((z * t) - 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 <= (-1.85d+55)) .or. (.not. (t <= 4d-47))) then
tmp = (x / (x + 1.0d0)) + (y / (t + (x * t)))
else
tmp = (x + (y / (((z * t) - 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 <= -1.85e+55) || !(t <= 4e-47)) {
tmp = (x / (x + 1.0)) + (y / (t + (x * t)));
} else {
tmp = (x + (y / (((z * t) - x) / z))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.85e+55) or not (t <= 4e-47): tmp = (x / (x + 1.0)) + (y / (t + (x * t))) else: tmp = (x + (y / (((z * t) - x) / z))) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.85e+55) || !(t <= 4e-47)) tmp = Float64(Float64(x / Float64(x + 1.0)) + Float64(y / Float64(t + Float64(x * t)))); else tmp = Float64(Float64(x + Float64(y / Float64(Float64(Float64(z * t) - x) / z))) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -1.85e+55) || ~((t <= 4e-47))) tmp = (x / (x + 1.0)) + (y / (t + (x * t))); else tmp = (x + (y / (((z * t) - x) / z))) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.85e+55], N[Not[LessEqual[t, 4e-47]], $MachinePrecision]], N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] + N[(y / N[(t + N[(x * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y / N[(N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.85 \cdot 10^{+55} \lor \neg \left(t \leq 4 \cdot 10^{-47}\right):\\
\;\;\;\;\frac{x}{x + 1} + \frac{y}{t + x \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y}{\frac{z \cdot t - x}{z}}}{x + 1}\\
\end{array}
\end{array}
if t < -1.8500000000000001e55 or 3.9999999999999999e-47 < t Initial program 83.3%
*-commutative83.3%
Simplified83.3%
Taylor expanded in y around inf 78.6%
associate-/l*86.2%
Simplified86.2%
Taylor expanded in t around inf 94.5%
+-commutative94.5%
distribute-lft-in94.5%
*-rgt-identity94.5%
Simplified94.5%
if -1.8500000000000001e55 < t < 3.9999999999999999e-47Initial program 92.8%
*-commutative92.8%
Simplified92.8%
Taylor expanded in y around inf 81.3%
associate-/l*88.3%
Simplified88.3%
Final simplification91.5%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.5e-109) (not (<= t 3.25e-146))) (+ (/ x (+ x 1.0)) (/ y (+ t (* x t)))) (- 1.0 (* (/ y x) (/ z (+ x 1.0))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.5e-109) || !(t <= 3.25e-146)) {
tmp = (x / (x + 1.0)) + (y / (t + (x * t)));
} 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 <= (-1.5d-109)) .or. (.not. (t <= 3.25d-146))) then
tmp = (x / (x + 1.0d0)) + (y / (t + (x * t)))
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 <= -1.5e-109) || !(t <= 3.25e-146)) {
tmp = (x / (x + 1.0)) + (y / (t + (x * t)));
} else {
tmp = 1.0 - ((y / x) * (z / (x + 1.0)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.5e-109) or not (t <= 3.25e-146): tmp = (x / (x + 1.0)) + (y / (t + (x * t))) else: tmp = 1.0 - ((y / x) * (z / (x + 1.0))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.5e-109) || !(t <= 3.25e-146)) tmp = Float64(Float64(x / Float64(x + 1.0)) + Float64(y / Float64(t + Float64(x * t)))); 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 <= -1.5e-109) || ~((t <= 3.25e-146))) tmp = (x / (x + 1.0)) + (y / (t + (x * t))); else tmp = 1.0 - ((y / x) * (z / (x + 1.0))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.5e-109], N[Not[LessEqual[t, 3.25e-146]], $MachinePrecision]], N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] + N[(y / N[(t + N[(x * t), $MachinePrecision]), $MachinePrecision]), $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 -1.5 \cdot 10^{-109} \lor \neg \left(t \leq 3.25 \cdot 10^{-146}\right):\\
\;\;\;\;\frac{x}{x + 1} + \frac{y}{t + x \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1 - \frac{y}{x} \cdot \frac{z}{x + 1}\\
\end{array}
\end{array}
if t < -1.50000000000000011e-109 or 3.2499999999999999e-146 < t Initial program 85.3%
*-commutative85.3%
Simplified85.3%
Taylor expanded in y around inf 79.9%
associate-/l*88.2%
Simplified88.2%
Taylor expanded in t around inf 88.1%
+-commutative88.1%
distribute-lft-in88.1%
*-rgt-identity88.1%
Simplified88.1%
if -1.50000000000000011e-109 < t < 3.2499999999999999e-146Initial program 95.4%
*-commutative95.4%
Simplified95.4%
+-commutative95.4%
div-sub95.4%
associate-+l-95.4%
*-un-lft-identity95.4%
times-frac99.8%
fma-neg99.8%
Applied egg-rr99.8%
fma-udef99.8%
unsub-neg99.8%
/-rgt-identity99.8%
*-commutative99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in x around inf 96.9%
Taylor expanded in z around 0 74.8%
mul-1-neg74.8%
unsub-neg74.8%
times-frac72.3%
Simplified72.3%
Final simplification84.0%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.55e-108) (not (<= t 3.2e-146))) (+ (/ x (+ x 1.0)) (/ y (+ t (* x t)))) (/ (+ x (- 1.0 (/ (* y z) x))) (+ x 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.55e-108) || !(t <= 3.2e-146)) {
tmp = (x / (x + 1.0)) + (y / (t + (x * t)));
} 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 ((t <= (-1.55d-108)) .or. (.not. (t <= 3.2d-146))) then
tmp = (x / (x + 1.0d0)) + (y / (t + (x * t)))
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 ((t <= -1.55e-108) || !(t <= 3.2e-146)) {
tmp = (x / (x + 1.0)) + (y / (t + (x * t)));
} else {
tmp = (x + (1.0 - ((y * z) / x))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.55e-108) or not (t <= 3.2e-146): tmp = (x / (x + 1.0)) + (y / (t + (x * t))) else: tmp = (x + (1.0 - ((y * z) / x))) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.55e-108) || !(t <= 3.2e-146)) tmp = Float64(Float64(x / Float64(x + 1.0)) + Float64(y / Float64(t + Float64(x * t)))); else tmp = Float64(Float64(x + Float64(1.0 - Float64(Float64(y * z) / x))) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -1.55e-108) || ~((t <= 3.2e-146))) tmp = (x / (x + 1.0)) + (y / (t + (x * t))); else tmp = (x + (1.0 - ((y * z) / x))) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.55e-108], N[Not[LessEqual[t, 3.2e-146]], $MachinePrecision]], N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] + N[(y / N[(t + N[(x * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(1.0 - N[(N[(y * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.55 \cdot 10^{-108} \lor \neg \left(t \leq 3.2 \cdot 10^{-146}\right):\\
\;\;\;\;\frac{x}{x + 1} + \frac{y}{t + x \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \left(1 - \frac{y \cdot z}{x}\right)}{x + 1}\\
\end{array}
\end{array}
if t < -1.55000000000000007e-108 or 3.1999999999999999e-146 < t Initial program 85.3%
*-commutative85.3%
Simplified85.3%
Taylor expanded in y around inf 79.9%
associate-/l*88.2%
Simplified88.2%
Taylor expanded in t around inf 88.1%
+-commutative88.1%
distribute-lft-in88.1%
*-rgt-identity88.1%
Simplified88.1%
if -1.55000000000000007e-108 < t < 3.1999999999999999e-146Initial program 95.4%
*-commutative95.4%
Simplified95.4%
Taylor expanded in t around 0 74.9%
associate-+r+74.9%
+-commutative74.9%
associate-+l+74.9%
mul-1-neg74.9%
unsub-neg74.9%
*-commutative74.9%
+-commutative74.9%
Simplified74.9%
Final simplification84.7%
(FPCore (x y z t) :precision binary64 (if (or (<= t -2.5e-108) (not (<= t 3.9e-146))) (+ (/ x (+ x 1.0)) (/ y (+ t (* x t)))) (/ (+ x (- 1.0 (* y (/ z x)))) (+ x 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.5e-108) || !(t <= 3.9e-146)) {
tmp = (x / (x + 1.0)) + (y / (t + (x * t)));
} 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 ((t <= (-2.5d-108)) .or. (.not. (t <= 3.9d-146))) then
tmp = (x / (x + 1.0d0)) + (y / (t + (x * t)))
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 ((t <= -2.5e-108) || !(t <= 3.9e-146)) {
tmp = (x / (x + 1.0)) + (y / (t + (x * t)));
} else {
tmp = (x + (1.0 - (y * (z / x)))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -2.5e-108) or not (t <= 3.9e-146): tmp = (x / (x + 1.0)) + (y / (t + (x * t))) else: tmp = (x + (1.0 - (y * (z / x)))) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -2.5e-108) || !(t <= 3.9e-146)) tmp = Float64(Float64(x / Float64(x + 1.0)) + Float64(y / Float64(t + Float64(x * t)))); else tmp = Float64(Float64(x + Float64(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 ((t <= -2.5e-108) || ~((t <= 3.9e-146))) tmp = (x / (x + 1.0)) + (y / (t + (x * t))); else tmp = (x + (1.0 - (y * (z / x)))) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -2.5e-108], N[Not[LessEqual[t, 3.9e-146]], $MachinePrecision]], N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] + N[(y / N[(t + N[(x * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(1.0 - 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.5 \cdot 10^{-108} \lor \neg \left(t \leq 3.9 \cdot 10^{-146}\right):\\
\;\;\;\;\frac{x}{x + 1} + \frac{y}{t + x \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \left(1 - y \cdot \frac{z}{x}\right)}{x + 1}\\
\end{array}
\end{array}
if t < -2.5e-108 or 3.90000000000000002e-146 < t Initial program 85.3%
*-commutative85.3%
Simplified85.3%
Taylor expanded in y around inf 79.9%
associate-/l*88.2%
Simplified88.2%
Taylor expanded in t around inf 88.1%
+-commutative88.1%
distribute-lft-in88.1%
*-rgt-identity88.1%
Simplified88.1%
if -2.5e-108 < t < 3.90000000000000002e-146Initial program 95.4%
*-commutative95.4%
Simplified95.4%
+-commutative95.4%
div-sub95.4%
associate-+l-95.4%
*-un-lft-identity95.4%
times-frac99.8%
fma-neg99.8%
Applied egg-rr99.8%
fma-udef99.8%
unsub-neg99.8%
/-rgt-identity99.8%
*-commutative99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in x around inf 96.9%
Taylor expanded in z around 0 74.9%
+-commutative74.9%
mul-1-neg74.9%
associate-/l*79.3%
sub-neg79.3%
associate-+l-79.3%
*-rgt-identity79.3%
associate-*r/79.3%
associate-/r/79.1%
associate-*l/79.3%
*-lft-identity79.3%
Simplified79.3%
Final simplification85.8%
(FPCore (x y z t) :precision binary64 (if (or (<= t -6e-109) (not (<= t 3.5e-146))) (/ (+ 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 <= -6e-109) || !(t <= 3.5e-146)) {
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 <= (-6d-109)) .or. (.not. (t <= 3.5d-146))) 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 <= -6e-109) || !(t <= 3.5e-146)) {
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 <= -6e-109) or not (t <= 3.5e-146): 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 <= -6e-109) || !(t <= 3.5e-146)) 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 <= -6e-109) || ~((t <= 3.5e-146))) 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, -6e-109], N[Not[LessEqual[t, 3.5e-146]], $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 -6 \cdot 10^{-109} \lor \neg \left(t \leq 3.5 \cdot 10^{-146}\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 < -6.00000000000000043e-109 or 3.5000000000000001e-146 < t Initial program 85.3%
*-commutative85.3%
Simplified85.3%
Taylor expanded in z around inf 88.0%
if -6.00000000000000043e-109 < t < 3.5000000000000001e-146Initial program 95.4%
*-commutative95.4%
Simplified95.4%
+-commutative95.4%
div-sub95.4%
associate-+l-95.4%
*-un-lft-identity95.4%
times-frac99.8%
fma-neg99.8%
Applied egg-rr99.8%
fma-udef99.8%
unsub-neg99.8%
/-rgt-identity99.8%
*-commutative99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in x around inf 96.9%
Taylor expanded in z around 0 74.8%
mul-1-neg74.8%
unsub-neg74.8%
times-frac72.3%
Simplified72.3%
Final simplification83.9%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.06e+24) (not (<= x 1.08e+73))) (- 1.0 (* (/ z x) (/ y x))) (/ (+ x (/ y t)) (+ x 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.06e+24) || !(x <= 1.08e+73)) {
tmp = 1.0 - ((z / x) * (y / x));
} else {
tmp = (x + (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 <= (-1.06d+24)) .or. (.not. (x <= 1.08d+73))) then
tmp = 1.0d0 - ((z / x) * (y / x))
else
tmp = (x + (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 <= -1.06e+24) || !(x <= 1.08e+73)) {
tmp = 1.0 - ((z / x) * (y / x));
} else {
tmp = (x + (y / t)) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.06e+24) or not (x <= 1.08e+73): tmp = 1.0 - ((z / x) * (y / x)) else: tmp = (x + (y / t)) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.06e+24) || !(x <= 1.08e+73)) tmp = Float64(1.0 - Float64(Float64(z / x) * Float64(y / x))); else tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.06e+24) || ~((x <= 1.08e+73))) tmp = 1.0 - ((z / x) * (y / x)); else tmp = (x + (y / t)) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.06e+24], N[Not[LessEqual[x, 1.08e+73]], $MachinePrecision]], N[(1.0 - N[(N[(z / x), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.06 \cdot 10^{+24} \lor \neg \left(x \leq 1.08 \cdot 10^{+73}\right):\\
\;\;\;\;1 - \frac{z}{x} \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\end{array}
\end{array}
if x < -1.06e24 or 1.08e73 < x Initial program 89.6%
*-commutative89.6%
Simplified89.6%
Taylor expanded in x around -inf 77.3%
mul-1-neg77.3%
unsub-neg77.3%
distribute-rgt-out--77.3%
unpow277.3%
times-frac91.9%
Simplified91.9%
Taylor expanded in y around inf 87.8%
*-commutative87.8%
unpow287.8%
times-frac95.7%
Simplified95.7%
if -1.06e24 < x < 1.08e73Initial program 86.8%
*-commutative86.8%
Simplified86.8%
Taylor expanded in z around inf 76.0%
Final simplification84.0%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.8e-45) (not (<= x 1.45e-13))) (/ x (+ x 1.0)) (/ y (* t (+ x 1.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.8e-45) || !(x <= 1.45e-13)) {
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 <= (-1.8d-45)) .or. (.not. (x <= 1.45d-13))) 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 <= -1.8e-45) || !(x <= 1.45e-13)) {
tmp = x / (x + 1.0);
} else {
tmp = y / (t * (x + 1.0));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.8e-45) or not (x <= 1.45e-13): 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 <= -1.8e-45) || !(x <= 1.45e-13)) 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 <= -1.8e-45) || ~((x <= 1.45e-13))) 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, -1.8e-45], N[Not[LessEqual[x, 1.45e-13]], $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 -1.8 \cdot 10^{-45} \lor \neg \left(x \leq 1.45 \cdot 10^{-13}\right):\\
\;\;\;\;\frac{x}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{t \cdot \left(x + 1\right)}\\
\end{array}
\end{array}
if x < -1.8e-45 or 1.4499999999999999e-13 < x Initial program 90.7%
*-commutative90.7%
Simplified90.7%
Taylor expanded in t around inf 85.7%
+-commutative85.7%
Simplified85.7%
if -1.8e-45 < x < 1.4499999999999999e-13Initial program 84.5%
*-commutative84.5%
Simplified84.5%
Taylor expanded in y around inf 54.6%
Taylor expanded in z around inf 62.0%
+-commutative62.0%
Simplified62.0%
Final simplification74.9%
(FPCore (x y z t) :precision binary64 (if (or (<= x -8.5e-46) (not (<= x 2.55e-21))) (/ x (+ x 1.0)) (/ y t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -8.5e-46) || !(x <= 2.55e-21)) {
tmp = x / (x + 1.0);
} else {
tmp = y / t;
}
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 <= (-8.5d-46)) .or. (.not. (x <= 2.55d-21))) then
tmp = x / (x + 1.0d0)
else
tmp = y / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -8.5e-46) || !(x <= 2.55e-21)) {
tmp = x / (x + 1.0);
} else {
tmp = y / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -8.5e-46) or not (x <= 2.55e-21): tmp = x / (x + 1.0) else: tmp = y / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -8.5e-46) || !(x <= 2.55e-21)) tmp = Float64(x / Float64(x + 1.0)); else tmp = Float64(y / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -8.5e-46) || ~((x <= 2.55e-21))) tmp = x / (x + 1.0); else tmp = y / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -8.5e-46], N[Not[LessEqual[x, 2.55e-21]], $MachinePrecision]], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(y / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.5 \cdot 10^{-46} \lor \neg \left(x \leq 2.55 \cdot 10^{-21}\right):\\
\;\;\;\;\frac{x}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{t}\\
\end{array}
\end{array}
if x < -8.5000000000000001e-46 or 2.55000000000000002e-21 < x Initial program 90.9%
*-commutative90.9%
Simplified90.9%
Taylor expanded in t around inf 85.2%
+-commutative85.2%
Simplified85.2%
if -8.5000000000000001e-46 < x < 2.55000000000000002e-21Initial program 84.3%
*-commutative84.3%
Simplified84.3%
Taylor expanded in y around inf 54.7%
Taylor expanded in x around 0 46.7%
*-commutative46.7%
Simplified46.7%
Taylor expanded in y around 0 62.2%
Final simplification74.9%
(FPCore (x y z t) :precision binary64 (if (<= x -2.6e-41) 1.0 (if (<= x 6.5e-12) (/ y t) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.6e-41) {
tmp = 1.0;
} else if (x <= 6.5e-12) {
tmp = y / t;
} 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.6d-41)) then
tmp = 1.0d0
else if (x <= 6.5d-12) then
tmp = y / t
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.6e-41) {
tmp = 1.0;
} else if (x <= 6.5e-12) {
tmp = y / t;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -2.6e-41: tmp = 1.0 elif x <= 6.5e-12: tmp = y / t else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -2.6e-41) tmp = 1.0; elseif (x <= 6.5e-12) tmp = Float64(y / t); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -2.6e-41) tmp = 1.0; elseif (x <= 6.5e-12) tmp = y / t; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -2.6e-41], 1.0, If[LessEqual[x, 6.5e-12], N[(y / t), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.6 \cdot 10^{-41}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{-12}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -2.5999999999999999e-41 or 6.5000000000000002e-12 < x Initial program 90.6%
*-commutative90.6%
Simplified90.6%
+-commutative90.6%
div-sub90.6%
associate-+l-90.6%
*-un-lft-identity90.6%
times-frac99.2%
fma-neg99.2%
Applied egg-rr99.2%
fma-udef99.2%
unsub-neg99.2%
/-rgt-identity99.2%
*-commutative99.2%
*-commutative99.2%
Simplified99.2%
Taylor expanded in z around 0 84.1%
if -2.5999999999999999e-41 < x < 6.5000000000000002e-12Initial program 84.8%
*-commutative84.8%
Simplified84.8%
Taylor expanded in y around inf 54.6%
Taylor expanded in x around 0 46.0%
*-commutative46.0%
Simplified46.0%
Taylor expanded in y around 0 60.9%
Final simplification73.3%
(FPCore (x y z t) :precision binary64 (if (<= x -2.35e-33) 1.0 (if (<= x 1.4e-9) x 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.35e-33) {
tmp = 1.0;
} else if (x <= 1.4e-9) {
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 <= (-2.35d-33)) then
tmp = 1.0d0
else if (x <= 1.4d-9) 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 <= -2.35e-33) {
tmp = 1.0;
} else if (x <= 1.4e-9) {
tmp = x;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -2.35e-33: tmp = 1.0 elif x <= 1.4e-9: tmp = x else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -2.35e-33) tmp = 1.0; elseif (x <= 1.4e-9) tmp = x; else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -2.35e-33) tmp = 1.0; elseif (x <= 1.4e-9) tmp = x; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -2.35e-33], 1.0, If[LessEqual[x, 1.4e-9], x, 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.35 \cdot 10^{-33}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{-9}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -2.3500000000000001e-33 or 1.39999999999999992e-9 < x Initial program 90.4%
*-commutative90.4%
Simplified90.4%
+-commutative90.4%
div-sub90.4%
associate-+l-90.4%
*-un-lft-identity90.4%
times-frac99.2%
fma-neg99.2%
Applied egg-rr99.2%
fma-udef99.2%
unsub-neg99.2%
/-rgt-identity99.2%
*-commutative99.2%
*-commutative99.2%
Simplified99.2%
Taylor expanded in z around 0 85.1%
if -2.3500000000000001e-33 < x < 1.39999999999999992e-9Initial program 85.2%
*-commutative85.2%
Simplified85.2%
Taylor expanded in t around inf 20.9%
+-commutative20.9%
Simplified20.9%
Taylor expanded in x around 0 20.6%
Final simplification54.3%
(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 87.9%
*-commutative87.9%
Simplified87.9%
+-commutative87.9%
div-sub87.9%
associate-+l-87.9%
*-un-lft-identity87.9%
times-frac95.1%
fma-neg95.1%
Applied egg-rr95.1%
fma-udef95.1%
unsub-neg95.1%
/-rgt-identity95.1%
*-commutative95.1%
*-commutative95.1%
Simplified95.1%
Taylor expanded in z around 0 49.8%
Final simplification49.8%
(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 2023279
(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)))