
(FPCore (x y z t) :precision binary64 (/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))
double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
def code(x, y, z, t): return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0)
function code(x, y, z, t) return Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / Float64(Float64(t * z) - x))) / Float64(x + 1.0)) end
function tmp = code(x, y, z, t) tmp = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0); end
code[x_, y_, z_, t_] := N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / N[(N[(t * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))
double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
def code(x, y, z, t): return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0)
function code(x, y, z, t) return Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / Float64(Float64(t * z) - x))) / Float64(x + 1.0)) end
function tmp = code(x, y, z, t) tmp = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0); end
code[x_, y_, z_, t_] := N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / N[(N[(t * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ (- (* y z) x) (- (* z t) x))) (+ x 1.0)))
(t_2 (- x (* z t))))
(if (<= t_1 (- INFINITY))
(/ (* y (+ (- (/ x y) (/ z t_2)) (/ x (* y t_2)))) (+ x 1.0))
(if (<= t_1 2e+306) t_1 (/ (+ x (/ y t)) (+ x 1.0))))))
double code(double x, double y, double z, double t) {
double t_1 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0);
double t_2 = x - (z * t);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (y * (((x / y) - (z / t_2)) + (x / (y * t_2)))) / (x + 1.0);
} else if (t_1 <= 2e+306) {
tmp = t_1;
} 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 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0);
double t_2 = x - (z * t);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = (y * (((x / y) - (z / t_2)) + (x / (y * t_2)))) / (x + 1.0);
} else if (t_1 <= 2e+306) {
tmp = t_1;
} else {
tmp = (x + (y / t)) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0) t_2 = x - (z * t) tmp = 0 if t_1 <= -math.inf: tmp = (y * (((x / y) - (z / t_2)) + (x / (y * t_2)))) / (x + 1.0) elif t_1 <= 2e+306: tmp = t_1 else: tmp = (x + (y / t)) / (x + 1.0) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / Float64(Float64(z * t) - x))) / Float64(x + 1.0)) t_2 = Float64(x - Float64(z * t)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(y * Float64(Float64(Float64(x / y) - Float64(z / t_2)) + Float64(x / Float64(y * t_2)))) / Float64(x + 1.0)); elseif (t_1 <= 2e+306) tmp = t_1; 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 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0); t_2 = x - (z * t); tmp = 0.0; if (t_1 <= -Inf) tmp = (y * (((x / y) - (z / t_2)) + (x / (y * t_2)))) / (x + 1.0); elseif (t_1 <= 2e+306) tmp = t_1; else tmp = (x + (y / t)) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(y * N[(N[(N[(x / y), $MachinePrecision] - N[(z / t$95$2), $MachinePrecision]), $MachinePrecision] + N[(x / N[(y * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+306], t$95$1, N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}\\
t_2 := x - z \cdot t\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{y \cdot \left(\left(\frac{x}{y} - \frac{z}{t\_2}\right) + \frac{x}{y \cdot t\_2}\right)}{x + 1}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+306}:\\
\;\;\;\;t\_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 #s(literal 1 binary64))) < -inf.0Initial program 50.1%
*-commutative50.1%
Simplified50.1%
Taylor expanded in y around inf 95.6%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 2.00000000000000003e306Initial program 99.9%
if 2.00000000000000003e306 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) Initial program 19.4%
*-commutative19.4%
Simplified19.4%
Taylor expanded in z around inf 99.9%
+-commutative99.9%
+-commutative99.9%
Simplified99.9%
Final simplification99.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ y t)) (+ x 1.0)))
(t_2 (- (* z t) x))
(t_3 (* (/ z t_2) (/ y (+ x 1.0))))
(t_4 (/ (+ x (/ (- (* y z) x) t_2)) (+ x 1.0))))
(if (<= t_4 -5.0)
t_3
(if (<= t_4 5e-52)
t_1
(if (<= t_4 1e-6)
(/ (/ (- (/ x z) y) t) (- -1.0 x))
(if (<= t_4 2.0) 1.0 (if (<= t_4 2e+306) t_3 t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double t_2 = (z * t) - x;
double t_3 = (z / t_2) * (y / (x + 1.0));
double t_4 = (x + (((y * z) - x) / t_2)) / (x + 1.0);
double tmp;
if (t_4 <= -5.0) {
tmp = t_3;
} else if (t_4 <= 5e-52) {
tmp = t_1;
} else if (t_4 <= 1e-6) {
tmp = (((x / z) - y) / t) / (-1.0 - x);
} else if (t_4 <= 2.0) {
tmp = 1.0;
} else if (t_4 <= 2e+306) {
tmp = t_3;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = (x + (y / t)) / (x + 1.0d0)
t_2 = (z * t) - x
t_3 = (z / t_2) * (y / (x + 1.0d0))
t_4 = (x + (((y * z) - x) / t_2)) / (x + 1.0d0)
if (t_4 <= (-5.0d0)) then
tmp = t_3
else if (t_4 <= 5d-52) then
tmp = t_1
else if (t_4 <= 1d-6) then
tmp = (((x / z) - y) / t) / ((-1.0d0) - x)
else if (t_4 <= 2.0d0) then
tmp = 1.0d0
else if (t_4 <= 2d+306) then
tmp = t_3
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double t_2 = (z * t) - x;
double t_3 = (z / t_2) * (y / (x + 1.0));
double t_4 = (x + (((y * z) - x) / t_2)) / (x + 1.0);
double tmp;
if (t_4 <= -5.0) {
tmp = t_3;
} else if (t_4 <= 5e-52) {
tmp = t_1;
} else if (t_4 <= 1e-6) {
tmp = (((x / z) - y) / t) / (-1.0 - x);
} else if (t_4 <= 2.0) {
tmp = 1.0;
} else if (t_4 <= 2e+306) {
tmp = t_3;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x + (y / t)) / (x + 1.0) t_2 = (z * t) - x t_3 = (z / t_2) * (y / (x + 1.0)) t_4 = (x + (((y * z) - x) / t_2)) / (x + 1.0) tmp = 0 if t_4 <= -5.0: tmp = t_3 elif t_4 <= 5e-52: tmp = t_1 elif t_4 <= 1e-6: tmp = (((x / z) - y) / t) / (-1.0 - x) elif t_4 <= 2.0: tmp = 1.0 elif t_4 <= 2e+306: tmp = t_3 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)) t_2 = Float64(Float64(z * t) - x) t_3 = Float64(Float64(z / t_2) * Float64(y / Float64(x + 1.0))) t_4 = Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / t_2)) / Float64(x + 1.0)) tmp = 0.0 if (t_4 <= -5.0) tmp = t_3; elseif (t_4 <= 5e-52) tmp = t_1; elseif (t_4 <= 1e-6) tmp = Float64(Float64(Float64(Float64(x / z) - y) / t) / Float64(-1.0 - x)); elseif (t_4 <= 2.0) tmp = 1.0; elseif (t_4 <= 2e+306) tmp = t_3; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x + (y / t)) / (x + 1.0); t_2 = (z * t) - x; t_3 = (z / t_2) * (y / (x + 1.0)); t_4 = (x + (((y * z) - x) / t_2)) / (x + 1.0); tmp = 0.0; if (t_4 <= -5.0) tmp = t_3; elseif (t_4 <= 5e-52) tmp = t_1; elseif (t_4 <= 1e-6) tmp = (((x / z) - y) / t) / (-1.0 - x); elseif (t_4 <= 2.0) tmp = 1.0; elseif (t_4 <= 2e+306) tmp = t_3; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]}, Block[{t$95$3 = N[(N[(z / t$95$2), $MachinePrecision] * N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, -5.0], t$95$3, If[LessEqual[t$95$4, 5e-52], t$95$1, If[LessEqual[t$95$4, 1e-6], N[(N[(N[(N[(x / z), $MachinePrecision] - y), $MachinePrecision] / t), $MachinePrecision] / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, 2.0], 1.0, If[LessEqual[t$95$4, 2e+306], t$95$3, t$95$1]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y}{t}}{x + 1}\\
t_2 := z \cdot t - x\\
t_3 := \frac{z}{t\_2} \cdot \frac{y}{x + 1}\\
t_4 := \frac{x + \frac{y \cdot z - x}{t\_2}}{x + 1}\\
\mathbf{if}\;t\_4 \leq -5:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_4 \leq 5 \cdot 10^{-52}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_4 \leq 10^{-6}:\\
\;\;\;\;\frac{\frac{\frac{x}{z} - y}{t}}{-1 - x}\\
\mathbf{elif}\;t\_4 \leq 2:\\
\;\;\;\;1\\
\mathbf{elif}\;t\_4 \leq 2 \cdot 10^{+306}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\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))) < -5 or 2 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 2.00000000000000003e306Initial program 81.5%
*-commutative81.5%
Simplified81.5%
Taylor expanded in y around inf 78.9%
times-frac95.5%
+-commutative95.5%
Simplified95.5%
if -5 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 5e-52 or 2.00000000000000003e306 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) Initial program 73.0%
*-commutative73.0%
Simplified73.0%
Taylor expanded in z around inf 94.2%
+-commutative94.2%
+-commutative94.2%
Simplified94.2%
if 5e-52 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 9.99999999999999955e-7Initial program 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in t around -inf 99.6%
mul-1-neg99.6%
unsub-neg99.6%
sub-neg99.6%
mul-1-neg99.6%
remove-double-neg99.6%
+-commutative99.6%
mul-1-neg99.6%
unsub-neg99.6%
Simplified99.6%
Taylor expanded in t around 0 99.6%
if 9.99999999999999955e-7 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 2Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 99.4%
Final simplification97.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (/ y t)))
(t_2 (- (* z t) x))
(t_3 (* (/ z t_2) (/ y (+ x 1.0))))
(t_4 (/ (+ x (/ (- (* y z) x) t_2)) (+ x 1.0))))
(if (<= t_4 -5.0)
t_3
(if (<= t_4 1e-6)
(/ (- t_1 (/ x (* z t))) (+ x 1.0))
(if (<= t_4 2.0)
(/ (+ x (/ x (- x (* z t)))) (+ x 1.0))
(if (<= t_4 2e+306) t_3 (/ t_1 (+ x 1.0))))))))
double code(double x, double y, double z, double t) {
double t_1 = x + (y / t);
double t_2 = (z * t) - x;
double t_3 = (z / t_2) * (y / (x + 1.0));
double t_4 = (x + (((y * z) - x) / t_2)) / (x + 1.0);
double tmp;
if (t_4 <= -5.0) {
tmp = t_3;
} else if (t_4 <= 1e-6) {
tmp = (t_1 - (x / (z * t))) / (x + 1.0);
} else if (t_4 <= 2.0) {
tmp = (x + (x / (x - (z * t)))) / (x + 1.0);
} else if (t_4 <= 2e+306) {
tmp = t_3;
} else {
tmp = t_1 / (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) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = x + (y / t)
t_2 = (z * t) - x
t_3 = (z / t_2) * (y / (x + 1.0d0))
t_4 = (x + (((y * z) - x) / t_2)) / (x + 1.0d0)
if (t_4 <= (-5.0d0)) then
tmp = t_3
else if (t_4 <= 1d-6) then
tmp = (t_1 - (x / (z * t))) / (x + 1.0d0)
else if (t_4 <= 2.0d0) then
tmp = (x + (x / (x - (z * t)))) / (x + 1.0d0)
else if (t_4 <= 2d+306) then
tmp = t_3
else
tmp = t_1 / (x + 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);
double t_2 = (z * t) - x;
double t_3 = (z / t_2) * (y / (x + 1.0));
double t_4 = (x + (((y * z) - x) / t_2)) / (x + 1.0);
double tmp;
if (t_4 <= -5.0) {
tmp = t_3;
} else if (t_4 <= 1e-6) {
tmp = (t_1 - (x / (z * t))) / (x + 1.0);
} else if (t_4 <= 2.0) {
tmp = (x + (x / (x - (z * t)))) / (x + 1.0);
} else if (t_4 <= 2e+306) {
tmp = t_3;
} else {
tmp = t_1 / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = x + (y / t) t_2 = (z * t) - x t_3 = (z / t_2) * (y / (x + 1.0)) t_4 = (x + (((y * z) - x) / t_2)) / (x + 1.0) tmp = 0 if t_4 <= -5.0: tmp = t_3 elif t_4 <= 1e-6: tmp = (t_1 - (x / (z * t))) / (x + 1.0) elif t_4 <= 2.0: tmp = (x + (x / (x - (z * t)))) / (x + 1.0) elif t_4 <= 2e+306: tmp = t_3 else: tmp = t_1 / (x + 1.0) return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(y / t)) t_2 = Float64(Float64(z * t) - x) t_3 = Float64(Float64(z / t_2) * Float64(y / Float64(x + 1.0))) t_4 = Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / t_2)) / Float64(x + 1.0)) tmp = 0.0 if (t_4 <= -5.0) tmp = t_3; elseif (t_4 <= 1e-6) tmp = Float64(Float64(t_1 - Float64(x / Float64(z * t))) / Float64(x + 1.0)); elseif (t_4 <= 2.0) tmp = Float64(Float64(x + Float64(x / Float64(x - Float64(z * t)))) / Float64(x + 1.0)); elseif (t_4 <= 2e+306) tmp = t_3; else tmp = Float64(t_1 / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + (y / t); t_2 = (z * t) - x; t_3 = (z / t_2) * (y / (x + 1.0)); t_4 = (x + (((y * z) - x) / t_2)) / (x + 1.0); tmp = 0.0; if (t_4 <= -5.0) tmp = t_3; elseif (t_4 <= 1e-6) tmp = (t_1 - (x / (z * t))) / (x + 1.0); elseif (t_4 <= 2.0) tmp = (x + (x / (x - (z * t)))) / (x + 1.0); elseif (t_4 <= 2e+306) tmp = t_3; else tmp = t_1 / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]}, Block[{t$95$3 = N[(N[(z / t$95$2), $MachinePrecision] * N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, -5.0], t$95$3, If[LessEqual[t$95$4, 1e-6], N[(N[(t$95$1 - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, 2.0], N[(N[(x + N[(x / N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, 2e+306], t$95$3, N[(t$95$1 / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y}{t}\\
t_2 := z \cdot t - x\\
t_3 := \frac{z}{t\_2} \cdot \frac{y}{x + 1}\\
t_4 := \frac{x + \frac{y \cdot z - x}{t\_2}}{x + 1}\\
\mathbf{if}\;t\_4 \leq -5:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_4 \leq 10^{-6}:\\
\;\;\;\;\frac{t\_1 - \frac{x}{z \cdot t}}{x + 1}\\
\mathbf{elif}\;t\_4 \leq 2:\\
\;\;\;\;\frac{x + \frac{x}{x - z \cdot t}}{x + 1}\\
\mathbf{elif}\;t\_4 \leq 2 \cdot 10^{+306}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_1}{x + 1}\\
\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))) < -5 or 2 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 2.00000000000000003e306Initial program 81.5%
*-commutative81.5%
Simplified81.5%
Taylor expanded in y around inf 78.9%
times-frac95.5%
+-commutative95.5%
Simplified95.5%
if -5 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 9.99999999999999955e-7Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around inf 99.9%
if 9.99999999999999955e-7 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 2Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 99.9%
+-commutative99.9%
Simplified99.9%
if 2.00000000000000003e306 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) Initial program 19.4%
*-commutative19.4%
Simplified19.4%
Taylor expanded in z around inf 99.9%
+-commutative99.9%
+-commutative99.9%
Simplified99.9%
Final simplification98.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* z t) x))
(t_2 (* (/ z t_1) (/ y (+ x 1.0))))
(t_3 (/ (+ x (/ (- (* y z) x) t_1)) (+ x 1.0))))
(if (<= t_3 -5.0)
t_2
(if (<= t_3 1e-6)
(/ (+ x (/ (- y (/ x z)) t)) (+ x 1.0))
(if (<= t_3 2.0)
(/ (+ x (/ x (- x (* z t)))) (+ x 1.0))
(if (<= t_3 2e+306) t_2 (/ (+ x (/ y t)) (+ x 1.0))))))))
double code(double x, double y, double z, double t) {
double t_1 = (z * t) - x;
double t_2 = (z / t_1) * (y / (x + 1.0));
double t_3 = (x + (((y * z) - x) / t_1)) / (x + 1.0);
double tmp;
if (t_3 <= -5.0) {
tmp = t_2;
} else if (t_3 <= 1e-6) {
tmp = (x + ((y - (x / z)) / t)) / (x + 1.0);
} else if (t_3 <= 2.0) {
tmp = (x + (x / (x - (z * t)))) / (x + 1.0);
} else if (t_3 <= 2e+306) {
tmp = t_2;
} 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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (z * t) - x
t_2 = (z / t_1) * (y / (x + 1.0d0))
t_3 = (x + (((y * z) - x) / t_1)) / (x + 1.0d0)
if (t_3 <= (-5.0d0)) then
tmp = t_2
else if (t_3 <= 1d-6) then
tmp = (x + ((y - (x / z)) / t)) / (x + 1.0d0)
else if (t_3 <= 2.0d0) then
tmp = (x + (x / (x - (z * t)))) / (x + 1.0d0)
else if (t_3 <= 2d+306) then
tmp = t_2
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 t_1 = (z * t) - x;
double t_2 = (z / t_1) * (y / (x + 1.0));
double t_3 = (x + (((y * z) - x) / t_1)) / (x + 1.0);
double tmp;
if (t_3 <= -5.0) {
tmp = t_2;
} else if (t_3 <= 1e-6) {
tmp = (x + ((y - (x / z)) / t)) / (x + 1.0);
} else if (t_3 <= 2.0) {
tmp = (x + (x / (x - (z * t)))) / (x + 1.0);
} else if (t_3 <= 2e+306) {
tmp = t_2;
} else {
tmp = (x + (y / t)) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = (z * t) - x t_2 = (z / t_1) * (y / (x + 1.0)) t_3 = (x + (((y * z) - x) / t_1)) / (x + 1.0) tmp = 0 if t_3 <= -5.0: tmp = t_2 elif t_3 <= 1e-6: tmp = (x + ((y - (x / z)) / t)) / (x + 1.0) elif t_3 <= 2.0: tmp = (x + (x / (x - (z * t)))) / (x + 1.0) elif t_3 <= 2e+306: tmp = t_2 else: tmp = (x + (y / t)) / (x + 1.0) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z * t) - x) t_2 = Float64(Float64(z / t_1) * Float64(y / Float64(x + 1.0))) t_3 = Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / t_1)) / Float64(x + 1.0)) tmp = 0.0 if (t_3 <= -5.0) tmp = t_2; elseif (t_3 <= 1e-6) tmp = Float64(Float64(x + Float64(Float64(y - Float64(x / z)) / t)) / Float64(x + 1.0)); elseif (t_3 <= 2.0) tmp = Float64(Float64(x + Float64(x / Float64(x - Float64(z * t)))) / Float64(x + 1.0)); elseif (t_3 <= 2e+306) tmp = t_2; 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; t_2 = (z / t_1) * (y / (x + 1.0)); t_3 = (x + (((y * z) - x) / t_1)) / (x + 1.0); tmp = 0.0; if (t_3 <= -5.0) tmp = t_2; elseif (t_3 <= 1e-6) tmp = (x + ((y - (x / z)) / t)) / (x + 1.0); elseif (t_3 <= 2.0) tmp = (x + (x / (x - (z * t)))) / (x + 1.0); elseif (t_3 <= 2e+306) tmp = t_2; 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]}, Block[{t$95$2 = N[(N[(z / t$95$1), $MachinePrecision] * N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = 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$3, -5.0], t$95$2, If[LessEqual[t$95$3, 1e-6], N[(N[(x + N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 2.0], N[(N[(x + N[(x / N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 2e+306], t$95$2, 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\\
t_2 := \frac{z}{t\_1} \cdot \frac{y}{x + 1}\\
t_3 := \frac{x + \frac{y \cdot z - x}{t\_1}}{x + 1}\\
\mathbf{if}\;t\_3 \leq -5:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq 10^{-6}:\\
\;\;\;\;\frac{x + \frac{y - \frac{x}{z}}{t}}{x + 1}\\
\mathbf{elif}\;t\_3 \leq 2:\\
\;\;\;\;\frac{x + \frac{x}{x - z \cdot t}}{x + 1}\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+306}:\\
\;\;\;\;t\_2\\
\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 #s(literal 1 binary64))) < -5 or 2 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 2.00000000000000003e306Initial program 81.5%
*-commutative81.5%
Simplified81.5%
Taylor expanded in y around inf 78.9%
times-frac95.5%
+-commutative95.5%
Simplified95.5%
if -5 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 9.99999999999999955e-7Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around -inf 99.9%
mul-1-neg99.9%
unsub-neg99.9%
sub-neg99.9%
mul-1-neg99.9%
remove-double-neg99.9%
+-commutative99.9%
mul-1-neg99.9%
unsub-neg99.9%
Simplified99.9%
if 9.99999999999999955e-7 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 2Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 99.9%
+-commutative99.9%
Simplified99.9%
if 2.00000000000000003e306 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) Initial program 19.4%
*-commutative19.4%
Simplified19.4%
Taylor expanded in z around inf 99.9%
+-commutative99.9%
+-commutative99.9%
Simplified99.9%
Final simplification98.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ y t)) (+ x 1.0)))
(t_2 (- (* z t) x))
(t_3 (* (/ z t_2) (/ y (+ x 1.0))))
(t_4 (/ (+ x (/ (- (* y z) x) t_2)) (+ x 1.0))))
(if (<= t_4 -5.0)
t_3
(if (<= t_4 2e-58)
t_1
(if (<= t_4 2.0)
(/ (+ x (/ x (- x (* z t)))) (+ x 1.0))
(if (<= t_4 2e+306) t_3 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double t_2 = (z * t) - x;
double t_3 = (z / t_2) * (y / (x + 1.0));
double t_4 = (x + (((y * z) - x) / t_2)) / (x + 1.0);
double tmp;
if (t_4 <= -5.0) {
tmp = t_3;
} else if (t_4 <= 2e-58) {
tmp = t_1;
} else if (t_4 <= 2.0) {
tmp = (x + (x / (x - (z * t)))) / (x + 1.0);
} else if (t_4 <= 2e+306) {
tmp = t_3;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = (x + (y / t)) / (x + 1.0d0)
t_2 = (z * t) - x
t_3 = (z / t_2) * (y / (x + 1.0d0))
t_4 = (x + (((y * z) - x) / t_2)) / (x + 1.0d0)
if (t_4 <= (-5.0d0)) then
tmp = t_3
else if (t_4 <= 2d-58) then
tmp = t_1
else if (t_4 <= 2.0d0) then
tmp = (x + (x / (x - (z * t)))) / (x + 1.0d0)
else if (t_4 <= 2d+306) then
tmp = t_3
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double t_2 = (z * t) - x;
double t_3 = (z / t_2) * (y / (x + 1.0));
double t_4 = (x + (((y * z) - x) / t_2)) / (x + 1.0);
double tmp;
if (t_4 <= -5.0) {
tmp = t_3;
} else if (t_4 <= 2e-58) {
tmp = t_1;
} else if (t_4 <= 2.0) {
tmp = (x + (x / (x - (z * t)))) / (x + 1.0);
} else if (t_4 <= 2e+306) {
tmp = t_3;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x + (y / t)) / (x + 1.0) t_2 = (z * t) - x t_3 = (z / t_2) * (y / (x + 1.0)) t_4 = (x + (((y * z) - x) / t_2)) / (x + 1.0) tmp = 0 if t_4 <= -5.0: tmp = t_3 elif t_4 <= 2e-58: tmp = t_1 elif t_4 <= 2.0: tmp = (x + (x / (x - (z * t)))) / (x + 1.0) elif t_4 <= 2e+306: tmp = t_3 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)) t_2 = Float64(Float64(z * t) - x) t_3 = Float64(Float64(z / t_2) * Float64(y / Float64(x + 1.0))) t_4 = Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / t_2)) / Float64(x + 1.0)) tmp = 0.0 if (t_4 <= -5.0) tmp = t_3; elseif (t_4 <= 2e-58) tmp = t_1; elseif (t_4 <= 2.0) tmp = Float64(Float64(x + Float64(x / Float64(x - Float64(z * t)))) / Float64(x + 1.0)); elseif (t_4 <= 2e+306) tmp = t_3; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x + (y / t)) / (x + 1.0); t_2 = (z * t) - x; t_3 = (z / t_2) * (y / (x + 1.0)); t_4 = (x + (((y * z) - x) / t_2)) / (x + 1.0); tmp = 0.0; if (t_4 <= -5.0) tmp = t_3; elseif (t_4 <= 2e-58) tmp = t_1; elseif (t_4 <= 2.0) tmp = (x + (x / (x - (z * t)))) / (x + 1.0); elseif (t_4 <= 2e+306) tmp = t_3; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]}, Block[{t$95$3 = N[(N[(z / t$95$2), $MachinePrecision] * N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, -5.0], t$95$3, If[LessEqual[t$95$4, 2e-58], t$95$1, If[LessEqual[t$95$4, 2.0], N[(N[(x + N[(x / N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, 2e+306], t$95$3, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y}{t}}{x + 1}\\
t_2 := z \cdot t - x\\
t_3 := \frac{z}{t\_2} \cdot \frac{y}{x + 1}\\
t_4 := \frac{x + \frac{y \cdot z - x}{t\_2}}{x + 1}\\
\mathbf{if}\;t\_4 \leq -5:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_4 \leq 2 \cdot 10^{-58}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_4 \leq 2:\\
\;\;\;\;\frac{x + \frac{x}{x - z \cdot t}}{x + 1}\\
\mathbf{elif}\;t\_4 \leq 2 \cdot 10^{+306}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\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))) < -5 or 2 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 2.00000000000000003e306Initial program 81.5%
*-commutative81.5%
Simplified81.5%
Taylor expanded in y around inf 78.9%
times-frac95.5%
+-commutative95.5%
Simplified95.5%
if -5 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 2.0000000000000001e-58 or 2.00000000000000003e306 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) Initial program 72.5%
*-commutative72.5%
Simplified72.5%
Taylor expanded in z around inf 94.1%
+-commutative94.1%
+-commutative94.1%
Simplified94.1%
if 2.0000000000000001e-58 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 2Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in y around 0 97.7%
+-commutative97.7%
Simplified97.7%
Final simplification96.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ y t)) (+ x 1.0)))
(t_2 (/ (+ x (/ (- (* y z) x) (- (* z t) x))) (+ x 1.0))))
(if (<= t_2 5e-52)
t_1
(if (<= t_2 1e-6)
(/ (/ (- (/ x z) y) t) (- -1.0 x))
(if (<= t_2 1.00000000000005) 1.0 t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double t_2 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0);
double tmp;
if (t_2 <= 5e-52) {
tmp = t_1;
} else if (t_2 <= 1e-6) {
tmp = (((x / z) - y) / t) / (-1.0 - x);
} else if (t_2 <= 1.00000000000005) {
tmp = 1.0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x + (y / t)) / (x + 1.0d0)
t_2 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0d0)
if (t_2 <= 5d-52) then
tmp = t_1
else if (t_2 <= 1d-6) then
tmp = (((x / z) - y) / t) / ((-1.0d0) - x)
else if (t_2 <= 1.00000000000005d0) then
tmp = 1.0d0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double t_2 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0);
double tmp;
if (t_2 <= 5e-52) {
tmp = t_1;
} else if (t_2 <= 1e-6) {
tmp = (((x / z) - y) / t) / (-1.0 - x);
} else if (t_2 <= 1.00000000000005) {
tmp = 1.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x + (y / t)) / (x + 1.0) t_2 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0) tmp = 0 if t_2 <= 5e-52: tmp = t_1 elif t_2 <= 1e-6: tmp = (((x / z) - y) / t) / (-1.0 - x) elif t_2 <= 1.00000000000005: tmp = 1.0 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)) t_2 = Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / Float64(Float64(z * t) - x))) / Float64(x + 1.0)) tmp = 0.0 if (t_2 <= 5e-52) tmp = t_1; elseif (t_2 <= 1e-6) tmp = Float64(Float64(Float64(Float64(x / z) - y) / t) / Float64(-1.0 - x)); elseif (t_2 <= 1.00000000000005) tmp = 1.0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x + (y / t)) / (x + 1.0); t_2 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0); tmp = 0.0; if (t_2 <= 5e-52) tmp = t_1; elseif (t_2 <= 1e-6) tmp = (((x / z) - y) / t) / (-1.0 - x); elseif (t_2 <= 1.00000000000005) tmp = 1.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 5e-52], t$95$1, If[LessEqual[t$95$2, 1e-6], N[(N[(N[(N[(x / z), $MachinePrecision] - y), $MachinePrecision] / t), $MachinePrecision] / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1.00000000000005], 1.0, t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y}{t}}{x + 1}\\
t_2 := \frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}\\
\mathbf{if}\;t\_2 \leq 5 \cdot 10^{-52}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{-6}:\\
\;\;\;\;\frac{\frac{\frac{x}{z} - y}{t}}{-1 - x}\\
\mathbf{elif}\;t\_2 \leq 1.00000000000005:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\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))) < 5e-52 or 1.00000000000004996 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) Initial program 77.9%
*-commutative77.9%
Simplified77.9%
Taylor expanded in z around inf 72.5%
+-commutative72.5%
+-commutative72.5%
Simplified72.5%
if 5e-52 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 9.99999999999999955e-7Initial program 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in t around -inf 99.6%
mul-1-neg99.6%
unsub-neg99.6%
sub-neg99.6%
mul-1-neg99.6%
remove-double-neg99.6%
+-commutative99.6%
mul-1-neg99.6%
unsub-neg99.6%
Simplified99.6%
Taylor expanded in t around 0 99.6%
if 9.99999999999999955e-7 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 1.00000000000004996Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 99.5%
Final simplification87.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ y (* t (+ x 1.0))))
(t_2 (/ (+ x (/ (- (* y z) x) (- (* z t) x))) (+ x 1.0))))
(if (<= t_2 -5e-60)
t_1
(if (<= t_2 5e-26)
(* x (+ 1.0 (/ (/ -1.0 t) z)))
(if (<= t_2 2.0) 1.0 t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = y / (t * (x + 1.0));
double t_2 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0);
double tmp;
if (t_2 <= -5e-60) {
tmp = t_1;
} else if (t_2 <= 5e-26) {
tmp = x * (1.0 + ((-1.0 / t) / z));
} else if (t_2 <= 2.0) {
tmp = 1.0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = y / (t * (x + 1.0d0))
t_2 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0d0)
if (t_2 <= (-5d-60)) then
tmp = t_1
else if (t_2 <= 5d-26) then
tmp = x * (1.0d0 + (((-1.0d0) / t) / z))
else if (t_2 <= 2.0d0) then
tmp = 1.0d0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y / (t * (x + 1.0));
double t_2 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0);
double tmp;
if (t_2 <= -5e-60) {
tmp = t_1;
} else if (t_2 <= 5e-26) {
tmp = x * (1.0 + ((-1.0 / t) / z));
} else if (t_2 <= 2.0) {
tmp = 1.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y / (t * (x + 1.0)) t_2 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0) tmp = 0 if t_2 <= -5e-60: tmp = t_1 elif t_2 <= 5e-26: tmp = x * (1.0 + ((-1.0 / t) / z)) elif t_2 <= 2.0: tmp = 1.0 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y / Float64(t * Float64(x + 1.0))) t_2 = Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / Float64(Float64(z * t) - x))) / Float64(x + 1.0)) tmp = 0.0 if (t_2 <= -5e-60) tmp = t_1; elseif (t_2 <= 5e-26) tmp = Float64(x * Float64(1.0 + Float64(Float64(-1.0 / t) / z))); elseif (t_2 <= 2.0) tmp = 1.0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y / (t * (x + 1.0)); t_2 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0); tmp = 0.0; if (t_2 <= -5e-60) tmp = t_1; elseif (t_2 <= 5e-26) tmp = x * (1.0 + ((-1.0 / t) / z)); elseif (t_2 <= 2.0) tmp = 1.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y / N[(t * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e-60], t$95$1, If[LessEqual[t$95$2, 5e-26], N[(x * N[(1.0 + N[(N[(-1.0 / t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2.0], 1.0, t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{t \cdot \left(x + 1\right)}\\
t_2 := \frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{-60}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-26}:\\
\;\;\;\;x \cdot \left(1 + \frac{\frac{-1}{t}}{z}\right)\\
\mathbf{elif}\;t\_2 \leq 2:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\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))) < -5.0000000000000001e-60 or 2 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) Initial program 71.1%
*-commutative71.1%
Simplified71.1%
Taylor expanded in t around -inf 67.5%
mul-1-neg67.5%
unsub-neg67.5%
sub-neg67.5%
mul-1-neg67.5%
remove-double-neg67.5%
+-commutative67.5%
mul-1-neg67.5%
unsub-neg67.5%
Simplified67.5%
Taylor expanded in y around inf 54.6%
if -5.0000000000000001e-60 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 5.00000000000000019e-26Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in y around 0 69.2%
+-commutative69.2%
Simplified69.2%
Taylor expanded in x around 0 69.2%
associate-/r*69.2%
Simplified69.2%
if 5.00000000000000019e-26 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 2Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 97.5%
Final simplification79.3%
(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 (- INFINITY))
(* (/ z t_1) (/ y (+ x 1.0)))
(if (<= t_2 2e+306) t_2 (/ (+ x (/ 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) - x) / t_1)) / (x + 1.0);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = (z / t_1) * (y / (x + 1.0));
} else if (t_2 <= 2e+306) {
tmp = t_2;
} 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 t_2 = (x + (((y * z) - x) / t_1)) / (x + 1.0);
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = (z / t_1) * (y / (x + 1.0));
} else if (t_2 <= 2e+306) {
tmp = t_2;
} else {
tmp = (x + (y / t)) / (x + 1.0);
}
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 <= -math.inf: tmp = (z / t_1) * (y / (x + 1.0)) elif t_2 <= 2e+306: tmp = t_2 else: tmp = (x + (y / t)) / (x + 1.0) 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 <= Float64(-Inf)) tmp = Float64(Float64(z / t_1) * Float64(y / Float64(x + 1.0))); elseif (t_2 <= 2e+306) tmp = t_2; 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; t_2 = (x + (((y * z) - x) / t_1)) / (x + 1.0); tmp = 0.0; if (t_2 <= -Inf) tmp = (z / t_1) * (y / (x + 1.0)); elseif (t_2 <= 2e+306) tmp = t_2; 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]}, 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, (-Infinity)], N[(N[(z / t$95$1), $MachinePrecision] * N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+306], t$95$2, 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\\
t_2 := \frac{x + \frac{y \cdot z - x}{t\_1}}{x + 1}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;\frac{z}{t\_1} \cdot \frac{y}{x + 1}\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+306}:\\
\;\;\;\;t\_2\\
\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 #s(literal 1 binary64))) < -inf.0Initial program 50.1%
*-commutative50.1%
Simplified50.1%
Taylor expanded in y around inf 49.7%
times-frac95.3%
+-commutative95.3%
Simplified95.3%
if -inf.0 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 2.00000000000000003e306Initial program 99.9%
if 2.00000000000000003e306 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) Initial program 19.4%
*-commutative19.4%
Simplified19.4%
Taylor expanded in z around inf 99.9%
+-commutative99.9%
+-commutative99.9%
Simplified99.9%
Final simplification99.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ (- (* y z) x) (- (* z t) x))) (+ x 1.0))))
(if (or (<= t_1 1e-6) (not (<= t_1 1.00000000000005)))
(/ (+ x (/ y t)) (+ x 1.0))
1.0)))
double code(double x, double y, double z, double t) {
double t_1 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0);
double tmp;
if ((t_1 <= 1e-6) || !(t_1 <= 1.00000000000005)) {
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) :: t_1
real(8) :: tmp
t_1 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0d0)
if ((t_1 <= 1d-6) .or. (.not. (t_1 <= 1.00000000000005d0))) 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 t_1 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0);
double tmp;
if ((t_1 <= 1e-6) || !(t_1 <= 1.00000000000005)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0) tmp = 0 if (t_1 <= 1e-6) or not (t_1 <= 1.00000000000005): tmp = (x + (y / t)) / (x + 1.0) else: tmp = 1.0 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / Float64(Float64(z * t) - x))) / Float64(x + 1.0)) tmp = 0.0 if ((t_1 <= 1e-6) || !(t_1 <= 1.00000000000005)) 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) t_1 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0); tmp = 0.0; if ((t_1 <= 1e-6) || ~((t_1 <= 1.00000000000005))) tmp = (x + (y / t)) / (x + 1.0); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, 1e-6], N[Not[LessEqual[t$95$1, 1.00000000000005]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}\\
\mathbf{if}\;t\_1 \leq 10^{-6} \lor \neg \left(t\_1 \leq 1.00000000000005\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1\\
\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))) < 9.99999999999999955e-7 or 1.00000000000004996 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) Initial program 79.3%
*-commutative79.3%
Simplified79.3%
Taylor expanded in z around inf 70.5%
+-commutative70.5%
+-commutative70.5%
Simplified70.5%
if 9.99999999999999955e-7 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 1.00000000000004996Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 99.5%
Final simplification85.6%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ (+ x (/ (- (* y z) x) (- (* z t) x))) (+ x 1.0)))) (if (or (<= t_1 1e-6) (not (<= t_1 2.0))) (/ y (* t (+ x 1.0))) 1.0)))
double code(double x, double y, double z, double t) {
double t_1 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0);
double tmp;
if ((t_1 <= 1e-6) || !(t_1 <= 2.0)) {
tmp = 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) :: t_1
real(8) :: tmp
t_1 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0d0)
if ((t_1 <= 1d-6) .or. (.not. (t_1 <= 2.0d0))) then
tmp = 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 t_1 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0);
double tmp;
if ((t_1 <= 1e-6) || !(t_1 <= 2.0)) {
tmp = y / (t * (x + 1.0));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0) tmp = 0 if (t_1 <= 1e-6) or not (t_1 <= 2.0): tmp = y / (t * (x + 1.0)) else: tmp = 1.0 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / Float64(Float64(z * t) - x))) / Float64(x + 1.0)) tmp = 0.0 if ((t_1 <= 1e-6) || !(t_1 <= 2.0)) tmp = Float64(y / Float64(t * Float64(x + 1.0))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0); tmp = 0.0; if ((t_1 <= 1e-6) || ~((t_1 <= 2.0))) tmp = y / (t * (x + 1.0)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, 1e-6], N[Not[LessEqual[t$95$1, 2.0]], $MachinePrecision]], N[(y / N[(t * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}\\
\mathbf{if}\;t\_1 \leq 10^{-6} \lor \neg \left(t\_1 \leq 2\right):\\
\;\;\;\;\frac{y}{t \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;1\\
\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))) < 9.99999999999999955e-7 or 2 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) Initial program 79.1%
*-commutative79.1%
Simplified79.1%
Taylor expanded in t around -inf 76.5%
mul-1-neg76.5%
unsub-neg76.5%
sub-neg76.5%
mul-1-neg76.5%
remove-double-neg76.5%
+-commutative76.5%
mul-1-neg76.5%
unsub-neg76.5%
Simplified76.5%
Taylor expanded in y around inf 50.0%
if 9.99999999999999955e-7 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 2Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 99.4%
Final simplification75.8%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ (+ x (/ (- (* y z) x) (- (* z t) x))) (+ x 1.0)))) (if (or (<= t_1 1e-6) (not (<= t_1 5e+24))) (/ y t) 1.0)))
double code(double x, double y, double z, double t) {
double t_1 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0);
double tmp;
if ((t_1 <= 1e-6) || !(t_1 <= 5e+24)) {
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) :: t_1
real(8) :: tmp
t_1 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0d0)
if ((t_1 <= 1d-6) .or. (.not. (t_1 <= 5d+24))) 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 t_1 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0);
double tmp;
if ((t_1 <= 1e-6) || !(t_1 <= 5e+24)) {
tmp = y / t;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0) tmp = 0 if (t_1 <= 1e-6) or not (t_1 <= 5e+24): tmp = y / t else: tmp = 1.0 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / Float64(Float64(z * t) - x))) / Float64(x + 1.0)) tmp = 0.0 if ((t_1 <= 1e-6) || !(t_1 <= 5e+24)) tmp = Float64(y / t); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x + (((y * z) - x) / ((z * t) - x))) / (x + 1.0); tmp = 0.0; if ((t_1 <= 1e-6) || ~((t_1 <= 5e+24))) tmp = y / t; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, 1e-6], N[Not[LessEqual[t$95$1, 5e+24]], $MachinePrecision]], N[(y / t), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y \cdot z - x}{z \cdot t - x}}{x + 1}\\
\mathbf{if}\;t\_1 \leq 10^{-6} \lor \neg \left(t\_1 \leq 5 \cdot 10^{+24}\right):\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\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))) < 9.99999999999999955e-7 or 5.00000000000000045e24 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) Initial program 78.6%
*-commutative78.6%
Simplified78.6%
Taylor expanded in x around 0 47.2%
if 9.99999999999999955e-7 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 5.00000000000000045e24Initial program 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in x around inf 97.4%
Final simplification74.1%
(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 90.1%
*-commutative90.1%
Simplified90.1%
Taylor expanded in x around inf 56.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 2024191
(FPCore (x y z t)
:name "Diagrams.Trail:splitAtParam from diagrams-lib-1.3.0.3, A"
:precision binary64
:alt
(! :herbie-platform default (/ (+ x (- (/ y (- t (/ x z))) (/ x (- (* t z) x)))) (+ x 1)))
(/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))