
(FPCore (x y z t a b) :precision binary64 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
def code(x, y, z, t, a, b): return ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
def code(x, y, z, t, a, b): return ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (* z (- b y))))
(t_2 (+ b (- (/ y z) y)))
(t_3 (* x (+ (/ (/ (- t a) t_2) x) (/ (/ y z) t_2))))
(t_4 (* z (- t a)))
(t_5 (/ (+ (* x y) t_4) t_1)))
(if (<= t_5 -1e+303)
t_3
(if (<= t_5 -5e-287)
t_5
(if (<= t_5 0.0)
(+
(/ (- (* x (/ y (- b y))) (* y (/ (- t a) (pow (- b y) 2.0)))) z)
(/ (- t a) (- b y)))
(if (<= t_5 2e+290) (+ (/ (* x y) t_1) (/ t_4 t_1)) t_3))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (z * (b - y));
double t_2 = b + ((y / z) - y);
double t_3 = x * ((((t - a) / t_2) / x) + ((y / z) / t_2));
double t_4 = z * (t - a);
double t_5 = ((x * y) + t_4) / t_1;
double tmp;
if (t_5 <= -1e+303) {
tmp = t_3;
} else if (t_5 <= -5e-287) {
tmp = t_5;
} else if (t_5 <= 0.0) {
tmp = (((x * (y / (b - y))) - (y * ((t - a) / pow((b - y), 2.0)))) / z) + ((t - a) / (b - y));
} else if (t_5 <= 2e+290) {
tmp = ((x * y) / t_1) + (t_4 / t_1);
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_1 = y + (z * (b - y))
t_2 = b + ((y / z) - y)
t_3 = x * ((((t - a) / t_2) / x) + ((y / z) / t_2))
t_4 = z * (t - a)
t_5 = ((x * y) + t_4) / t_1
if (t_5 <= (-1d+303)) then
tmp = t_3
else if (t_5 <= (-5d-287)) then
tmp = t_5
else if (t_5 <= 0.0d0) then
tmp = (((x * (y / (b - y))) - (y * ((t - a) / ((b - y) ** 2.0d0)))) / z) + ((t - a) / (b - y))
else if (t_5 <= 2d+290) then
tmp = ((x * y) / t_1) + (t_4 / t_1)
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (z * (b - y));
double t_2 = b + ((y / z) - y);
double t_3 = x * ((((t - a) / t_2) / x) + ((y / z) / t_2));
double t_4 = z * (t - a);
double t_5 = ((x * y) + t_4) / t_1;
double tmp;
if (t_5 <= -1e+303) {
tmp = t_3;
} else if (t_5 <= -5e-287) {
tmp = t_5;
} else if (t_5 <= 0.0) {
tmp = (((x * (y / (b - y))) - (y * ((t - a) / Math.pow((b - y), 2.0)))) / z) + ((t - a) / (b - y));
} else if (t_5 <= 2e+290) {
tmp = ((x * y) / t_1) + (t_4 / t_1);
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (z * (b - y)) t_2 = b + ((y / z) - y) t_3 = x * ((((t - a) / t_2) / x) + ((y / z) / t_2)) t_4 = z * (t - a) t_5 = ((x * y) + t_4) / t_1 tmp = 0 if t_5 <= -1e+303: tmp = t_3 elif t_5 <= -5e-287: tmp = t_5 elif t_5 <= 0.0: tmp = (((x * (y / (b - y))) - (y * ((t - a) / math.pow((b - y), 2.0)))) / z) + ((t - a) / (b - y)) elif t_5 <= 2e+290: tmp = ((x * y) / t_1) + (t_4 / t_1) else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(z * Float64(b - y))) t_2 = Float64(b + Float64(Float64(y / z) - y)) t_3 = Float64(x * Float64(Float64(Float64(Float64(t - a) / t_2) / x) + Float64(Float64(y / z) / t_2))) t_4 = Float64(z * Float64(t - a)) t_5 = Float64(Float64(Float64(x * y) + t_4) / t_1) tmp = 0.0 if (t_5 <= -1e+303) tmp = t_3; elseif (t_5 <= -5e-287) tmp = t_5; elseif (t_5 <= 0.0) tmp = Float64(Float64(Float64(Float64(x * Float64(y / Float64(b - y))) - Float64(y * Float64(Float64(t - a) / (Float64(b - y) ^ 2.0)))) / z) + Float64(Float64(t - a) / Float64(b - y))); elseif (t_5 <= 2e+290) tmp = Float64(Float64(Float64(x * y) / t_1) + Float64(t_4 / t_1)); else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (z * (b - y)); t_2 = b + ((y / z) - y); t_3 = x * ((((t - a) / t_2) / x) + ((y / z) / t_2)); t_4 = z * (t - a); t_5 = ((x * y) + t_4) / t_1; tmp = 0.0; if (t_5 <= -1e+303) tmp = t_3; elseif (t_5 <= -5e-287) tmp = t_5; elseif (t_5 <= 0.0) tmp = (((x * (y / (b - y))) - (y * ((t - a) / ((b - y) ^ 2.0)))) / z) + ((t - a) / (b - y)); elseif (t_5 <= 2e+290) tmp = ((x * y) / t_1) + (t_4 / t_1); else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b + N[(N[(y / z), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x * N[(N[(N[(N[(t - a), $MachinePrecision] / t$95$2), $MachinePrecision] / x), $MachinePrecision] + N[(N[(y / z), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(x * y), $MachinePrecision] + t$95$4), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$5, -1e+303], t$95$3, If[LessEqual[t$95$5, -5e-287], t$95$5, If[LessEqual[t$95$5, 0.0], N[(N[(N[(N[(x * N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * N[(N[(t - a), $MachinePrecision] / N[Power[N[(b - y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] + N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$5, 2e+290], N[(N[(N[(x * y), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(t$95$4 / t$95$1), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + z \cdot \left(b - y\right)\\
t_2 := b + \left(\frac{y}{z} - y\right)\\
t_3 := x \cdot \left(\frac{\frac{t - a}{t\_2}}{x} + \frac{\frac{y}{z}}{t\_2}\right)\\
t_4 := z \cdot \left(t - a\right)\\
t_5 := \frac{x \cdot y + t\_4}{t\_1}\\
\mathbf{if}\;t\_5 \leq -1 \cdot 10^{+303}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_5 \leq -5 \cdot 10^{-287}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;t\_5 \leq 0:\\
\;\;\;\;\frac{x \cdot \frac{y}{b - y} - y \cdot \frac{t - a}{{\left(b - y\right)}^{2}}}{z} + \frac{t - a}{b - y}\\
\mathbf{elif}\;t\_5 \leq 2 \cdot 10^{+290}:\\
\;\;\;\;\frac{x \cdot y}{t\_1} + \frac{t\_4}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -1e303 or 2.00000000000000012e290 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 12.9%
Taylor expanded in z around inf 12.6%
Taylor expanded in x around -inf 80.1%
mul-1-neg80.1%
*-commutative80.1%
distribute-rgt-neg-in80.1%
Simplified86.3%
if -1e303 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -5.00000000000000025e-287Initial program 99.6%
if -5.00000000000000025e-287 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -0.0Initial program 40.7%
Taylor expanded in z around -inf 99.8%
associate--l+99.8%
mul-1-neg99.8%
distribute-lft-out--99.8%
associate-/l*99.8%
associate-/l*99.8%
div-sub99.8%
Simplified99.8%
if -0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 2.00000000000000012e290Initial program 99.6%
Taylor expanded in x around 0 99.6%
Final simplification95.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (* z (- b y))))
(t_2 (+ b (- (/ y z) y)))
(t_3 (* x (+ (/ (/ (- t a) t_2) x) (/ (/ y z) t_2))))
(t_4 (* z (- t a)))
(t_5 (/ (+ (* x y) t_4) t_1)))
(if (<= t_5 -1e+303)
t_3
(if (<= t_5 -2e-270)
t_5
(if (or (<= t_5 0.0) (not (<= t_5 2e+290)))
t_3
(+ (/ (* x y) t_1) (/ t_4 t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (z * (b - y));
double t_2 = b + ((y / z) - y);
double t_3 = x * ((((t - a) / t_2) / x) + ((y / z) / t_2));
double t_4 = z * (t - a);
double t_5 = ((x * y) + t_4) / t_1;
double tmp;
if (t_5 <= -1e+303) {
tmp = t_3;
} else if (t_5 <= -2e-270) {
tmp = t_5;
} else if ((t_5 <= 0.0) || !(t_5 <= 2e+290)) {
tmp = t_3;
} else {
tmp = ((x * y) / t_1) + (t_4 / t_1);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_1 = y + (z * (b - y))
t_2 = b + ((y / z) - y)
t_3 = x * ((((t - a) / t_2) / x) + ((y / z) / t_2))
t_4 = z * (t - a)
t_5 = ((x * y) + t_4) / t_1
if (t_5 <= (-1d+303)) then
tmp = t_3
else if (t_5 <= (-2d-270)) then
tmp = t_5
else if ((t_5 <= 0.0d0) .or. (.not. (t_5 <= 2d+290))) then
tmp = t_3
else
tmp = ((x * y) / t_1) + (t_4 / t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (z * (b - y));
double t_2 = b + ((y / z) - y);
double t_3 = x * ((((t - a) / t_2) / x) + ((y / z) / t_2));
double t_4 = z * (t - a);
double t_5 = ((x * y) + t_4) / t_1;
double tmp;
if (t_5 <= -1e+303) {
tmp = t_3;
} else if (t_5 <= -2e-270) {
tmp = t_5;
} else if ((t_5 <= 0.0) || !(t_5 <= 2e+290)) {
tmp = t_3;
} else {
tmp = ((x * y) / t_1) + (t_4 / t_1);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (z * (b - y)) t_2 = b + ((y / z) - y) t_3 = x * ((((t - a) / t_2) / x) + ((y / z) / t_2)) t_4 = z * (t - a) t_5 = ((x * y) + t_4) / t_1 tmp = 0 if t_5 <= -1e+303: tmp = t_3 elif t_5 <= -2e-270: tmp = t_5 elif (t_5 <= 0.0) or not (t_5 <= 2e+290): tmp = t_3 else: tmp = ((x * y) / t_1) + (t_4 / t_1) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(z * Float64(b - y))) t_2 = Float64(b + Float64(Float64(y / z) - y)) t_3 = Float64(x * Float64(Float64(Float64(Float64(t - a) / t_2) / x) + Float64(Float64(y / z) / t_2))) t_4 = Float64(z * Float64(t - a)) t_5 = Float64(Float64(Float64(x * y) + t_4) / t_1) tmp = 0.0 if (t_5 <= -1e+303) tmp = t_3; elseif (t_5 <= -2e-270) tmp = t_5; elseif ((t_5 <= 0.0) || !(t_5 <= 2e+290)) tmp = t_3; else tmp = Float64(Float64(Float64(x * y) / t_1) + Float64(t_4 / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (z * (b - y)); t_2 = b + ((y / z) - y); t_3 = x * ((((t - a) / t_2) / x) + ((y / z) / t_2)); t_4 = z * (t - a); t_5 = ((x * y) + t_4) / t_1; tmp = 0.0; if (t_5 <= -1e+303) tmp = t_3; elseif (t_5 <= -2e-270) tmp = t_5; elseif ((t_5 <= 0.0) || ~((t_5 <= 2e+290))) tmp = t_3; else tmp = ((x * y) / t_1) + (t_4 / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b + N[(N[(y / z), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x * N[(N[(N[(N[(t - a), $MachinePrecision] / t$95$2), $MachinePrecision] / x), $MachinePrecision] + N[(N[(y / z), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(x * y), $MachinePrecision] + t$95$4), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$5, -1e+303], t$95$3, If[LessEqual[t$95$5, -2e-270], t$95$5, If[Or[LessEqual[t$95$5, 0.0], N[Not[LessEqual[t$95$5, 2e+290]], $MachinePrecision]], t$95$3, N[(N[(N[(x * y), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(t$95$4 / t$95$1), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + z \cdot \left(b - y\right)\\
t_2 := b + \left(\frac{y}{z} - y\right)\\
t_3 := x \cdot \left(\frac{\frac{t - a}{t\_2}}{x} + \frac{\frac{y}{z}}{t\_2}\right)\\
t_4 := z \cdot \left(t - a\right)\\
t_5 := \frac{x \cdot y + t\_4}{t\_1}\\
\mathbf{if}\;t\_5 \leq -1 \cdot 10^{+303}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_5 \leq -2 \cdot 10^{-270}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;t\_5 \leq 0 \lor \neg \left(t\_5 \leq 2 \cdot 10^{+290}\right):\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{t\_1} + \frac{t\_4}{t\_1}\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -1e303 or -2.0000000000000001e-270 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -0.0 or 2.00000000000000012e290 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 19.7%
Taylor expanded in z around inf 19.4%
Taylor expanded in x around -inf 81.0%
mul-1-neg81.0%
*-commutative81.0%
distribute-rgt-neg-in81.0%
Simplified87.1%
if -1e303 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -2.0000000000000001e-270Initial program 99.6%
if -0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 2.00000000000000012e290Initial program 99.6%
Taylor expanded in x around 0 99.6%
Final simplification94.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (/ y (* z (+ b (- (/ y z) y))))))
(t_2 (+ (* x y) (* z (- t a))))
(t_3 (/ (- t a) (- b y))))
(if (<= z -1.2e+107)
t_3
(if (<= z -1.35e+94)
(/ t_2 (* z (- b y)))
(if (<= z -130.0)
t_3
(if (<= z -3e-77)
t_1
(if (<= z 4.8e-228)
(/ t_2 y)
(if (<= z 9.2e-37)
(/ t_2 (* z b))
(if (<= z 980.0) t_1 t_3)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * (y / (z * (b + ((y / z) - y))));
double t_2 = (x * y) + (z * (t - a));
double t_3 = (t - a) / (b - y);
double tmp;
if (z <= -1.2e+107) {
tmp = t_3;
} else if (z <= -1.35e+94) {
tmp = t_2 / (z * (b - y));
} else if (z <= -130.0) {
tmp = t_3;
} else if (z <= -3e-77) {
tmp = t_1;
} else if (z <= 4.8e-228) {
tmp = t_2 / y;
} else if (z <= 9.2e-37) {
tmp = t_2 / (z * b);
} else if (z <= 980.0) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = x * (y / (z * (b + ((y / z) - y))))
t_2 = (x * y) + (z * (t - a))
t_3 = (t - a) / (b - y)
if (z <= (-1.2d+107)) then
tmp = t_3
else if (z <= (-1.35d+94)) then
tmp = t_2 / (z * (b - y))
else if (z <= (-130.0d0)) then
tmp = t_3
else if (z <= (-3d-77)) then
tmp = t_1
else if (z <= 4.8d-228) then
tmp = t_2 / y
else if (z <= 9.2d-37) then
tmp = t_2 / (z * b)
else if (z <= 980.0d0) then
tmp = t_1
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * (y / (z * (b + ((y / z) - y))));
double t_2 = (x * y) + (z * (t - a));
double t_3 = (t - a) / (b - y);
double tmp;
if (z <= -1.2e+107) {
tmp = t_3;
} else if (z <= -1.35e+94) {
tmp = t_2 / (z * (b - y));
} else if (z <= -130.0) {
tmp = t_3;
} else if (z <= -3e-77) {
tmp = t_1;
} else if (z <= 4.8e-228) {
tmp = t_2 / y;
} else if (z <= 9.2e-37) {
tmp = t_2 / (z * b);
} else if (z <= 980.0) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * (y / (z * (b + ((y / z) - y)))) t_2 = (x * y) + (z * (t - a)) t_3 = (t - a) / (b - y) tmp = 0 if z <= -1.2e+107: tmp = t_3 elif z <= -1.35e+94: tmp = t_2 / (z * (b - y)) elif z <= -130.0: tmp = t_3 elif z <= -3e-77: tmp = t_1 elif z <= 4.8e-228: tmp = t_2 / y elif z <= 9.2e-37: tmp = t_2 / (z * b) elif z <= 980.0: tmp = t_1 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * Float64(y / Float64(z * Float64(b + Float64(Float64(y / z) - y))))) t_2 = Float64(Float64(x * y) + Float64(z * Float64(t - a))) t_3 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -1.2e+107) tmp = t_3; elseif (z <= -1.35e+94) tmp = Float64(t_2 / Float64(z * Float64(b - y))); elseif (z <= -130.0) tmp = t_3; elseif (z <= -3e-77) tmp = t_1; elseif (z <= 4.8e-228) tmp = Float64(t_2 / y); elseif (z <= 9.2e-37) tmp = Float64(t_2 / Float64(z * b)); elseif (z <= 980.0) tmp = t_1; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * (y / (z * (b + ((y / z) - y)))); t_2 = (x * y) + (z * (t - a)); t_3 = (t - a) / (b - y); tmp = 0.0; if (z <= -1.2e+107) tmp = t_3; elseif (z <= -1.35e+94) tmp = t_2 / (z * (b - y)); elseif (z <= -130.0) tmp = t_3; elseif (z <= -3e-77) tmp = t_1; elseif (z <= 4.8e-228) tmp = t_2 / y; elseif (z <= 9.2e-37) tmp = t_2 / (z * b); elseif (z <= 980.0) tmp = t_1; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[(y / N[(z * N[(b + N[(N[(y / z), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.2e+107], t$95$3, If[LessEqual[z, -1.35e+94], N[(t$95$2 / N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -130.0], t$95$3, If[LessEqual[z, -3e-77], t$95$1, If[LessEqual[z, 4.8e-228], N[(t$95$2 / y), $MachinePrecision], If[LessEqual[z, 9.2e-37], N[(t$95$2 / N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 980.0], t$95$1, t$95$3]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{y}{z \cdot \left(b + \left(\frac{y}{z} - y\right)\right)}\\
t_2 := x \cdot y + z \cdot \left(t - a\right)\\
t_3 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -1.2 \cdot 10^{+107}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;z \leq -1.35 \cdot 10^{+94}:\\
\;\;\;\;\frac{t\_2}{z \cdot \left(b - y\right)}\\
\mathbf{elif}\;z \leq -130:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;z \leq -3 \cdot 10^{-77}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{-228}:\\
\;\;\;\;\frac{t\_2}{y}\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{-37}:\\
\;\;\;\;\frac{t\_2}{z \cdot b}\\
\mathbf{elif}\;z \leq 980:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if z < -1.2e107 or -1.3500000000000001e94 < z < -130 or 980 < z Initial program 45.9%
Taylor expanded in z around inf 85.2%
if -1.2e107 < z < -1.3500000000000001e94Initial program 99.3%
Taylor expanded in z around inf 99.3%
if -130 < z < -3.00000000000000016e-77 or 9.1999999999999999e-37 < z < 980Initial program 73.0%
Taylor expanded in z around inf 70.0%
Taylor expanded in x around inf 50.9%
associate-/l*77.5%
associate-+r-77.5%
Simplified77.5%
if -3.00000000000000016e-77 < z < 4.80000000000000004e-228Initial program 94.5%
Taylor expanded in z around 0 67.9%
if 4.80000000000000004e-228 < z < 9.1999999999999999e-37Initial program 88.6%
Taylor expanded in y around 0 60.7%
*-commutative60.7%
Simplified60.7%
Final simplification76.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (/ y (* z (+ b (- (/ y z) y))))))
(t_2 (/ (- t a) (- b y)))
(t_3 (+ (* x y) (* z (- t a)))))
(if (<= z -40.0)
t_2
(if (<= z -3.2e-77)
t_1
(if (<= z 5.8e-228)
(/ t_3 y)
(if (<= z 1.4e-33) (/ t_3 (* z b)) (if (<= z 1200.0) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * (y / (z * (b + ((y / z) - y))));
double t_2 = (t - a) / (b - y);
double t_3 = (x * y) + (z * (t - a));
double tmp;
if (z <= -40.0) {
tmp = t_2;
} else if (z <= -3.2e-77) {
tmp = t_1;
} else if (z <= 5.8e-228) {
tmp = t_3 / y;
} else if (z <= 1.4e-33) {
tmp = t_3 / (z * b);
} else if (z <= 1200.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = x * (y / (z * (b + ((y / z) - y))))
t_2 = (t - a) / (b - y)
t_3 = (x * y) + (z * (t - a))
if (z <= (-40.0d0)) then
tmp = t_2
else if (z <= (-3.2d-77)) then
tmp = t_1
else if (z <= 5.8d-228) then
tmp = t_3 / y
else if (z <= 1.4d-33) then
tmp = t_3 / (z * b)
else if (z <= 1200.0d0) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * (y / (z * (b + ((y / z) - y))));
double t_2 = (t - a) / (b - y);
double t_3 = (x * y) + (z * (t - a));
double tmp;
if (z <= -40.0) {
tmp = t_2;
} else if (z <= -3.2e-77) {
tmp = t_1;
} else if (z <= 5.8e-228) {
tmp = t_3 / y;
} else if (z <= 1.4e-33) {
tmp = t_3 / (z * b);
} else if (z <= 1200.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * (y / (z * (b + ((y / z) - y)))) t_2 = (t - a) / (b - y) t_3 = (x * y) + (z * (t - a)) tmp = 0 if z <= -40.0: tmp = t_2 elif z <= -3.2e-77: tmp = t_1 elif z <= 5.8e-228: tmp = t_3 / y elif z <= 1.4e-33: tmp = t_3 / (z * b) elif z <= 1200.0: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * Float64(y / Float64(z * Float64(b + Float64(Float64(y / z) - y))))) t_2 = Float64(Float64(t - a) / Float64(b - y)) t_3 = Float64(Float64(x * y) + Float64(z * Float64(t - a))) tmp = 0.0 if (z <= -40.0) tmp = t_2; elseif (z <= -3.2e-77) tmp = t_1; elseif (z <= 5.8e-228) tmp = Float64(t_3 / y); elseif (z <= 1.4e-33) tmp = Float64(t_3 / Float64(z * b)); elseif (z <= 1200.0) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * (y / (z * (b + ((y / z) - y)))); t_2 = (t - a) / (b - y); t_3 = (x * y) + (z * (t - a)); tmp = 0.0; if (z <= -40.0) tmp = t_2; elseif (z <= -3.2e-77) tmp = t_1; elseif (z <= 5.8e-228) tmp = t_3 / y; elseif (z <= 1.4e-33) tmp = t_3 / (z * b); elseif (z <= 1200.0) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[(y / N[(z * N[(b + N[(N[(y / z), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -40.0], t$95$2, If[LessEqual[z, -3.2e-77], t$95$1, If[LessEqual[z, 5.8e-228], N[(t$95$3 / y), $MachinePrecision], If[LessEqual[z, 1.4e-33], N[(t$95$3 / N[(z * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1200.0], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{y}{z \cdot \left(b + \left(\frac{y}{z} - y\right)\right)}\\
t_2 := \frac{t - a}{b - y}\\
t_3 := x \cdot y + z \cdot \left(t - a\right)\\
\mathbf{if}\;z \leq -40:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -3.2 \cdot 10^{-77}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5.8 \cdot 10^{-228}:\\
\;\;\;\;\frac{t\_3}{y}\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-33}:\\
\;\;\;\;\frac{t\_3}{z \cdot b}\\
\mathbf{elif}\;z \leq 1200:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -40 or 1200 < z Initial program 48.8%
Taylor expanded in z around inf 82.3%
if -40 < z < -3.2e-77 or 1.4e-33 < z < 1200Initial program 73.0%
Taylor expanded in z around inf 70.0%
Taylor expanded in x around inf 50.9%
associate-/l*77.5%
associate-+r-77.5%
Simplified77.5%
if -3.2e-77 < z < 5.8000000000000002e-228Initial program 94.5%
Taylor expanded in z around 0 67.9%
if 5.8000000000000002e-228 < z < 1.4e-33Initial program 88.6%
Taylor expanded in y around 0 60.7%
*-commutative60.7%
Simplified60.7%
Final simplification75.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (* z (- b y)))))
(if (or (<= z -1.2e+107) (not (<= z 2.15e+136)))
(/ (- t a) (- b y))
(* x (+ (/ y t_1) (/ (* z (- t a)) (* x t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (z * (b - y));
double tmp;
if ((z <= -1.2e+107) || !(z <= 2.15e+136)) {
tmp = (t - a) / (b - y);
} else {
tmp = x * ((y / t_1) + ((z * (t - a)) / (x * t_1)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = y + (z * (b - y))
if ((z <= (-1.2d+107)) .or. (.not. (z <= 2.15d+136))) then
tmp = (t - a) / (b - y)
else
tmp = x * ((y / t_1) + ((z * (t - a)) / (x * t_1)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (z * (b - y));
double tmp;
if ((z <= -1.2e+107) || !(z <= 2.15e+136)) {
tmp = (t - a) / (b - y);
} else {
tmp = x * ((y / t_1) + ((z * (t - a)) / (x * t_1)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (z * (b - y)) tmp = 0 if (z <= -1.2e+107) or not (z <= 2.15e+136): tmp = (t - a) / (b - y) else: tmp = x * ((y / t_1) + ((z * (t - a)) / (x * t_1))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(z * Float64(b - y))) tmp = 0.0 if ((z <= -1.2e+107) || !(z <= 2.15e+136)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(x * Float64(Float64(y / t_1) + Float64(Float64(z * Float64(t - a)) / Float64(x * t_1)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (z * (b - y)); tmp = 0.0; if ((z <= -1.2e+107) || ~((z <= 2.15e+136))) tmp = (t - a) / (b - y); else tmp = x * ((y / t_1) + ((z * (t - a)) / (x * t_1))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[z, -1.2e+107], N[Not[LessEqual[z, 2.15e+136]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y / t$95$1), $MachinePrecision] + N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] / N[(x * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + z \cdot \left(b - y\right)\\
\mathbf{if}\;z \leq -1.2 \cdot 10^{+107} \lor \neg \left(z \leq 2.15 \cdot 10^{+136}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{t\_1} + \frac{z \cdot \left(t - a\right)}{x \cdot t\_1}\right)\\
\end{array}
\end{array}
if z < -1.2e107 or 2.1499999999999999e136 < z Initial program 34.0%
Taylor expanded in z around inf 91.6%
if -1.2e107 < z < 2.1499999999999999e136Initial program 84.0%
Taylor expanded in x around inf 85.9%
Final simplification87.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (/ y (* z (+ b (- (/ y z) y)))))) (t_2 (/ (- t a) (- b y))))
(if (<= z -1.85)
t_2
(if (<= z -1.06e-77)
t_1
(if (<= z 4.8e-173)
(/ (+ (* x y) (* z (- t a))) y)
(if (<= z 1250.0) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * (y / (z * (b + ((y / z) - y))));
double t_2 = (t - a) / (b - y);
double tmp;
if (z <= -1.85) {
tmp = t_2;
} else if (z <= -1.06e-77) {
tmp = t_1;
} else if (z <= 4.8e-173) {
tmp = ((x * y) + (z * (t - a))) / y;
} else if (z <= 1250.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * (y / (z * (b + ((y / z) - y))))
t_2 = (t - a) / (b - y)
if (z <= (-1.85d0)) then
tmp = t_2
else if (z <= (-1.06d-77)) then
tmp = t_1
else if (z <= 4.8d-173) then
tmp = ((x * y) + (z * (t - a))) / y
else if (z <= 1250.0d0) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * (y / (z * (b + ((y / z) - y))));
double t_2 = (t - a) / (b - y);
double tmp;
if (z <= -1.85) {
tmp = t_2;
} else if (z <= -1.06e-77) {
tmp = t_1;
} else if (z <= 4.8e-173) {
tmp = ((x * y) + (z * (t - a))) / y;
} else if (z <= 1250.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * (y / (z * (b + ((y / z) - y)))) t_2 = (t - a) / (b - y) tmp = 0 if z <= -1.85: tmp = t_2 elif z <= -1.06e-77: tmp = t_1 elif z <= 4.8e-173: tmp = ((x * y) + (z * (t - a))) / y elif z <= 1250.0: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * Float64(y / Float64(z * Float64(b + Float64(Float64(y / z) - y))))) t_2 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -1.85) tmp = t_2; elseif (z <= -1.06e-77) tmp = t_1; elseif (z <= 4.8e-173) tmp = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / y); elseif (z <= 1250.0) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * (y / (z * (b + ((y / z) - y)))); t_2 = (t - a) / (b - y); tmp = 0.0; if (z <= -1.85) tmp = t_2; elseif (z <= -1.06e-77) tmp = t_1; elseif (z <= 4.8e-173) tmp = ((x * y) + (z * (t - a))) / y; elseif (z <= 1250.0) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[(y / N[(z * N[(b + N[(N[(y / z), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.85], t$95$2, If[LessEqual[z, -1.06e-77], t$95$1, If[LessEqual[z, 4.8e-173], N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 1250.0], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{y}{z \cdot \left(b + \left(\frac{y}{z} - y\right)\right)}\\
t_2 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -1.85:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.06 \cdot 10^{-77}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{-173}:\\
\;\;\;\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y}\\
\mathbf{elif}\;z \leq 1250:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -1.8500000000000001 or 1250 < z Initial program 48.8%
Taylor expanded in z around inf 82.3%
if -1.8500000000000001 < z < -1.05999999999999991e-77 or 4.80000000000000034e-173 < z < 1250Initial program 80.7%
Taylor expanded in z around inf 76.2%
Taylor expanded in x around inf 44.5%
associate-/l*59.2%
associate-+r-59.2%
Simplified59.2%
if -1.05999999999999991e-77 < z < 4.80000000000000034e-173Initial program 93.9%
Taylor expanded in z around 0 62.5%
Final simplification71.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.3e+107) (not (<= z 2.15e+136))) (/ (- t a) (- b y)) (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.3e+107) || !(z <= 2.15e+136)) {
tmp = (t - a) / (b - y);
} else {
tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-1.3d+107)) .or. (.not. (z <= 2.15d+136))) then
tmp = (t - a) / (b - y)
else
tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.3e+107) || !(z <= 2.15e+136)) {
tmp = (t - a) / (b - y);
} else {
tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.3e+107) or not (z <= 2.15e+136): tmp = (t - a) / (b - y) else: tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.3e+107) || !(z <= 2.15e+136)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.3e+107) || ~((z <= 2.15e+136))) tmp = (t - a) / (b - y); else tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.3e+107], N[Not[LessEqual[z, 2.15e+136]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{+107} \lor \neg \left(z \leq 2.15 \cdot 10^{+136}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
\end{array}
\end{array}
if z < -1.3000000000000001e107 or 2.1499999999999999e136 < z Initial program 34.0%
Taylor expanded in z around inf 91.6%
if -1.3000000000000001e107 < z < 2.1499999999999999e136Initial program 84.0%
Final simplification86.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) b)) (t_2 (/ x (- 1.0 z))))
(if (<= y -3e-16)
t_2
(if (<= y 1.85e-91)
t_1
(if (<= y 7200.0) (/ t (- b y)) (if (<= y 4e+56) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / b;
double t_2 = x / (1.0 - z);
double tmp;
if (y <= -3e-16) {
tmp = t_2;
} else if (y <= 1.85e-91) {
tmp = t_1;
} else if (y <= 7200.0) {
tmp = t / (b - y);
} else if (y <= 4e+56) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (t - a) / b
t_2 = x / (1.0d0 - z)
if (y <= (-3d-16)) then
tmp = t_2
else if (y <= 1.85d-91) then
tmp = t_1
else if (y <= 7200.0d0) then
tmp = t / (b - y)
else if (y <= 4d+56) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / b;
double t_2 = x / (1.0 - z);
double tmp;
if (y <= -3e-16) {
tmp = t_2;
} else if (y <= 1.85e-91) {
tmp = t_1;
} else if (y <= 7200.0) {
tmp = t / (b - y);
} else if (y <= 4e+56) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / b t_2 = x / (1.0 - z) tmp = 0 if y <= -3e-16: tmp = t_2 elif y <= 1.85e-91: tmp = t_1 elif y <= 7200.0: tmp = t / (b - y) elif y <= 4e+56: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / b) t_2 = Float64(x / Float64(1.0 - z)) tmp = 0.0 if (y <= -3e-16) tmp = t_2; elseif (y <= 1.85e-91) tmp = t_1; elseif (y <= 7200.0) tmp = Float64(t / Float64(b - y)); elseif (y <= 4e+56) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - a) / b; t_2 = x / (1.0 - z); tmp = 0.0; if (y <= -3e-16) tmp = t_2; elseif (y <= 1.85e-91) tmp = t_1; elseif (y <= 7200.0) tmp = t / (b - y); elseif (y <= 4e+56) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3e-16], t$95$2, If[LessEqual[y, 1.85e-91], t$95$1, If[LessEqual[y, 7200.0], N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4e+56], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b}\\
t_2 := \frac{x}{1 - z}\\
\mathbf{if}\;y \leq -3 \cdot 10^{-16}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 1.85 \cdot 10^{-91}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 7200:\\
\;\;\;\;\frac{t}{b - y}\\
\mathbf{elif}\;y \leq 4 \cdot 10^{+56}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -2.99999999999999994e-16 or 4.00000000000000037e56 < y Initial program 54.5%
Taylor expanded in y around inf 49.9%
mul-1-neg49.9%
unsub-neg49.9%
Simplified49.9%
if -2.99999999999999994e-16 < y < 1.8500000000000001e-91 or 7200 < y < 4.00000000000000037e56Initial program 81.6%
Taylor expanded in y around 0 61.1%
if 1.8500000000000001e-91 < y < 7200Initial program 66.4%
Taylor expanded in t around inf 46.8%
*-commutative46.8%
Simplified46.8%
Taylor expanded in z around inf 52.3%
Final simplification55.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (- 1.0 z))))
(if (<= y -1.3e-16)
t_1
(if (<= y 1.95e-91)
(/ (- t a) b)
(if (<= y 1000000.0)
(/ t (- b y))
(if (<= y 6.5e+66) (/ a (- y b)) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (1.0 - z);
double tmp;
if (y <= -1.3e-16) {
tmp = t_1;
} else if (y <= 1.95e-91) {
tmp = (t - a) / b;
} else if (y <= 1000000.0) {
tmp = t / (b - y);
} else if (y <= 6.5e+66) {
tmp = a / (y - b);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x / (1.0d0 - z)
if (y <= (-1.3d-16)) then
tmp = t_1
else if (y <= 1.95d-91) then
tmp = (t - a) / b
else if (y <= 1000000.0d0) then
tmp = t / (b - y)
else if (y <= 6.5d+66) then
tmp = a / (y - b)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (1.0 - z);
double tmp;
if (y <= -1.3e-16) {
tmp = t_1;
} else if (y <= 1.95e-91) {
tmp = (t - a) / b;
} else if (y <= 1000000.0) {
tmp = t / (b - y);
} else if (y <= 6.5e+66) {
tmp = a / (y - b);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (1.0 - z) tmp = 0 if y <= -1.3e-16: tmp = t_1 elif y <= 1.95e-91: tmp = (t - a) / b elif y <= 1000000.0: tmp = t / (b - y) elif y <= 6.5e+66: tmp = a / (y - b) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(1.0 - z)) tmp = 0.0 if (y <= -1.3e-16) tmp = t_1; elseif (y <= 1.95e-91) tmp = Float64(Float64(t - a) / b); elseif (y <= 1000000.0) tmp = Float64(t / Float64(b - y)); elseif (y <= 6.5e+66) tmp = Float64(a / Float64(y - b)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x / (1.0 - z); tmp = 0.0; if (y <= -1.3e-16) tmp = t_1; elseif (y <= 1.95e-91) tmp = (t - a) / b; elseif (y <= 1000000.0) tmp = t / (b - y); elseif (y <= 6.5e+66) tmp = a / (y - b); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.3e-16], t$95$1, If[LessEqual[y, 1.95e-91], N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[y, 1000000.0], N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.5e+66], N[(a / N[(y - b), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{1 - z}\\
\mathbf{if}\;y \leq -1.3 \cdot 10^{-16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.95 \cdot 10^{-91}:\\
\;\;\;\;\frac{t - a}{b}\\
\mathbf{elif}\;y \leq 1000000:\\
\;\;\;\;\frac{t}{b - y}\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{+66}:\\
\;\;\;\;\frac{a}{y - b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.2999999999999999e-16 or 6.5000000000000001e66 < y Initial program 55.1%
Taylor expanded in y around inf 51.2%
mul-1-neg51.2%
unsub-neg51.2%
Simplified51.2%
if -1.2999999999999999e-16 < y < 1.94999999999999997e-91Initial program 85.4%
Taylor expanded in y around 0 64.6%
if 1.94999999999999997e-91 < y < 1e6Initial program 66.4%
Taylor expanded in t around inf 46.8%
*-commutative46.8%
Simplified46.8%
Taylor expanded in z around inf 52.3%
if 1e6 < y < 6.5000000000000001e66Initial program 51.4%
Taylor expanded in x around inf 50.9%
Taylor expanded in z around inf 36.1%
associate-/l*35.7%
div-sub36.0%
Simplified36.0%
Taylor expanded in t around 0 41.7%
mul-1-neg41.7%
Simplified41.7%
Final simplification56.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -0.92) (not (<= z 1700.0))) (/ (- t a) (- b y)) (/ (* x y) (+ y (* z (- b y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -0.92) || !(z <= 1700.0)) {
tmp = (t - a) / (b - y);
} else {
tmp = (x * y) / (y + (z * (b - y)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-0.92d0)) .or. (.not. (z <= 1700.0d0))) then
tmp = (t - a) / (b - y)
else
tmp = (x * y) / (y + (z * (b - y)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -0.92) || !(z <= 1700.0)) {
tmp = (t - a) / (b - y);
} else {
tmp = (x * y) / (y + (z * (b - y)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -0.92) or not (z <= 1700.0): tmp = (t - a) / (b - y) else: tmp = (x * y) / (y + (z * (b - y))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -0.92) || !(z <= 1700.0)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(Float64(x * y) / Float64(y + Float64(z * Float64(b - y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -0.92) || ~((z <= 1700.0))) tmp = (t - a) / (b - y); else tmp = (x * y) / (y + (z * (b - y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -0.92], N[Not[LessEqual[z, 1700.0]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.92 \lor \neg \left(z \leq 1700\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{y + z \cdot \left(b - y\right)}\\
\end{array}
\end{array}
if z < -0.92000000000000004 or 1700 < z Initial program 48.8%
Taylor expanded in z around inf 82.3%
if -0.92000000000000004 < z < 1700Initial program 87.3%
Taylor expanded in x around inf 52.3%
*-commutative52.3%
Simplified52.3%
Final simplification67.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (- 1.0 z))))
(if (<= y -2.4e-18)
t_1
(if (<= y 8.2e-18)
(/ (- t a) b)
(if (<= y 2.7e+102) (/ (- a t) y) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (1.0 - z);
double tmp;
if (y <= -2.4e-18) {
tmp = t_1;
} else if (y <= 8.2e-18) {
tmp = (t - a) / b;
} else if (y <= 2.7e+102) {
tmp = (a - t) / y;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x / (1.0d0 - z)
if (y <= (-2.4d-18)) then
tmp = t_1
else if (y <= 8.2d-18) then
tmp = (t - a) / b
else if (y <= 2.7d+102) then
tmp = (a - t) / y
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (1.0 - z);
double tmp;
if (y <= -2.4e-18) {
tmp = t_1;
} else if (y <= 8.2e-18) {
tmp = (t - a) / b;
} else if (y <= 2.7e+102) {
tmp = (a - t) / y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (1.0 - z) tmp = 0 if y <= -2.4e-18: tmp = t_1 elif y <= 8.2e-18: tmp = (t - a) / b elif y <= 2.7e+102: tmp = (a - t) / y else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(1.0 - z)) tmp = 0.0 if (y <= -2.4e-18) tmp = t_1; elseif (y <= 8.2e-18) tmp = Float64(Float64(t - a) / b); elseif (y <= 2.7e+102) tmp = Float64(Float64(a - t) / y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x / (1.0 - z); tmp = 0.0; if (y <= -2.4e-18) tmp = t_1; elseif (y <= 8.2e-18) tmp = (t - a) / b; elseif (y <= 2.7e+102) tmp = (a - t) / y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.4e-18], t$95$1, If[LessEqual[y, 8.2e-18], N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[y, 2.7e+102], N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{1 - z}\\
\mathbf{if}\;y \leq -2.4 \cdot 10^{-18}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 8.2 \cdot 10^{-18}:\\
\;\;\;\;\frac{t - a}{b}\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{+102}:\\
\;\;\;\;\frac{a - t}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.39999999999999994e-18 or 2.7000000000000001e102 < y Initial program 53.6%
Taylor expanded in y around inf 53.9%
mul-1-neg53.9%
unsub-neg53.9%
Simplified53.9%
if -2.39999999999999994e-18 < y < 8.1999999999999995e-18Initial program 85.1%
Taylor expanded in y around 0 61.5%
if 8.1999999999999995e-18 < y < 2.7000000000000001e102Initial program 54.6%
Taylor expanded in x around inf 48.8%
Taylor expanded in z around inf 46.8%
associate-/l*46.6%
div-sub46.7%
Simplified46.7%
Taylor expanded in b around 0 40.0%
associate-*r/40.0%
mul-1-neg40.0%
Simplified40.0%
Final simplification55.5%
(FPCore (x y z t a b) :precision binary64 (if (<= z -1.18e+148) (/ (- a) b) (if (or (<= z -2.15e-6) (not (<= z 580.0))) (/ t b) x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.18e+148) {
tmp = -a / b;
} else if ((z <= -2.15e-6) || !(z <= 580.0)) {
tmp = t / b;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-1.18d+148)) then
tmp = -a / b
else if ((z <= (-2.15d-6)) .or. (.not. (z <= 580.0d0))) then
tmp = t / b
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.18e+148) {
tmp = -a / b;
} else if ((z <= -2.15e-6) || !(z <= 580.0)) {
tmp = t / b;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.18e+148: tmp = -a / b elif (z <= -2.15e-6) or not (z <= 580.0): tmp = t / b else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.18e+148) tmp = Float64(Float64(-a) / b); elseif ((z <= -2.15e-6) || !(z <= 580.0)) tmp = Float64(t / b); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -1.18e+148) tmp = -a / b; elseif ((z <= -2.15e-6) || ~((z <= 580.0))) tmp = t / b; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.18e+148], N[((-a) / b), $MachinePrecision], If[Or[LessEqual[z, -2.15e-6], N[Not[LessEqual[z, 580.0]], $MachinePrecision]], N[(t / b), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.18 \cdot 10^{+148}:\\
\;\;\;\;\frac{-a}{b}\\
\mathbf{elif}\;z \leq -2.15 \cdot 10^{-6} \lor \neg \left(z \leq 580\right):\\
\;\;\;\;\frac{t}{b}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.18e148Initial program 22.9%
Taylor expanded in y around 0 13.6%
*-commutative13.6%
Simplified13.6%
Taylor expanded in a around inf 29.9%
mul-1-neg29.9%
distribute-neg-frac229.9%
Simplified29.9%
if -1.18e148 < z < -2.15000000000000017e-6 or 580 < z Initial program 57.8%
Taylor expanded in t around inf 28.7%
*-commutative28.7%
Simplified28.7%
Taylor expanded in y around 0 30.6%
if -2.15000000000000017e-6 < z < 580Initial program 87.9%
Taylor expanded in z around 0 43.3%
Final simplification36.9%
(FPCore (x y z t a b) :precision binary64 (if (<= z -8e+150) (/ (- a) b) (if (<= z -2700000000.0) (/ t (- y)) (if (<= z 580.0) x (/ t b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -8e+150) {
tmp = -a / b;
} else if (z <= -2700000000.0) {
tmp = t / -y;
} else if (z <= 580.0) {
tmp = x;
} else {
tmp = t / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-8d+150)) then
tmp = -a / b
else if (z <= (-2700000000.0d0)) then
tmp = t / -y
else if (z <= 580.0d0) then
tmp = x
else
tmp = t / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -8e+150) {
tmp = -a / b;
} else if (z <= -2700000000.0) {
tmp = t / -y;
} else if (z <= 580.0) {
tmp = x;
} else {
tmp = t / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -8e+150: tmp = -a / b elif z <= -2700000000.0: tmp = t / -y elif z <= 580.0: tmp = x else: tmp = t / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -8e+150) tmp = Float64(Float64(-a) / b); elseif (z <= -2700000000.0) tmp = Float64(t / Float64(-y)); elseif (z <= 580.0) tmp = x; else tmp = Float64(t / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -8e+150) tmp = -a / b; elseif (z <= -2700000000.0) tmp = t / -y; elseif (z <= 580.0) tmp = x; else tmp = t / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -8e+150], N[((-a) / b), $MachinePrecision], If[LessEqual[z, -2700000000.0], N[(t / (-y)), $MachinePrecision], If[LessEqual[z, 580.0], x, N[(t / b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{+150}:\\
\;\;\;\;\frac{-a}{b}\\
\mathbf{elif}\;z \leq -2700000000:\\
\;\;\;\;\frac{t}{-y}\\
\mathbf{elif}\;z \leq 580:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b}\\
\end{array}
\end{array}
if z < -7.99999999999999985e150Initial program 21.2%
Taylor expanded in y around 0 14.4%
*-commutative14.4%
Simplified14.4%
Taylor expanded in a around inf 31.5%
mul-1-neg31.5%
distribute-neg-frac231.5%
Simplified31.5%
if -7.99999999999999985e150 < z < -2.7e9Initial program 69.5%
Taylor expanded in t around inf 30.5%
*-commutative30.5%
Simplified30.5%
Taylor expanded in z around inf 29.9%
Taylor expanded in b around 0 32.0%
associate-*r/32.0%
mul-1-neg32.0%
Simplified32.0%
if -2.7e9 < z < 580Initial program 87.5%
Taylor expanded in z around 0 42.3%
if 580 < z Initial program 49.9%
Taylor expanded in t around inf 28.0%
*-commutative28.0%
Simplified28.0%
Taylor expanded in y around 0 32.3%
Final simplification37.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -15200.0) (not (<= y 2.05e+104))) (/ x (- 1.0 z)) (/ (- t a) (- b y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -15200.0) || !(y <= 2.05e+104)) {
tmp = x / (1.0 - z);
} else {
tmp = (t - a) / (b - y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-15200.0d0)) .or. (.not. (y <= 2.05d+104))) then
tmp = x / (1.0d0 - z)
else
tmp = (t - a) / (b - y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -15200.0) || !(y <= 2.05e+104)) {
tmp = x / (1.0 - z);
} else {
tmp = (t - a) / (b - y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -15200.0) or not (y <= 2.05e+104): tmp = x / (1.0 - z) else: tmp = (t - a) / (b - y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -15200.0) || !(y <= 2.05e+104)) tmp = Float64(x / Float64(1.0 - z)); else tmp = Float64(Float64(t - a) / Float64(b - y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -15200.0) || ~((y <= 2.05e+104))) tmp = x / (1.0 - z); else tmp = (t - a) / (b - y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -15200.0], N[Not[LessEqual[y, 2.05e+104]], $MachinePrecision]], N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -15200 \lor \neg \left(y \leq 2.05 \cdot 10^{+104}\right):\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b - y}\\
\end{array}
\end{array}
if y < -15200 or 2.04999999999999992e104 < y Initial program 52.7%
Taylor expanded in y around inf 55.1%
mul-1-neg55.1%
unsub-neg55.1%
Simplified55.1%
if -15200 < y < 2.04999999999999992e104Initial program 77.6%
Taylor expanded in z around inf 67.9%
Final simplification63.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -6.8e-14) (not (<= z 0.29))) (/ t (- b y)) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -6.8e-14) || !(z <= 0.29)) {
tmp = t / (b - y);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-6.8d-14)) .or. (.not. (z <= 0.29d0))) then
tmp = t / (b - y)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -6.8e-14) || !(z <= 0.29)) {
tmp = t / (b - y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -6.8e-14) or not (z <= 0.29): tmp = t / (b - y) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -6.8e-14) || !(z <= 0.29)) tmp = Float64(t / Float64(b - y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -6.8e-14) || ~((z <= 0.29))) tmp = t / (b - y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -6.8e-14], N[Not[LessEqual[z, 0.29]], $MachinePrecision]], N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.8 \cdot 10^{-14} \lor \neg \left(z \leq 0.29\right):\\
\;\;\;\;\frac{t}{b - y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -6.80000000000000006e-14 or 0.28999999999999998 < z Initial program 48.2%
Taylor expanded in t around inf 23.9%
*-commutative23.9%
Simplified23.9%
Taylor expanded in z around inf 44.5%
if -6.80000000000000006e-14 < z < 0.28999999999999998Initial program 88.5%
Taylor expanded in z around 0 43.6%
Final simplification44.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -6e-8) (not (<= z 650.0))) (/ t (- b y)) (/ x (- 1.0 z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -6e-8) || !(z <= 650.0)) {
tmp = t / (b - y);
} else {
tmp = x / (1.0 - z);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-6d-8)) .or. (.not. (z <= 650.0d0))) then
tmp = t / (b - y)
else
tmp = x / (1.0d0 - z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -6e-8) || !(z <= 650.0)) {
tmp = t / (b - y);
} else {
tmp = x / (1.0 - z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -6e-8) or not (z <= 650.0): tmp = t / (b - y) else: tmp = x / (1.0 - z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -6e-8) || !(z <= 650.0)) tmp = Float64(t / Float64(b - y)); else tmp = Float64(x / Float64(1.0 - z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -6e-8) || ~((z <= 650.0))) tmp = t / (b - y); else tmp = x / (1.0 - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -6e-8], N[Not[LessEqual[z, 650.0]], $MachinePrecision]], N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{-8} \lor \neg \left(z \leq 650\right):\\
\;\;\;\;\frac{t}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{1 - z}\\
\end{array}
\end{array}
if z < -5.99999999999999946e-8 or 650 < z Initial program 48.5%
Taylor expanded in t around inf 24.1%
*-commutative24.1%
Simplified24.1%
Taylor expanded in z around inf 44.8%
if -5.99999999999999946e-8 < z < 650Initial program 87.9%
Taylor expanded in y around inf 45.4%
mul-1-neg45.4%
unsub-neg45.4%
Simplified45.4%
Final simplification45.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -3.1e-14) (not (<= z 580.0))) (/ t b) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -3.1e-14) || !(z <= 580.0)) {
tmp = t / b;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-3.1d-14)) .or. (.not. (z <= 580.0d0))) then
tmp = t / b
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -3.1e-14) || !(z <= 580.0)) {
tmp = t / b;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -3.1e-14) or not (z <= 580.0): tmp = t / b else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -3.1e-14) || !(z <= 580.0)) tmp = Float64(t / b); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -3.1e-14) || ~((z <= 580.0))) tmp = t / b; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -3.1e-14], N[Not[LessEqual[z, 580.0]], $MachinePrecision]], N[(t / b), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{-14} \lor \neg \left(z \leq 580\right):\\
\;\;\;\;\frac{t}{b}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.10000000000000004e-14 or 580 < z Initial program 48.5%
Taylor expanded in t around inf 24.1%
*-commutative24.1%
Simplified24.1%
Taylor expanded in y around 0 26.6%
if -3.10000000000000004e-14 < z < 580Initial program 87.9%
Taylor expanded in z around 0 43.3%
Final simplification35.0%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 68.4%
Taylor expanded in z around 0 23.4%
Final simplification23.4%
(FPCore (x y z t a b) :precision binary64 (- (/ (+ (* z t) (* y x)) (+ y (* z (- b y)))) (/ a (+ (- b y) (/ y z)))))
double code(double x, double y, double z, double t, double a, double b) {
return (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)));
}
def code(x, y, z, t, a, b): return (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(z * t) + Float64(y * x)) / Float64(y + Float64(z * Float64(b - y)))) - Float64(a / Float64(Float64(b - y) + Float64(y / z)))) end
function tmp = code(x, y, z, t, a, b) tmp = (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(z * t), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a / N[(N[(b - y), $MachinePrecision] + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{z \cdot t + y \cdot x}{y + z \cdot \left(b - y\right)} - \frac{a}{\left(b - y\right) + \frac{y}{z}}
\end{array}
herbie shell --seed 2024095
(FPCore (x y z t a b)
:name "Development.Shake.Progress:decay from shake-0.15.5"
:precision binary64
:alt
(- (/ (+ (* z t) (* y x)) (+ y (* z (- b y)))) (/ a (+ (- b y) (/ y z))))
(/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))