
(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 17 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
(+
(/ (- (* x (/ y (- b y))) (* y (/ (- t a) (pow (- b y) 2.0)))) z)
(/ (- t a) (- b y))))
(t_3 (* z (- t a)))
(t_4 (/ (+ (* x y) t_3) t_1))
(t_5 (* x (+ (/ y t_1) (/ t_3 (* x t_1))))))
(if (<= t_4 (- INFINITY))
t_5
(if (<= t_4 -4e-275)
t_4
(if (<= t_4 0.0)
t_2
(if (<= t_4 4e+294)
(/ (fma x y t_3) t_1)
(if (<= t_4 INFINITY) t_5 t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (z * (b - y));
double t_2 = (((x * (y / (b - y))) - (y * ((t - a) / pow((b - y), 2.0)))) / z) + ((t - a) / (b - y));
double t_3 = z * (t - a);
double t_4 = ((x * y) + t_3) / t_1;
double t_5 = x * ((y / t_1) + (t_3 / (x * t_1)));
double tmp;
if (t_4 <= -((double) INFINITY)) {
tmp = t_5;
} else if (t_4 <= -4e-275) {
tmp = t_4;
} else if (t_4 <= 0.0) {
tmp = t_2;
} else if (t_4 <= 4e+294) {
tmp = fma(x, y, t_3) / t_1;
} else if (t_4 <= ((double) INFINITY)) {
tmp = t_5;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(z * Float64(b - y))) t_2 = 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))) t_3 = Float64(z * Float64(t - a)) t_4 = Float64(Float64(Float64(x * y) + t_3) / t_1) t_5 = Float64(x * Float64(Float64(y / t_1) + Float64(t_3 / Float64(x * t_1)))) tmp = 0.0 if (t_4 <= Float64(-Inf)) tmp = t_5; elseif (t_4 <= -4e-275) tmp = t_4; elseif (t_4 <= 0.0) tmp = t_2; elseif (t_4 <= 4e+294) tmp = Float64(fma(x, y, t_3) / t_1); elseif (t_4 <= Inf) tmp = t_5; else tmp = t_2; end return 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[(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]}, Block[{t$95$3 = N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(x * y), $MachinePrecision] + t$95$3), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$5 = N[(x * N[(N[(y / t$95$1), $MachinePrecision] + N[(t$95$3 / N[(x * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, (-Infinity)], t$95$5, If[LessEqual[t$95$4, -4e-275], t$95$4, If[LessEqual[t$95$4, 0.0], t$95$2, If[LessEqual[t$95$4, 4e+294], N[(N[(x * y + t$95$3), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t$95$4, Infinity], t$95$5, t$95$2]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + z \cdot \left(b - y\right)\\
t_2 := \frac{x \cdot \frac{y}{b - y} - y \cdot \frac{t - a}{{\left(b - y\right)}^{2}}}{z} + \frac{t - a}{b - y}\\
t_3 := z \cdot \left(t - a\right)\\
t_4 := \frac{x \cdot y + t\_3}{t\_1}\\
t_5 := x \cdot \left(\frac{y}{t\_1} + \frac{t\_3}{x \cdot t\_1}\right)\\
\mathbf{if}\;t\_4 \leq -\infty:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;t\_4 \leq -4 \cdot 10^{-275}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_4 \leq 0:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_4 \leq 4 \cdot 10^{+294}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, t\_3\right)}{t\_1}\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;t\_5\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -inf.0 or 4.00000000000000027e294 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 24.4%
Taylor expanded in x around inf 70.7%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -3.99999999999999974e-275Initial program 99.5%
if -3.99999999999999974e-275 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 0.0 or +inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 10.3%
Taylor expanded in z around -inf 56.1%
associate--l+56.1%
mul-1-neg56.1%
distribute-lft-out--56.1%
associate-/l*65.6%
associate-/l*98.4%
div-sub98.4%
Simplified98.4%
if 0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 4.00000000000000027e294Initial program 99.6%
fma-define99.6%
Simplified99.6%
Final simplification93.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (* z (- b y))))
(t_2
(-
(+ (/ (- t a) (- b y)) (* (/ y z) (/ x (- b y))))
(* (/ (- t a) (pow (- b y) 2.0)) (/ y z))))
(t_3 (* z (- t a)))
(t_4 (/ (+ (* x y) t_3) t_1))
(t_5 (* x (+ (/ y t_1) (/ t_3 (* x t_1))))))
(if (<= t_4 (- INFINITY))
t_5
(if (<= t_4 -4e-275)
t_4
(if (<= t_4 0.0)
t_2
(if (<= t_4 4e+294)
(/ (fma x y t_3) t_1)
(if (<= t_4 INFINITY) t_5 t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (z * (b - y));
double t_2 = (((t - a) / (b - y)) + ((y / z) * (x / (b - y)))) - (((t - a) / pow((b - y), 2.0)) * (y / z));
double t_3 = z * (t - a);
double t_4 = ((x * y) + t_3) / t_1;
double t_5 = x * ((y / t_1) + (t_3 / (x * t_1)));
double tmp;
if (t_4 <= -((double) INFINITY)) {
tmp = t_5;
} else if (t_4 <= -4e-275) {
tmp = t_4;
} else if (t_4 <= 0.0) {
tmp = t_2;
} else if (t_4 <= 4e+294) {
tmp = fma(x, y, t_3) / t_1;
} else if (t_4 <= ((double) INFINITY)) {
tmp = t_5;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(z * Float64(b - y))) t_2 = Float64(Float64(Float64(Float64(t - a) / Float64(b - y)) + Float64(Float64(y / z) * Float64(x / Float64(b - y)))) - Float64(Float64(Float64(t - a) / (Float64(b - y) ^ 2.0)) * Float64(y / z))) t_3 = Float64(z * Float64(t - a)) t_4 = Float64(Float64(Float64(x * y) + t_3) / t_1) t_5 = Float64(x * Float64(Float64(y / t_1) + Float64(t_3 / Float64(x * t_1)))) tmp = 0.0 if (t_4 <= Float64(-Inf)) tmp = t_5; elseif (t_4 <= -4e-275) tmp = t_4; elseif (t_4 <= 0.0) tmp = t_2; elseif (t_4 <= 4e+294) tmp = Float64(fma(x, y, t_3) / t_1); elseif (t_4 <= Inf) tmp = t_5; else tmp = t_2; end return 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[(N[(N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision] + N[(N[(y / z), $MachinePrecision] * N[(x / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(t - a), $MachinePrecision] / N[Power[N[(b - y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(x * y), $MachinePrecision] + t$95$3), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$5 = N[(x * N[(N[(y / t$95$1), $MachinePrecision] + N[(t$95$3 / N[(x * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, (-Infinity)], t$95$5, If[LessEqual[t$95$4, -4e-275], t$95$4, If[LessEqual[t$95$4, 0.0], t$95$2, If[LessEqual[t$95$4, 4e+294], N[(N[(x * y + t$95$3), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t$95$4, Infinity], t$95$5, t$95$2]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + z \cdot \left(b - y\right)\\
t_2 := \left(\frac{t - a}{b - y} + \frac{y}{z} \cdot \frac{x}{b - y}\right) - \frac{t - a}{{\left(b - y\right)}^{2}} \cdot \frac{y}{z}\\
t_3 := z \cdot \left(t - a\right)\\
t_4 := \frac{x \cdot y + t\_3}{t\_1}\\
t_5 := x \cdot \left(\frac{y}{t\_1} + \frac{t\_3}{x \cdot t\_1}\right)\\
\mathbf{if}\;t\_4 \leq -\infty:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;t\_4 \leq -4 \cdot 10^{-275}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_4 \leq 0:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_4 \leq 4 \cdot 10^{+294}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, t\_3\right)}{t\_1}\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;t\_5\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -inf.0 or 4.00000000000000027e294 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 24.4%
Taylor expanded in x around inf 70.7%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -3.99999999999999974e-275Initial program 99.5%
if -3.99999999999999974e-275 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 0.0 or +inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 10.3%
Taylor expanded in z around inf 49.7%
associate--r+49.7%
+-commutative49.7%
associate--l+49.7%
*-commutative49.7%
times-frac63.0%
div-sub63.0%
times-frac95.7%
Simplified95.7%
if 0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 4.00000000000000027e294Initial program 99.6%
fma-define99.6%
Simplified99.6%
Final simplification92.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (* z (- b y))))
(t_2 (* z (- t a)))
(t_3 (/ (+ (* x y) t_2) t_1)))
(if (<= t_3 (- INFINITY))
(* x (+ (/ t_2 (* x t_1)) 1.0))
(if (or (<= t_3 -2e-278) (and (not (<= t_3 0.0)) (<= t_3 1e+308)))
t_3
(/ (- t a) (- b y))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (z * (b - y));
double t_2 = z * (t - a);
double t_3 = ((x * y) + t_2) / t_1;
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = x * ((t_2 / (x * t_1)) + 1.0);
} else if ((t_3 <= -2e-278) || (!(t_3 <= 0.0) && (t_3 <= 1e+308))) {
tmp = t_3;
} else {
tmp = (t - a) / (b - y);
}
return tmp;
}
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 = z * (t - a);
double t_3 = ((x * y) + t_2) / t_1;
double tmp;
if (t_3 <= -Double.POSITIVE_INFINITY) {
tmp = x * ((t_2 / (x * t_1)) + 1.0);
} else if ((t_3 <= -2e-278) || (!(t_3 <= 0.0) && (t_3 <= 1e+308))) {
tmp = t_3;
} else {
tmp = (t - a) / (b - y);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (z * (b - y)) t_2 = z * (t - a) t_3 = ((x * y) + t_2) / t_1 tmp = 0 if t_3 <= -math.inf: tmp = x * ((t_2 / (x * t_1)) + 1.0) elif (t_3 <= -2e-278) or (not (t_3 <= 0.0) and (t_3 <= 1e+308)): tmp = t_3 else: tmp = (t - a) / (b - y) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(z * Float64(b - y))) t_2 = Float64(z * Float64(t - a)) t_3 = Float64(Float64(Float64(x * y) + t_2) / t_1) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = Float64(x * Float64(Float64(t_2 / Float64(x * t_1)) + 1.0)); elseif ((t_3 <= -2e-278) || (!(t_3 <= 0.0) && (t_3 <= 1e+308))) tmp = t_3; else tmp = Float64(Float64(t - a) / Float64(b - y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (z * (b - y)); t_2 = z * (t - a); t_3 = ((x * y) + t_2) / t_1; tmp = 0.0; if (t_3 <= -Inf) tmp = x * ((t_2 / (x * t_1)) + 1.0); elseif ((t_3 <= -2e-278) || (~((t_3 <= 0.0)) && (t_3 <= 1e+308))) tmp = t_3; else tmp = (t - a) / (b - y); 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[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(x * y), $MachinePrecision] + t$95$2), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(x * N[(N[(t$95$2 / N[(x * t$95$1), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t$95$3, -2e-278], And[N[Not[LessEqual[t$95$3, 0.0]], $MachinePrecision], LessEqual[t$95$3, 1e+308]]], t$95$3, N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + z \cdot \left(b - y\right)\\
t_2 := z \cdot \left(t - a\right)\\
t_3 := \frac{x \cdot y + t\_2}{t\_1}\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;x \cdot \left(\frac{t\_2}{x \cdot t\_1} + 1\right)\\
\mathbf{elif}\;t\_3 \leq -2 \cdot 10^{-278} \lor \neg \left(t\_3 \leq 0\right) \land t\_3 \leq 10^{+308}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b - y}\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -inf.0Initial program 24.1%
Taylor expanded in x around inf 68.4%
Taylor expanded in z around 0 63.7%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -1.99999999999999988e-278 or 0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 1e308Initial program 99.6%
if -1.99999999999999988e-278 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 0.0 or 1e308 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 11.4%
Taylor expanded in z around inf 67.1%
Final simplification85.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y)))
(t_2 (+ y (* z (- b y))))
(t_3 (/ (* z (- t a)) (* x t_2))))
(if (<= z -9e+98)
t_1
(if (<= z -4.4e+61)
(* x (+ t_3 (/ (/ y z) (- b y))))
(if (or (<= z -1.6e+15) (not (<= z 4e+47)))
t_1
(* x (+ (/ y t_2) t_3)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double t_2 = y + (z * (b - y));
double t_3 = (z * (t - a)) / (x * t_2);
double tmp;
if (z <= -9e+98) {
tmp = t_1;
} else if (z <= -4.4e+61) {
tmp = x * (t_3 + ((y / z) / (b - y)));
} else if ((z <= -1.6e+15) || !(z <= 4e+47)) {
tmp = t_1;
} else {
tmp = x * ((y / t_2) + 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 = (t - a) / (b - y)
t_2 = y + (z * (b - y))
t_3 = (z * (t - a)) / (x * t_2)
if (z <= (-9d+98)) then
tmp = t_1
else if (z <= (-4.4d+61)) then
tmp = x * (t_3 + ((y / z) / (b - y)))
else if ((z <= (-1.6d+15)) .or. (.not. (z <= 4d+47))) then
tmp = t_1
else
tmp = x * ((y / t_2) + 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 = (t - a) / (b - y);
double t_2 = y + (z * (b - y));
double t_3 = (z * (t - a)) / (x * t_2);
double tmp;
if (z <= -9e+98) {
tmp = t_1;
} else if (z <= -4.4e+61) {
tmp = x * (t_3 + ((y / z) / (b - y)));
} else if ((z <= -1.6e+15) || !(z <= 4e+47)) {
tmp = t_1;
} else {
tmp = x * ((y / t_2) + t_3);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / (b - y) t_2 = y + (z * (b - y)) t_3 = (z * (t - a)) / (x * t_2) tmp = 0 if z <= -9e+98: tmp = t_1 elif z <= -4.4e+61: tmp = x * (t_3 + ((y / z) / (b - y))) elif (z <= -1.6e+15) or not (z <= 4e+47): tmp = t_1 else: tmp = x * ((y / t_2) + t_3) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) t_2 = Float64(y + Float64(z * Float64(b - y))) t_3 = Float64(Float64(z * Float64(t - a)) / Float64(x * t_2)) tmp = 0.0 if (z <= -9e+98) tmp = t_1; elseif (z <= -4.4e+61) tmp = Float64(x * Float64(t_3 + Float64(Float64(y / z) / Float64(b - y)))); elseif ((z <= -1.6e+15) || !(z <= 4e+47)) tmp = t_1; else tmp = Float64(x * Float64(Float64(y / t_2) + t_3)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - a) / (b - y); t_2 = y + (z * (b - y)); t_3 = (z * (t - a)) / (x * t_2); tmp = 0.0; if (z <= -9e+98) tmp = t_1; elseif (z <= -4.4e+61) tmp = x * (t_3 + ((y / z) / (b - y))); elseif ((z <= -1.6e+15) || ~((z <= 4e+47))) tmp = t_1; else tmp = x * ((y / t_2) + t_3); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] / N[(x * t$95$2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9e+98], t$95$1, If[LessEqual[z, -4.4e+61], N[(x * N[(t$95$3 + N[(N[(y / z), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -1.6e+15], N[Not[LessEqual[z, 4e+47]], $MachinePrecision]], t$95$1, N[(x * N[(N[(y / t$95$2), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
t_2 := y + z \cdot \left(b - y\right)\\
t_3 := \frac{z \cdot \left(t - a\right)}{x \cdot t\_2}\\
\mathbf{if}\;z \leq -9 \cdot 10^{+98}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -4.4 \cdot 10^{+61}:\\
\;\;\;\;x \cdot \left(t\_3 + \frac{\frac{y}{z}}{b - y}\right)\\
\mathbf{elif}\;z \leq -1.6 \cdot 10^{+15} \lor \neg \left(z \leq 4 \cdot 10^{+47}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{t\_2} + t\_3\right)\\
\end{array}
\end{array}
if z < -9.0000000000000004e98 or -4.4000000000000001e61 < z < -1.6e15 or 4.0000000000000002e47 < z Initial program 38.1%
Taylor expanded in z around inf 86.5%
if -9.0000000000000004e98 < z < -4.4000000000000001e61Initial program 42.7%
Taylor expanded in x around inf 43.6%
Taylor expanded in z around inf 43.6%
associate-/r*83.5%
Simplified83.5%
if -1.6e15 < z < 4.0000000000000002e47Initial program 83.6%
Taylor expanded in x around inf 87.5%
Final simplification86.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* x y) (* z t)))
(t_2 (+ y (* z b)))
(t_3 (/ t_1 t_2))
(t_4 (/ (- t a) (- b y)))
(t_5 (/ (- (* x y) (* z a)) t_2)))
(if (<= z -0.47)
t_4
(if (<= z -2.2e-188)
t_3
(if (<= z 1.3e-306)
t_5
(if (<= z 2e-82)
t_3
(if (<= z 1.52e-5)
t_5
(if (<= z 2.9e+44) (/ t_1 (+ y (* z (- b y)))) t_4))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * y) + (z * t);
double t_2 = y + (z * b);
double t_3 = t_1 / t_2;
double t_4 = (t - a) / (b - y);
double t_5 = ((x * y) - (z * a)) / t_2;
double tmp;
if (z <= -0.47) {
tmp = t_4;
} else if (z <= -2.2e-188) {
tmp = t_3;
} else if (z <= 1.3e-306) {
tmp = t_5;
} else if (z <= 2e-82) {
tmp = t_3;
} else if (z <= 1.52e-5) {
tmp = t_5;
} else if (z <= 2.9e+44) {
tmp = t_1 / (y + (z * (b - y)));
} else {
tmp = t_4;
}
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 = (x * y) + (z * t)
t_2 = y + (z * b)
t_3 = t_1 / t_2
t_4 = (t - a) / (b - y)
t_5 = ((x * y) - (z * a)) / t_2
if (z <= (-0.47d0)) then
tmp = t_4
else if (z <= (-2.2d-188)) then
tmp = t_3
else if (z <= 1.3d-306) then
tmp = t_5
else if (z <= 2d-82) then
tmp = t_3
else if (z <= 1.52d-5) then
tmp = t_5
else if (z <= 2.9d+44) then
tmp = t_1 / (y + (z * (b - y)))
else
tmp = t_4
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 * t);
double t_2 = y + (z * b);
double t_3 = t_1 / t_2;
double t_4 = (t - a) / (b - y);
double t_5 = ((x * y) - (z * a)) / t_2;
double tmp;
if (z <= -0.47) {
tmp = t_4;
} else if (z <= -2.2e-188) {
tmp = t_3;
} else if (z <= 1.3e-306) {
tmp = t_5;
} else if (z <= 2e-82) {
tmp = t_3;
} else if (z <= 1.52e-5) {
tmp = t_5;
} else if (z <= 2.9e+44) {
tmp = t_1 / (y + (z * (b - y)));
} else {
tmp = t_4;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x * y) + (z * t) t_2 = y + (z * b) t_3 = t_1 / t_2 t_4 = (t - a) / (b - y) t_5 = ((x * y) - (z * a)) / t_2 tmp = 0 if z <= -0.47: tmp = t_4 elif z <= -2.2e-188: tmp = t_3 elif z <= 1.3e-306: tmp = t_5 elif z <= 2e-82: tmp = t_3 elif z <= 1.52e-5: tmp = t_5 elif z <= 2.9e+44: tmp = t_1 / (y + (z * (b - y))) else: tmp = t_4 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x * y) + Float64(z * t)) t_2 = Float64(y + Float64(z * b)) t_3 = Float64(t_1 / t_2) t_4 = Float64(Float64(t - a) / Float64(b - y)) t_5 = Float64(Float64(Float64(x * y) - Float64(z * a)) / t_2) tmp = 0.0 if (z <= -0.47) tmp = t_4; elseif (z <= -2.2e-188) tmp = t_3; elseif (z <= 1.3e-306) tmp = t_5; elseif (z <= 2e-82) tmp = t_3; elseif (z <= 1.52e-5) tmp = t_5; elseif (z <= 2.9e+44) tmp = Float64(t_1 / Float64(y + Float64(z * Float64(b - y)))); else tmp = t_4; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x * y) + (z * t); t_2 = y + (z * b); t_3 = t_1 / t_2; t_4 = (t - a) / (b - y); t_5 = ((x * y) - (z * a)) / t_2; tmp = 0.0; if (z <= -0.47) tmp = t_4; elseif (z <= -2.2e-188) tmp = t_3; elseif (z <= 1.3e-306) tmp = t_5; elseif (z <= 2e-82) tmp = t_3; elseif (z <= 1.52e-5) tmp = t_5; elseif (z <= 2.9e+44) tmp = t_1 / (y + (z * (b - y))); else tmp = t_4; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(z * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(x * y), $MachinePrecision] - N[(z * a), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[LessEqual[z, -0.47], t$95$4, If[LessEqual[z, -2.2e-188], t$95$3, If[LessEqual[z, 1.3e-306], t$95$5, If[LessEqual[z, 2e-82], t$95$3, If[LessEqual[z, 1.52e-5], t$95$5, If[LessEqual[z, 2.9e+44], N[(t$95$1 / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$4]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
t_2 := y + z \cdot b\\
t_3 := \frac{t\_1}{t\_2}\\
t_4 := \frac{t - a}{b - y}\\
t_5 := \frac{x \cdot y - z \cdot a}{t\_2}\\
\mathbf{if}\;z \leq -0.47:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{-188}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{-306}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;z \leq 2 \cdot 10^{-82}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;z \leq 1.52 \cdot 10^{-5}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{+44}:\\
\;\;\;\;\frac{t\_1}{y + z \cdot \left(b - y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
\end{array}
if z < -0.46999999999999997 or 2.9000000000000002e44 < z Initial program 40.1%
Taylor expanded in z around inf 81.7%
if -0.46999999999999997 < z < -2.2e-188 or 1.3e-306 < z < 2e-82Initial program 84.3%
Taylor expanded in a around 0 70.4%
Taylor expanded in b around inf 70.4%
*-commutative83.9%
Simplified70.4%
if -2.2e-188 < z < 1.3e-306 or 2e-82 < z < 1.52e-5Initial program 76.5%
Taylor expanded in b around inf 74.4%
*-commutative74.4%
Simplified74.4%
Taylor expanded in t around 0 67.5%
+-commutative67.5%
mul-1-neg67.5%
unsub-neg67.5%
*-commutative67.5%
*-commutative67.5%
Simplified67.5%
if 1.52e-5 < z < 2.9000000000000002e44Initial program 99.6%
Taylor expanded in a around 0 90.8%
Final simplification76.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (+ (* x y) (* z t)) (+ y (* z b)))) (t_2 (/ (- t a) (- b y))))
(if (<= z -1.8)
t_2
(if (<= z -3.8e-195)
t_1
(if (<= z 1.7e-306)
(/ (+ (* x y) (* z (- t a))) y)
(if (<= z 3.8e-63)
t_1
(if (<= z 3.3e-18)
x
(if (<= z 41000.0) (/ (* z a) (- (* z (- y b)) y)) t_2))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x * y) + (z * t)) / (y + (z * b));
double t_2 = (t - a) / (b - y);
double tmp;
if (z <= -1.8) {
tmp = t_2;
} else if (z <= -3.8e-195) {
tmp = t_1;
} else if (z <= 1.7e-306) {
tmp = ((x * y) + (z * (t - a))) / y;
} else if (z <= 3.8e-63) {
tmp = t_1;
} else if (z <= 3.3e-18) {
tmp = x;
} else if (z <= 41000.0) {
tmp = (z * a) / ((z * (y - b)) - y);
} 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 * t)) / (y + (z * b))
t_2 = (t - a) / (b - y)
if (z <= (-1.8d0)) then
tmp = t_2
else if (z <= (-3.8d-195)) then
tmp = t_1
else if (z <= 1.7d-306) then
tmp = ((x * y) + (z * (t - a))) / y
else if (z <= 3.8d-63) then
tmp = t_1
else if (z <= 3.3d-18) then
tmp = x
else if (z <= 41000.0d0) then
tmp = (z * a) / ((z * (y - b)) - y)
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 * t)) / (y + (z * b));
double t_2 = (t - a) / (b - y);
double tmp;
if (z <= -1.8) {
tmp = t_2;
} else if (z <= -3.8e-195) {
tmp = t_1;
} else if (z <= 1.7e-306) {
tmp = ((x * y) + (z * (t - a))) / y;
} else if (z <= 3.8e-63) {
tmp = t_1;
} else if (z <= 3.3e-18) {
tmp = x;
} else if (z <= 41000.0) {
tmp = (z * a) / ((z * (y - b)) - y);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((x * y) + (z * t)) / (y + (z * b)) t_2 = (t - a) / (b - y) tmp = 0 if z <= -1.8: tmp = t_2 elif z <= -3.8e-195: tmp = t_1 elif z <= 1.7e-306: tmp = ((x * y) + (z * (t - a))) / y elif z <= 3.8e-63: tmp = t_1 elif z <= 3.3e-18: tmp = x elif z <= 41000.0: tmp = (z * a) / ((z * (y - b)) - y) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(x * y) + Float64(z * t)) / Float64(y + Float64(z * b))) t_2 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -1.8) tmp = t_2; elseif (z <= -3.8e-195) tmp = t_1; elseif (z <= 1.7e-306) tmp = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / y); elseif (z <= 3.8e-63) tmp = t_1; elseif (z <= 3.3e-18) tmp = x; elseif (z <= 41000.0) tmp = Float64(Float64(z * a) / Float64(Float64(z * Float64(y - b)) - y)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((x * y) + (z * t)) / (y + (z * b)); t_2 = (t - a) / (b - y); tmp = 0.0; if (z <= -1.8) tmp = t_2; elseif (z <= -3.8e-195) tmp = t_1; elseif (z <= 1.7e-306) tmp = ((x * y) + (z * (t - a))) / y; elseif (z <= 3.8e-63) tmp = t_1; elseif (z <= 3.3e-18) tmp = x; elseif (z <= 41000.0) tmp = (z * a) / ((z * (y - b)) - y); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.8], t$95$2, If[LessEqual[z, -3.8e-195], t$95$1, If[LessEqual[z, 1.7e-306], N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 3.8e-63], t$95$1, If[LessEqual[z, 3.3e-18], x, If[LessEqual[z, 41000.0], N[(N[(z * a), $MachinePrecision] / N[(N[(z * N[(y - b), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot y + z \cdot t}{y + z \cdot b}\\
t_2 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -1.8:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -3.8 \cdot 10^{-195}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-306}:\\
\;\;\;\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y}\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{-63}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{-18}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 41000:\\
\;\;\;\;\frac{z \cdot a}{z \cdot \left(y - b\right) - y}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -1.80000000000000004 or 41000 < z Initial program 43.8%
Taylor expanded in z around inf 80.2%
if -1.80000000000000004 < z < -3.80000000000000013e-195 or 1.6999999999999999e-306 < z < 3.80000000000000017e-63Initial program 84.0%
Taylor expanded in a around 0 68.5%
Taylor expanded in b around inf 68.5%
*-commutative83.6%
Simplified68.5%
if -3.80000000000000013e-195 < z < 1.6999999999999999e-306Initial program 87.6%
Taylor expanded in b around inf 87.6%
*-commutative87.6%
Simplified87.6%
Taylor expanded in b around 0 83.2%
if 3.80000000000000017e-63 < z < 3.3000000000000002e-18Initial program 49.0%
Taylor expanded in z around 0 56.9%
if 3.3000000000000002e-18 < z < 41000Initial program 99.7%
Taylor expanded in a around inf 43.3%
mul-1-neg43.3%
distribute-lft-neg-out43.3%
*-commutative43.3%
Simplified43.3%
Final simplification74.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (* z b)))
(t_2 (/ (+ (* x y) (* z t)) t_1))
(t_3 (/ (- t a) (- b y)))
(t_4 (/ (- (* x y) (* z a)) t_1)))
(if (<= z -0.7)
t_3
(if (<= z -1.35e-189)
t_2
(if (<= z 1.25e-306)
t_4
(if (<= z 1.4e-72) t_2 (if (<= z 64000.0) t_4 t_3)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (z * b);
double t_2 = ((x * y) + (z * t)) / t_1;
double t_3 = (t - a) / (b - y);
double t_4 = ((x * y) - (z * a)) / t_1;
double tmp;
if (z <= -0.7) {
tmp = t_3;
} else if (z <= -1.35e-189) {
tmp = t_2;
} else if (z <= 1.25e-306) {
tmp = t_4;
} else if (z <= 1.4e-72) {
tmp = t_2;
} else if (z <= 64000.0) {
tmp = t_4;
} 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) :: tmp
t_1 = y + (z * b)
t_2 = ((x * y) + (z * t)) / t_1
t_3 = (t - a) / (b - y)
t_4 = ((x * y) - (z * a)) / t_1
if (z <= (-0.7d0)) then
tmp = t_3
else if (z <= (-1.35d-189)) then
tmp = t_2
else if (z <= 1.25d-306) then
tmp = t_4
else if (z <= 1.4d-72) then
tmp = t_2
else if (z <= 64000.0d0) then
tmp = t_4
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);
double t_2 = ((x * y) + (z * t)) / t_1;
double t_3 = (t - a) / (b - y);
double t_4 = ((x * y) - (z * a)) / t_1;
double tmp;
if (z <= -0.7) {
tmp = t_3;
} else if (z <= -1.35e-189) {
tmp = t_2;
} else if (z <= 1.25e-306) {
tmp = t_4;
} else if (z <= 1.4e-72) {
tmp = t_2;
} else if (z <= 64000.0) {
tmp = t_4;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (z * b) t_2 = ((x * y) + (z * t)) / t_1 t_3 = (t - a) / (b - y) t_4 = ((x * y) - (z * a)) / t_1 tmp = 0 if z <= -0.7: tmp = t_3 elif z <= -1.35e-189: tmp = t_2 elif z <= 1.25e-306: tmp = t_4 elif z <= 1.4e-72: tmp = t_2 elif z <= 64000.0: tmp = t_4 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(z * b)) t_2 = Float64(Float64(Float64(x * y) + Float64(z * t)) / t_1) t_3 = Float64(Float64(t - a) / Float64(b - y)) t_4 = Float64(Float64(Float64(x * y) - Float64(z * a)) / t_1) tmp = 0.0 if (z <= -0.7) tmp = t_3; elseif (z <= -1.35e-189) tmp = t_2; elseif (z <= 1.25e-306) tmp = t_4; elseif (z <= 1.4e-72) tmp = t_2; elseif (z <= 64000.0) tmp = t_4; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (z * b); t_2 = ((x * y) + (z * t)) / t_1; t_3 = (t - a) / (b - y); t_4 = ((x * y) - (z * a)) / t_1; tmp = 0.0; if (z <= -0.7) tmp = t_3; elseif (z <= -1.35e-189) tmp = t_2; elseif (z <= 1.25e-306) tmp = t_4; elseif (z <= 1.4e-72) tmp = t_2; elseif (z <= 64000.0) tmp = t_4; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(z * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(x * y), $MachinePrecision] - N[(z * a), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[z, -0.7], t$95$3, If[LessEqual[z, -1.35e-189], t$95$2, If[LessEqual[z, 1.25e-306], t$95$4, If[LessEqual[z, 1.4e-72], t$95$2, If[LessEqual[z, 64000.0], t$95$4, t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + z \cdot b\\
t_2 := \frac{x \cdot y + z \cdot t}{t\_1}\\
t_3 := \frac{t - a}{b - y}\\
t_4 := \frac{x \cdot y - z \cdot a}{t\_1}\\
\mathbf{if}\;z \leq -0.7:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;z \leq -1.35 \cdot 10^{-189}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-306}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-72}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 64000:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if z < -0.69999999999999996 or 64000 < z Initial program 43.8%
Taylor expanded in z around inf 80.2%
if -0.69999999999999996 < z < -1.35e-189 or 1.25e-306 < z < 1.3999999999999999e-72Initial program 84.3%
Taylor expanded in a around 0 70.4%
Taylor expanded in b around inf 70.4%
*-commutative83.9%
Simplified70.4%
if -1.35e-189 < z < 1.25e-306 or 1.3999999999999999e-72 < z < 64000Initial program 78.1%
Taylor expanded in b around inf 72.5%
*-commutative72.5%
Simplified72.5%
Taylor expanded in t around 0 65.2%
+-commutative65.2%
mul-1-neg65.2%
unsub-neg65.2%
*-commutative65.2%
*-commutative65.2%
Simplified65.2%
Final simplification74.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.4e+15) (not (<= z 5.1e+45))) (/ (- 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.4e+15) || !(z <= 5.1e+45)) {
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.4d+15)) .or. (.not. (z <= 5.1d+45))) 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.4e+15) || !(z <= 5.1e+45)) {
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.4e+15) or not (z <= 5.1e+45): 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.4e+15) || !(z <= 5.1e+45)) 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.4e+15) || ~((z <= 5.1e+45))) 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.4e+15], N[Not[LessEqual[z, 5.1e+45]], $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.4 \cdot 10^{+15} \lor \neg \left(z \leq 5.1 \cdot 10^{+45}\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.4e15 or 5.0999999999999997e45 < z Initial program 38.6%
Taylor expanded in z around inf 82.0%
if -1.4e15 < z < 5.0999999999999997e45Initial program 83.6%
Final simplification82.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ t (- b y))))
(if (<= z -4.6e+92)
t_1
(if (<= z -1.75e+61)
(/ x (- z))
(if (or (<= z -9.5e-153) (not (<= z 6.2e-5))) t_1 x)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t / (b - y);
double tmp;
if (z <= -4.6e+92) {
tmp = t_1;
} else if (z <= -1.75e+61) {
tmp = x / -z;
} else if ((z <= -9.5e-153) || !(z <= 6.2e-5)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = t / (b - y)
if (z <= (-4.6d+92)) then
tmp = t_1
else if (z <= (-1.75d+61)) then
tmp = x / -z
else if ((z <= (-9.5d-153)) .or. (.not. (z <= 6.2d-5))) then
tmp = t_1
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 t_1 = t / (b - y);
double tmp;
if (z <= -4.6e+92) {
tmp = t_1;
} else if (z <= -1.75e+61) {
tmp = x / -z;
} else if ((z <= -9.5e-153) || !(z <= 6.2e-5)) {
tmp = t_1;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t / (b - y) tmp = 0 if z <= -4.6e+92: tmp = t_1 elif z <= -1.75e+61: tmp = x / -z elif (z <= -9.5e-153) or not (z <= 6.2e-5): tmp = t_1 else: tmp = x return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t / Float64(b - y)) tmp = 0.0 if (z <= -4.6e+92) tmp = t_1; elseif (z <= -1.75e+61) tmp = Float64(x / Float64(-z)); elseif ((z <= -9.5e-153) || !(z <= 6.2e-5)) tmp = t_1; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t / (b - y); tmp = 0.0; if (z <= -4.6e+92) tmp = t_1; elseif (z <= -1.75e+61) tmp = x / -z; elseif ((z <= -9.5e-153) || ~((z <= 6.2e-5))) tmp = t_1; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.6e+92], t$95$1, If[LessEqual[z, -1.75e+61], N[(x / (-z)), $MachinePrecision], If[Or[LessEqual[z, -9.5e-153], N[Not[LessEqual[z, 6.2e-5]], $MachinePrecision]], t$95$1, x]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{b - y}\\
\mathbf{if}\;z \leq -4.6 \cdot 10^{+92}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.75 \cdot 10^{+61}:\\
\;\;\;\;\frac{x}{-z}\\
\mathbf{elif}\;z \leq -9.5 \cdot 10^{-153} \lor \neg \left(z \leq 6.2 \cdot 10^{-5}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -4.59999999999999997e92 or -1.75000000000000009e61 < z < -9.50000000000000031e-153 or 6.20000000000000027e-5 < z Initial program 53.7%
Taylor expanded in a around 0 38.8%
Taylor expanded in z around inf 44.5%
if -4.59999999999999997e92 < z < -1.75000000000000009e61Initial program 37.7%
Taylor expanded in x around inf 11.8%
*-commutative11.8%
Simplified11.8%
Taylor expanded in z around inf 11.8%
Taylor expanded in y around inf 65.2%
associate-*r/65.2%
mul-1-neg65.2%
Simplified65.2%
if -9.50000000000000031e-153 < z < 6.20000000000000027e-5Initial program 81.5%
Taylor expanded in z around 0 56.8%
Final simplification49.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ t (- b y))) (t_2 (/ x (- 1.0 z))))
(if (<= y -7.4e+56)
t_2
(if (<= y -4e-245)
t_1
(if (<= y -1.5e-277) (/ a (- b)) (if (<= y 4.4e-10) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t / (b - y);
double t_2 = x / (1.0 - z);
double tmp;
if (y <= -7.4e+56) {
tmp = t_2;
} else if (y <= -4e-245) {
tmp = t_1;
} else if (y <= -1.5e-277) {
tmp = a / -b;
} else if (y <= 4.4e-10) {
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 / (b - y)
t_2 = x / (1.0d0 - z)
if (y <= (-7.4d+56)) then
tmp = t_2
else if (y <= (-4d-245)) then
tmp = t_1
else if (y <= (-1.5d-277)) then
tmp = a / -b
else if (y <= 4.4d-10) 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 / (b - y);
double t_2 = x / (1.0 - z);
double tmp;
if (y <= -7.4e+56) {
tmp = t_2;
} else if (y <= -4e-245) {
tmp = t_1;
} else if (y <= -1.5e-277) {
tmp = a / -b;
} else if (y <= 4.4e-10) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t / (b - y) t_2 = x / (1.0 - z) tmp = 0 if y <= -7.4e+56: tmp = t_2 elif y <= -4e-245: tmp = t_1 elif y <= -1.5e-277: tmp = a / -b elif y <= 4.4e-10: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t / Float64(b - y)) t_2 = Float64(x / Float64(1.0 - z)) tmp = 0.0 if (y <= -7.4e+56) tmp = t_2; elseif (y <= -4e-245) tmp = t_1; elseif (y <= -1.5e-277) tmp = Float64(a / Float64(-b)); elseif (y <= 4.4e-10) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t / (b - y); t_2 = x / (1.0 - z); tmp = 0.0; if (y <= -7.4e+56) tmp = t_2; elseif (y <= -4e-245) tmp = t_1; elseif (y <= -1.5e-277) tmp = a / -b; elseif (y <= 4.4e-10) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7.4e+56], t$95$2, If[LessEqual[y, -4e-245], t$95$1, If[LessEqual[y, -1.5e-277], N[(a / (-b)), $MachinePrecision], If[LessEqual[y, 4.4e-10], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{b - y}\\
t_2 := \frac{x}{1 - z}\\
\mathbf{if}\;y \leq -7.4 \cdot 10^{+56}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -4 \cdot 10^{-245}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1.5 \cdot 10^{-277}:\\
\;\;\;\;\frac{a}{-b}\\
\mathbf{elif}\;y \leq 4.4 \cdot 10^{-10}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -7.39999999999999994e56 or 4.3999999999999998e-10 < y Initial program 49.9%
Taylor expanded in y around inf 56.3%
mul-1-neg56.3%
unsub-neg56.3%
Simplified56.3%
if -7.39999999999999994e56 < y < -3.9999999999999997e-245 or -1.49999999999999989e-277 < y < 4.3999999999999998e-10Initial program 74.4%
Taylor expanded in a around 0 53.2%
Taylor expanded in z around inf 45.8%
if -3.9999999999999997e-245 < y < -1.49999999999999989e-277Initial program 99.2%
Taylor expanded in x around inf 99.2%
Taylor expanded in b around inf 83.1%
Taylor expanded in a around inf 83.4%
neg-mul-183.4%
Simplified83.4%
Final simplification51.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -185.0) (not (<= z 41000.0))) (/ (- t a) (- b y)) (/ (+ (* x y) (* z (- t a))) (+ y (* z b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -185.0) || !(z <= 41000.0)) {
tmp = (t - a) / (b - y);
} else {
tmp = ((x * y) + (z * (t - a))) / (y + (z * 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 <= (-185.0d0)) .or. (.not. (z <= 41000.0d0))) then
tmp = (t - a) / (b - y)
else
tmp = ((x * y) + (z * (t - a))) / (y + (z * 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 <= -185.0) || !(z <= 41000.0)) {
tmp = (t - a) / (b - y);
} else {
tmp = ((x * y) + (z * (t - a))) / (y + (z * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -185.0) or not (z <= 41000.0): tmp = (t - a) / (b - y) else: tmp = ((x * y) + (z * (t - a))) / (y + (z * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -185.0) || !(z <= 41000.0)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -185.0) || ~((z <= 41000.0))) tmp = (t - a) / (b - y); else tmp = ((x * y) + (z * (t - a))) / (y + (z * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -185.0], N[Not[LessEqual[z, 41000.0]], $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 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -185 \lor \neg \left(z \leq 41000\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot b}\\
\end{array}
\end{array}
if z < -185 or 41000 < z Initial program 43.4%
Taylor expanded in z around inf 80.0%
if -185 < z < 41000Initial program 82.4%
Taylor expanded in b around inf 80.2%
*-commutative80.2%
Simplified80.2%
Final simplification80.1%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -2.4e+110)
(/ t b)
(if (<= z -1.65e+62)
(/ x (- z))
(if (or (<= z -9.5e-153) (not (<= z 7e-11))) (/ t b) x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.4e+110) {
tmp = t / b;
} else if (z <= -1.65e+62) {
tmp = x / -z;
} else if ((z <= -9.5e-153) || !(z <= 7e-11)) {
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 <= (-2.4d+110)) then
tmp = t / b
else if (z <= (-1.65d+62)) then
tmp = x / -z
else if ((z <= (-9.5d-153)) .or. (.not. (z <= 7d-11))) 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 <= -2.4e+110) {
tmp = t / b;
} else if (z <= -1.65e+62) {
tmp = x / -z;
} else if ((z <= -9.5e-153) || !(z <= 7e-11)) {
tmp = t / b;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -2.4e+110: tmp = t / b elif z <= -1.65e+62: tmp = x / -z elif (z <= -9.5e-153) or not (z <= 7e-11): tmp = t / b else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.4e+110) tmp = Float64(t / b); elseif (z <= -1.65e+62) tmp = Float64(x / Float64(-z)); elseif ((z <= -9.5e-153) || !(z <= 7e-11)) 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 <= -2.4e+110) tmp = t / b; elseif (z <= -1.65e+62) tmp = x / -z; elseif ((z <= -9.5e-153) || ~((z <= 7e-11))) tmp = t / b; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.4e+110], N[(t / b), $MachinePrecision], If[LessEqual[z, -1.65e+62], N[(x / (-z)), $MachinePrecision], If[Or[LessEqual[z, -9.5e-153], N[Not[LessEqual[z, 7e-11]], $MachinePrecision]], N[(t / b), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{+110}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;z \leq -1.65 \cdot 10^{+62}:\\
\;\;\;\;\frac{x}{-z}\\
\mathbf{elif}\;z \leq -9.5 \cdot 10^{-153} \lor \neg \left(z \leq 7 \cdot 10^{-11}\right):\\
\;\;\;\;\frac{t}{b}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.40000000000000012e110 or -1.65e62 < z < -9.50000000000000031e-153 or 7.00000000000000038e-11 < z Initial program 53.8%
Taylor expanded in a around 0 38.9%
Taylor expanded in y around 0 34.9%
if -2.40000000000000012e110 < z < -1.65e62Initial program 48.5%
Taylor expanded in x around inf 8.7%
*-commutative8.7%
Simplified8.7%
Taylor expanded in z around inf 8.7%
Taylor expanded in y around inf 43.3%
associate-*r/43.3%
mul-1-neg43.3%
Simplified43.3%
if -9.50000000000000031e-153 < z < 7.00000000000000038e-11Initial program 81.1%
Taylor expanded in z around 0 58.0%
Final simplification43.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.05e-160) (not (<= z 0.0038))) (/ (- t a) (- b y)) (/ (+ (* x y) (* z (- t a))) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.05e-160) || !(z <= 0.0038)) {
tmp = (t - a) / (b - y);
} else {
tmp = ((x * y) + (z * (t - a))) / 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.05d-160)) .or. (.not. (z <= 0.0038d0))) then
tmp = (t - a) / (b - y)
else
tmp = ((x * y) + (z * (t - a))) / 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.05e-160) || !(z <= 0.0038)) {
tmp = (t - a) / (b - y);
} else {
tmp = ((x * y) + (z * (t - a))) / y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.05e-160) or not (z <= 0.0038): tmp = (t - a) / (b - y) else: tmp = ((x * y) + (z * (t - a))) / y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.05e-160) || !(z <= 0.0038)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.05e-160) || ~((z <= 0.0038))) tmp = (t - a) / (b - y); else tmp = ((x * y) + (z * (t - a))) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.05e-160], N[Not[LessEqual[z, 0.0038]], $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] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{-160} \lor \neg \left(z \leq 0.0038\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y + z \cdot \left(t - a\right)}{y}\\
\end{array}
\end{array}
if z < -1.05e-160 or 0.00379999999999999999 < z Initial program 52.4%
Taylor expanded in z around inf 71.7%
if -1.05e-160 < z < 0.00379999999999999999Initial program 82.3%
Taylor expanded in b around inf 80.8%
*-commutative80.8%
Simplified80.8%
Taylor expanded in b around 0 67.5%
Final simplification70.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -9.5e-153) (not (<= z 44000.0))) (/ (- t a) (- b y)) (/ x (- 1.0 z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -9.5e-153) || !(z <= 44000.0)) {
tmp = (t - a) / (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 <= (-9.5d-153)) .or. (.not. (z <= 44000.0d0))) then
tmp = (t - a) / (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 <= -9.5e-153) || !(z <= 44000.0)) {
tmp = (t - a) / (b - y);
} else {
tmp = x / (1.0 - z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -9.5e-153) or not (z <= 44000.0): tmp = (t - a) / (b - y) else: tmp = x / (1.0 - z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -9.5e-153) || !(z <= 44000.0)) tmp = Float64(Float64(t - a) / 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 <= -9.5e-153) || ~((z <= 44000.0))) tmp = (t - a) / (b - y); else tmp = x / (1.0 - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -9.5e-153], N[Not[LessEqual[z, 44000.0]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{-153} \lor \neg \left(z \leq 44000\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{1 - z}\\
\end{array}
\end{array}
if z < -9.50000000000000031e-153 or 44000 < z Initial program 52.1%
Taylor expanded in z around inf 72.9%
if -9.50000000000000031e-153 < z < 44000Initial program 81.9%
Taylor expanded in y around inf 56.8%
mul-1-neg56.8%
unsub-neg56.8%
Simplified56.8%
Final simplification67.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -6.3e+56) (not (<= y 6.5e+63))) (/ x (- 1.0 z)) (/ (- t a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -6.3e+56) || !(y <= 6.5e+63)) {
tmp = x / (1.0 - z);
} else {
tmp = (t - a) / 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 ((y <= (-6.3d+56)) .or. (.not. (y <= 6.5d+63))) then
tmp = x / (1.0d0 - z)
else
tmp = (t - a) / 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 ((y <= -6.3e+56) || !(y <= 6.5e+63)) {
tmp = x / (1.0 - z);
} else {
tmp = (t - a) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -6.3e+56) or not (y <= 6.5e+63): tmp = x / (1.0 - z) else: tmp = (t - a) / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -6.3e+56) || !(y <= 6.5e+63)) tmp = Float64(x / Float64(1.0 - z)); else tmp = Float64(Float64(t - a) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -6.3e+56) || ~((y <= 6.5e+63))) tmp = x / (1.0 - z); else tmp = (t - a) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -6.3e+56], N[Not[LessEqual[y, 6.5e+63]], $MachinePrecision]], N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision], N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.3 \cdot 10^{+56} \lor \neg \left(y \leq 6.5 \cdot 10^{+63}\right):\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b}\\
\end{array}
\end{array}
if y < -6.3000000000000001e56 or 6.49999999999999992e63 < y Initial program 48.8%
Taylor expanded in y around inf 59.4%
mul-1-neg59.4%
unsub-neg59.4%
Simplified59.4%
if -6.3000000000000001e56 < y < 6.49999999999999992e63Initial program 73.6%
Taylor expanded in y around 0 56.8%
Final simplification57.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -9.5e-153) (not (<= z 1.2e-7))) (/ t b) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -9.5e-153) || !(z <= 1.2e-7)) {
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 <= (-9.5d-153)) .or. (.not. (z <= 1.2d-7))) 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 <= -9.5e-153) || !(z <= 1.2e-7)) {
tmp = t / b;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -9.5e-153) or not (z <= 1.2e-7): tmp = t / b else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -9.5e-153) || !(z <= 1.2e-7)) 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 <= -9.5e-153) || ~((z <= 1.2e-7))) tmp = t / b; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -9.5e-153], N[Not[LessEqual[z, 1.2e-7]], $MachinePrecision]], N[(t / b), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.5 \cdot 10^{-153} \lor \neg \left(z \leq 1.2 \cdot 10^{-7}\right):\\
\;\;\;\;\frac{t}{b}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -9.50000000000000031e-153 or 1.19999999999999989e-7 < z Initial program 53.2%
Taylor expanded in a around 0 37.7%
Taylor expanded in y around 0 32.2%
if -9.50000000000000031e-153 < z < 1.19999999999999989e-7Initial program 81.1%
Taylor expanded in z around 0 58.0%
Final simplification41.3%
(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 63.0%
Taylor expanded in z around 0 25.1%
Final simplification25.1%
(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 2024053
(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)))))