
(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)) (t_2 (/ (+ x (/ (- (* y z) x) t_1)) (+ x 1.0))))
(if (<= t_2 -2e+145)
(* y (/ (/ z (+ x 1.0)) t_1))
(if (<= t_2 5e+258)
t_2
(+
(- (/ x (+ x 1.0)) (/ y (* t (- -1.0 x))))
(/ x (* t (* z (- -1.0 x)))))))))
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 <= -2e+145) {
tmp = y * ((z / (x + 1.0)) / t_1);
} else if (t_2 <= 5e+258) {
tmp = t_2;
} else {
tmp = ((x / (x + 1.0)) - (y / (t * (-1.0 - x)))) + (x / (t * (z * (-1.0 - x))));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: 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 <= (-2d+145)) then
tmp = y * ((z / (x + 1.0d0)) / t_1)
else if (t_2 <= 5d+258) then
tmp = t_2
else
tmp = ((x / (x + 1.0d0)) - (y / (t * ((-1.0d0) - x)))) + (x / (t * (z * ((-1.0d0) - x))))
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 <= -2e+145) {
tmp = y * ((z / (x + 1.0)) / t_1);
} else if (t_2 <= 5e+258) {
tmp = t_2;
} else {
tmp = ((x / (x + 1.0)) - (y / (t * (-1.0 - x)))) + (x / (t * (z * (-1.0 - x))));
}
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 <= -2e+145: tmp = y * ((z / (x + 1.0)) / t_1) elif t_2 <= 5e+258: tmp = t_2 else: tmp = ((x / (x + 1.0)) - (y / (t * (-1.0 - x)))) + (x / (t * (z * (-1.0 - x)))) 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 <= -2e+145) tmp = Float64(y * Float64(Float64(z / Float64(x + 1.0)) / t_1)); elseif (t_2 <= 5e+258) tmp = t_2; else tmp = Float64(Float64(Float64(x / Float64(x + 1.0)) - Float64(y / Float64(t * Float64(-1.0 - x)))) + Float64(x / Float64(t * Float64(z * Float64(-1.0 - x))))); 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 <= -2e+145) tmp = y * ((z / (x + 1.0)) / t_1); elseif (t_2 <= 5e+258) tmp = t_2; else tmp = ((x / (x + 1.0)) - (y / (t * (-1.0 - x)))) + (x / (t * (z * (-1.0 - x)))); 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, -2e+145], N[(y * N[(N[(z / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+258], t$95$2, N[(N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] - N[(y / N[(t * N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x / N[(t * N[(z * N[(-1.0 - x), $MachinePrecision]), $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 -2 \cdot 10^{+145}:\\
\;\;\;\;y \cdot \frac{\frac{z}{x + 1}}{t\_1}\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+258}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{x}{x + 1} - \frac{y}{t \cdot \left(-1 - x\right)}\right) + \frac{x}{t \cdot \left(z \cdot \left(-1 - x\right)\right)}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < -2e145Initial program 59.4%
*-commutative59.4%
Simplified59.4%
Taylor expanded in y around inf 59.0%
associate-/l*85.8%
associate-/r*95.0%
+-commutative95.0%
Simplified95.0%
if -2e145 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 5e258Initial program 99.4%
if 5e258 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) Initial program 27.2%
*-commutative27.2%
Simplified27.2%
Taylor expanded in t around inf 89.8%
Final simplification98.0%
(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 -2e+145)
(* y (/ (/ z (+ x 1.0)) t_1))
(if (<= t_2 5e+258)
t_2
(- (/ x (+ x 1.0)) (/ (- (/ x (* z (+ x 1.0))) (/ y (+ x 1.0))) 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 <= -2e+145) {
tmp = y * ((z / (x + 1.0)) / t_1);
} else if (t_2 <= 5e+258) {
tmp = t_2;
} else {
tmp = (x / (x + 1.0)) - (((x / (z * (x + 1.0))) - (y / (x + 1.0))) / 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 <= (-2d+145)) then
tmp = y * ((z / (x + 1.0d0)) / t_1)
else if (t_2 <= 5d+258) then
tmp = t_2
else
tmp = (x / (x + 1.0d0)) - (((x / (z * (x + 1.0d0))) - (y / (x + 1.0d0))) / 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 <= -2e+145) {
tmp = y * ((z / (x + 1.0)) / t_1);
} else if (t_2 <= 5e+258) {
tmp = t_2;
} else {
tmp = (x / (x + 1.0)) - (((x / (z * (x + 1.0))) - (y / (x + 1.0))) / 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 <= -2e+145: tmp = y * ((z / (x + 1.0)) / t_1) elif t_2 <= 5e+258: tmp = t_2 else: tmp = (x / (x + 1.0)) - (((x / (z * (x + 1.0))) - (y / (x + 1.0))) / 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 <= -2e+145) tmp = Float64(y * Float64(Float64(z / Float64(x + 1.0)) / t_1)); elseif (t_2 <= 5e+258) tmp = t_2; else tmp = Float64(Float64(x / Float64(x + 1.0)) - Float64(Float64(Float64(x / Float64(z * Float64(x + 1.0))) - Float64(y / Float64(x + 1.0))) / 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 <= -2e+145) tmp = y * ((z / (x + 1.0)) / t_1); elseif (t_2 <= 5e+258) tmp = t_2; else tmp = (x / (x + 1.0)) - (((x / (z * (x + 1.0))) - (y / (x + 1.0))) / 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, -2e+145], N[(y * N[(N[(z / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+258], t$95$2, N[(N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(x / N[(z * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $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 -2 \cdot 10^{+145}:\\
\;\;\;\;y \cdot \frac{\frac{z}{x + 1}}{t\_1}\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+258}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + 1} - \frac{\frac{x}{z \cdot \left(x + 1\right)} - \frac{y}{x + 1}}{t}\\
\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))) < -2e145Initial program 59.4%
*-commutative59.4%
Simplified59.4%
Taylor expanded in y around inf 59.0%
associate-/l*85.8%
associate-/r*95.0%
+-commutative95.0%
Simplified95.0%
if -2e145 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 5e258Initial program 99.4%
if 5e258 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) Initial program 27.2%
*-commutative27.2%
Simplified27.2%
Taylor expanded in t around -inf 89.7%
+-commutative89.7%
mul-1-neg89.7%
unsub-neg89.7%
+-commutative89.7%
sub-neg89.7%
mul-1-neg89.7%
distribute-neg-frac289.7%
distribute-neg-in89.7%
metadata-eval89.7%
unsub-neg89.7%
mul-1-neg89.7%
remove-double-neg89.7%
+-commutative89.7%
Simplified89.7%
Final simplification98.0%
(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 -2e+145)
(* y (/ (/ z (+ x 1.0)) t_1))
(if (<= t_2 5e+258) 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 <= -2e+145) {
tmp = y * ((z / (x + 1.0)) / t_1);
} else if (t_2 <= 5e+258) {
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) :: tmp
t_1 = (z * t) - x
t_2 = (x + (((y * z) - x) / t_1)) / (x + 1.0d0)
if (t_2 <= (-2d+145)) then
tmp = y * ((z / (x + 1.0d0)) / t_1)
else if (t_2 <= 5d+258) 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 = (x + (((y * z) - x) / t_1)) / (x + 1.0);
double tmp;
if (t_2 <= -2e+145) {
tmp = y * ((z / (x + 1.0)) / t_1);
} else if (t_2 <= 5e+258) {
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 <= -2e+145: tmp = y * ((z / (x + 1.0)) / t_1) elif t_2 <= 5e+258: 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 <= -2e+145) tmp = Float64(y * Float64(Float64(z / Float64(x + 1.0)) / t_1)); elseif (t_2 <= 5e+258) 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 <= -2e+145) tmp = y * ((z / (x + 1.0)) / t_1); elseif (t_2 <= 5e+258) 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, -2e+145], N[(y * N[(N[(z / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+258], 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 -2 \cdot 10^{+145}:\\
\;\;\;\;y \cdot \frac{\frac{z}{x + 1}}{t\_1}\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+258}:\\
\;\;\;\;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))) < -2e145Initial program 59.4%
*-commutative59.4%
Simplified59.4%
Taylor expanded in y around inf 59.0%
associate-/l*85.8%
associate-/r*95.0%
+-commutative95.0%
Simplified95.0%
if -2e145 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 5e258Initial program 99.4%
if 5e258 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) Initial program 27.2%
*-commutative27.2%
Simplified27.2%
Taylor expanded in z around inf 89.7%
Final simplification98.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ y t)) (+ x 1.0))))
(if (<= t -1.55e-114)
t_1
(if (<= t 5e-202)
(+ 1.0 (* z (/ (/ y x) (- -1.0 x))))
(if (<= t 7.2e-82) (* y (/ z (* (- (* z t) x) (+ x 1.0)))) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double tmp;
if (t <= -1.55e-114) {
tmp = t_1;
} else if (t <= 5e-202) {
tmp = 1.0 + (z * ((y / x) / (-1.0 - x)));
} else if (t <= 7.2e-82) {
tmp = y * (z / (((z * t) - x) * (x + 1.0)));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x + (y / t)) / (x + 1.0d0)
if (t <= (-1.55d-114)) then
tmp = t_1
else if (t <= 5d-202) then
tmp = 1.0d0 + (z * ((y / x) / ((-1.0d0) - x)))
else if (t <= 7.2d-82) then
tmp = y * (z / (((z * t) - x) * (x + 1.0d0)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double tmp;
if (t <= -1.55e-114) {
tmp = t_1;
} else if (t <= 5e-202) {
tmp = 1.0 + (z * ((y / x) / (-1.0 - x)));
} else if (t <= 7.2e-82) {
tmp = y * (z / (((z * t) - x) * (x + 1.0)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x + (y / t)) / (x + 1.0) tmp = 0 if t <= -1.55e-114: tmp = t_1 elif t <= 5e-202: tmp = 1.0 + (z * ((y / x) / (-1.0 - x))) elif t <= 7.2e-82: tmp = y * (z / (((z * t) - x) * (x + 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)) tmp = 0.0 if (t <= -1.55e-114) tmp = t_1; elseif (t <= 5e-202) tmp = Float64(1.0 + Float64(z * Float64(Float64(y / x) / Float64(-1.0 - x)))); elseif (t <= 7.2e-82) tmp = Float64(y * Float64(z / Float64(Float64(Float64(z * t) - x) * Float64(x + 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); tmp = 0.0; if (t <= -1.55e-114) tmp = t_1; elseif (t <= 5e-202) tmp = 1.0 + (z * ((y / x) / (-1.0 - x))); elseif (t <= 7.2e-82) tmp = y * (z / (((z * t) - x) * (x + 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]}, If[LessEqual[t, -1.55e-114], t$95$1, If[LessEqual[t, 5e-202], N[(1.0 + N[(z * N[(N[(y / x), $MachinePrecision] / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.2e-82], N[(y * N[(z / N[(N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision] * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{if}\;t \leq -1.55 \cdot 10^{-114}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 5 \cdot 10^{-202}:\\
\;\;\;\;1 + z \cdot \frac{\frac{y}{x}}{-1 - x}\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{-82}:\\
\;\;\;\;y \cdot \frac{z}{\left(z \cdot t - x\right) \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.55e-114 or 7.19999999999999996e-82 < t Initial program 86.4%
*-commutative86.4%
Simplified86.4%
Taylor expanded in z around inf 88.2%
if -1.55e-114 < t < 4.99999999999999973e-202Initial program 92.4%
*-commutative92.4%
Simplified92.4%
Taylor expanded in z around 0 84.2%
Taylor expanded in y around inf 84.2%
associate-/r*85.8%
+-commutative85.8%
associate-*r/85.8%
associate-*r/85.8%
neg-mul-185.8%
+-commutative85.8%
Simplified85.8%
if 4.99999999999999973e-202 < t < 7.19999999999999996e-82Initial program 90.6%
*-commutative90.6%
Simplified90.6%
Taylor expanded in y around inf 72.5%
associate-/l*76.9%
+-commutative76.9%
Simplified76.9%
Final simplification86.7%
(FPCore (x y z t) :precision binary64 (if (or (<= t -2.55e-111) (not (<= t 4.15e-116))) (/ (+ x (/ y t)) (+ x 1.0)) (/ (+ x (- 1.0 (* y (/ z x)))) (+ x 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.55e-111) || !(t <= 4.15e-116)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = (x + (1.0 - (y * (z / x)))) / (x + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-2.55d-111)) .or. (.not. (t <= 4.15d-116))) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = (x + (1.0d0 - (y * (z / x)))) / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.55e-111) || !(t <= 4.15e-116)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = (x + (1.0 - (y * (z / x)))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -2.55e-111) or not (t <= 4.15e-116): tmp = (x + (y / t)) / (x + 1.0) else: tmp = (x + (1.0 - (y * (z / x)))) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -2.55e-111) || !(t <= 4.15e-116)) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); 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.55e-111) || ~((t <= 4.15e-116))) tmp = (x + (y / t)) / (x + 1.0); else tmp = (x + (1.0 - (y * (z / x)))) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -2.55e-111], N[Not[LessEqual[t, 4.15e-116]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $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.55 \cdot 10^{-111} \lor \neg \left(t \leq 4.15 \cdot 10^{-116}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \left(1 - y \cdot \frac{z}{x}\right)}{x + 1}\\
\end{array}
\end{array}
if t < -2.55000000000000016e-111 or 4.1499999999999998e-116 < t Initial program 86.6%
*-commutative86.6%
Simplified86.6%
Taylor expanded in z around inf 87.5%
if -2.55000000000000016e-111 < t < 4.1499999999999998e-116Initial program 91.6%
*-commutative91.6%
Simplified91.6%
Taylor expanded in t around 0 74.6%
associate-+r+74.6%
+-commutative74.6%
associate-+l+74.6%
mul-1-neg74.6%
unsub-neg74.6%
associate-/l*80.5%
+-commutative80.5%
Simplified80.5%
Final simplification85.3%
(FPCore (x y z t) :precision binary64 (if (or (<= t -2.55e-111) (not (<= t 1.52e-183))) (/ (+ x (/ y t)) (+ x 1.0)) (+ 1.0 (* z (/ (/ y x) (- -1.0 x))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.55e-111) || !(t <= 1.52e-183)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0 + (z * ((y / x) / (-1.0 - x)));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-2.55d-111)) .or. (.not. (t <= 1.52d-183))) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = 1.0d0 + (z * ((y / x) / ((-1.0d0) - x)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.55e-111) || !(t <= 1.52e-183)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0 + (z * ((y / x) / (-1.0 - x)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -2.55e-111) or not (t <= 1.52e-183): tmp = (x + (y / t)) / (x + 1.0) else: tmp = 1.0 + (z * ((y / x) / (-1.0 - x))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -2.55e-111) || !(t <= 1.52e-183)) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = Float64(1.0 + Float64(z * Float64(Float64(y / x) / Float64(-1.0 - x)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -2.55e-111) || ~((t <= 1.52e-183))) tmp = (x + (y / t)) / (x + 1.0); else tmp = 1.0 + (z * ((y / x) / (-1.0 - x))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -2.55e-111], N[Not[LessEqual[t, 1.52e-183]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(z * N[(N[(y / x), $MachinePrecision] / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.55 \cdot 10^{-111} \lor \neg \left(t \leq 1.52 \cdot 10^{-183}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1 + z \cdot \frac{\frac{y}{x}}{-1 - x}\\
\end{array}
\end{array}
if t < -2.55000000000000016e-111 or 1.52000000000000007e-183 < t Initial program 86.7%
*-commutative86.7%
Simplified86.7%
Taylor expanded in z around inf 84.5%
if -2.55000000000000016e-111 < t < 1.52000000000000007e-183Initial program 92.6%
*-commutative92.6%
Simplified92.6%
Taylor expanded in z around 0 84.7%
Taylor expanded in y around inf 84.7%
associate-/r*86.2%
+-commutative86.2%
associate-*r/86.2%
associate-*r/86.2%
neg-mul-186.2%
+-commutative86.2%
Simplified86.2%
Final simplification84.9%
(FPCore (x y z t) :precision binary64 (if (<= x -1.7e+35) 1.0 (if (<= x 1.6e+36) (/ (+ x (/ y t)) (+ x 1.0)) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.7e+35) {
tmp = 1.0;
} else if (x <= 1.6e+36) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= (-1.7d+35)) then
tmp = 1.0d0
else if (x <= 1.6d+36) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.7e+35) {
tmp = 1.0;
} else if (x <= 1.6e+36) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.7e+35: tmp = 1.0 elif x <= 1.6e+36: tmp = (x + (y / t)) / (x + 1.0) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.7e+35) tmp = 1.0; elseif (x <= 1.6e+36) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.7e+35) tmp = 1.0; elseif (x <= 1.6e+36) tmp = (x + (y / t)) / (x + 1.0); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.7e+35], 1.0, If[LessEqual[x, 1.6e+36], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.7 \cdot 10^{+35}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{+36}:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -1.7000000000000001e35 or 1.5999999999999999e36 < x Initial program 88.5%
*-commutative88.5%
Simplified88.5%
Taylor expanded in z around inf 69.1%
Taylor expanded in x around inf 89.0%
if -1.7000000000000001e35 < x < 1.5999999999999999e36Initial program 88.0%
*-commutative88.0%
Simplified88.0%
Taylor expanded in z around inf 73.2%
Final simplification79.5%
(FPCore (x y z t) :precision binary64 (if (<= x -2.5e-114) (/ x (+ x 1.0)) (if (<= x 1.7e+33) (/ y (* t (+ x 1.0))) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.5e-114) {
tmp = x / (x + 1.0);
} else if (x <= 1.7e+33) {
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) :: tmp
if (x <= (-2.5d-114)) then
tmp = x / (x + 1.0d0)
else if (x <= 1.7d+33) 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 tmp;
if (x <= -2.5e-114) {
tmp = x / (x + 1.0);
} else if (x <= 1.7e+33) {
tmp = y / (t * (x + 1.0));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -2.5e-114: tmp = x / (x + 1.0) elif x <= 1.7e+33: tmp = y / (t * (x + 1.0)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -2.5e-114) tmp = Float64(x / Float64(x + 1.0)); elseif (x <= 1.7e+33) 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) tmp = 0.0; if (x <= -2.5e-114) tmp = x / (x + 1.0); elseif (x <= 1.7e+33) tmp = y / (t * (x + 1.0)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -2.5e-114], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.7e+33], N[(y / N[(t * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.5 \cdot 10^{-114}:\\
\;\;\;\;\frac{x}{x + 1}\\
\mathbf{elif}\;x \leq 1.7 \cdot 10^{+33}:\\
\;\;\;\;\frac{y}{t \cdot \left(x + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -2.49999999999999995e-114Initial program 91.1%
*-commutative91.1%
Simplified91.1%
Taylor expanded in t around inf 76.1%
+-commutative76.1%
Simplified76.1%
if -2.49999999999999995e-114 < x < 1.7e33Initial program 86.4%
*-commutative86.4%
Simplified86.4%
Taylor expanded in y around inf 49.8%
associate-/l*57.6%
+-commutative57.6%
Simplified57.6%
Taylor expanded in z around inf 51.8%
if 1.7e33 < x Initial program 87.5%
*-commutative87.5%
Simplified87.5%
Taylor expanded in z around inf 67.5%
Taylor expanded in x around inf 89.6%
Final simplification66.9%
(FPCore (x y z t) :precision binary64 (if (or (<= x -4.4e-113) (not (<= x 3.2e-43))) (/ x (+ x 1.0)) (/ y t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -4.4e-113) || !(x <= 3.2e-43)) {
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 <= (-4.4d-113)) .or. (.not. (x <= 3.2d-43))) 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 <= -4.4e-113) || !(x <= 3.2e-43)) {
tmp = x / (x + 1.0);
} else {
tmp = y / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -4.4e-113) or not (x <= 3.2e-43): tmp = x / (x + 1.0) else: tmp = y / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -4.4e-113) || !(x <= 3.2e-43)) 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 <= -4.4e-113) || ~((x <= 3.2e-43))) tmp = x / (x + 1.0); else tmp = y / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -4.4e-113], N[Not[LessEqual[x, 3.2e-43]], $MachinePrecision]], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(y / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.4 \cdot 10^{-113} \lor \neg \left(x \leq 3.2 \cdot 10^{-43}\right):\\
\;\;\;\;\frac{x}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{t}\\
\end{array}
\end{array}
if x < -4.40000000000000008e-113 or 3.19999999999999985e-43 < x Initial program 88.2%
*-commutative88.2%
Simplified88.2%
Taylor expanded in t around inf 75.9%
+-commutative75.9%
Simplified75.9%
if -4.40000000000000008e-113 < x < 3.19999999999999985e-43Initial program 88.2%
*-commutative88.2%
Simplified88.2%
Taylor expanded in z around inf 74.6%
Taylor expanded in x around 0 54.0%
Final simplification66.8%
(FPCore (x y z t) :precision binary64 (if (<= x -0.2) 1.0 (if (<= x 1.06e-15) (/ y t) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -0.2) {
tmp = 1.0;
} else if (x <= 1.06e-15) {
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 <= (-0.2d0)) then
tmp = 1.0d0
else if (x <= 1.06d-15) 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 <= -0.2) {
tmp = 1.0;
} else if (x <= 1.06e-15) {
tmp = y / t;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -0.2: tmp = 1.0 elif x <= 1.06e-15: tmp = y / t else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -0.2) tmp = 1.0; elseif (x <= 1.06e-15) 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 <= -0.2) tmp = 1.0; elseif (x <= 1.06e-15) tmp = y / t; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -0.2], 1.0, If[LessEqual[x, 1.06e-15], N[(y / t), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.2:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 1.06 \cdot 10^{-15}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -0.20000000000000001 or 1.06000000000000007e-15 < x Initial program 87.1%
*-commutative87.1%
Simplified87.1%
Taylor expanded in z around inf 68.5%
Taylor expanded in x around inf 82.8%
if -0.20000000000000001 < x < 1.06000000000000007e-15Initial program 89.2%
*-commutative89.2%
Simplified89.2%
Taylor expanded in z around inf 74.3%
Taylor expanded in x around 0 49.2%
Final simplification65.1%
(FPCore (x y z t) :precision binary64 (if (<= x -1.0) (+ 1.0 (/ -1.0 x)) (if (<= x 8e-17) (/ y t) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.0) {
tmp = 1.0 + (-1.0 / x);
} else if (x <= 8e-17) {
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 <= (-1.0d0)) then
tmp = 1.0d0 + ((-1.0d0) / x)
else if (x <= 8d-17) 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 <= -1.0) {
tmp = 1.0 + (-1.0 / x);
} else if (x <= 8e-17) {
tmp = y / t;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.0: tmp = 1.0 + (-1.0 / x) elif x <= 8e-17: tmp = y / t else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.0) tmp = Float64(1.0 + Float64(-1.0 / x)); elseif (x <= 8e-17) 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 <= -1.0) tmp = 1.0 + (-1.0 / x); elseif (x <= 8e-17) tmp = y / t; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.0], N[(1.0 + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8e-17], N[(y / t), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1:\\
\;\;\;\;1 + \frac{-1}{x}\\
\mathbf{elif}\;x \leq 8 \cdot 10^{-17}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -1Initial program 88.2%
*-commutative88.2%
Simplified88.2%
Taylor expanded in t around inf 85.8%
+-commutative85.8%
Simplified85.8%
Taylor expanded in x around inf 85.7%
if -1 < x < 8.00000000000000057e-17Initial program 89.2%
*-commutative89.2%
Simplified89.2%
Taylor expanded in z around inf 74.3%
Taylor expanded in x around 0 49.2%
if 8.00000000000000057e-17 < x Initial program 85.9%
*-commutative85.9%
Simplified85.9%
Taylor expanded in z around inf 66.0%
Taylor expanded in x around inf 80.0%
Final simplification65.2%
(FPCore (x y z t) :precision binary64 (if (<= x -0.0027) 1.0 (if (<= x 1.8e-13) x 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -0.0027) {
tmp = 1.0;
} else if (x <= 1.8e-13) {
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 <= (-0.0027d0)) then
tmp = 1.0d0
else if (x <= 1.8d-13) 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 <= -0.0027) {
tmp = 1.0;
} else if (x <= 1.8e-13) {
tmp = x;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -0.0027: tmp = 1.0 elif x <= 1.8e-13: tmp = x else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -0.0027) tmp = 1.0; elseif (x <= 1.8e-13) tmp = x; else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -0.0027) tmp = 1.0; elseif (x <= 1.8e-13) tmp = x; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -0.0027], 1.0, If[LessEqual[x, 1.8e-13], x, 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.0027:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{-13}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -0.0027000000000000001 or 1.7999999999999999e-13 < x Initial program 87.1%
*-commutative87.1%
Simplified87.1%
Taylor expanded in z around inf 68.5%
Taylor expanded in x around inf 82.7%
if -0.0027000000000000001 < x < 1.7999999999999999e-13Initial program 89.2%
*-commutative89.2%
Simplified89.2%
Taylor expanded in t around inf 29.6%
+-commutative29.6%
Simplified29.6%
Taylor expanded in x around 0 28.9%
Final simplification54.4%
(FPCore (x y z t) :precision binary64 1.0)
double code(double x, double y, double z, double t) {
return 1.0;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0
end function
public static double code(double x, double y, double z, double t) {
return 1.0;
}
def code(x, y, z, t): return 1.0
function code(x, y, z, t) return 1.0 end
function tmp = code(x, y, z, t) tmp = 1.0; end
code[x_, y_, z_, t_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 88.2%
*-commutative88.2%
Simplified88.2%
Taylor expanded in z around inf 71.6%
Taylor expanded in x around inf 47.4%
Final simplification47.4%
(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 2024071
(FPCore (x y z t)
:name "Diagrams.Trail:splitAtParam from diagrams-lib-1.3.0.3, A"
:precision binary64
:alt
(/ (+ x (- (/ y (- t (/ x z))) (/ x (- (* t z) x)))) (+ x 1.0))
(/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))