
(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 15 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) (* z (- t a))) t_1))
(t_3 (+ (* z (/ (- t a) t_1)) (* x (/ y t_1))))
(t_4 (/ (- t a) (pow (- b y) 2.0))))
(if (<= t_2 (- INFINITY))
t_3
(if (<= t_2 -4e-246)
t_2
(if (<= t_2 0.0)
(+ (/ (- (/ (* x y) (- b y)) (* y t_4)) z) (/ (- t a) (- b y)))
(if (<= t_2 INFINITY)
t_3
(+
(+ (/ t (- b y)) (* (/ x z) (/ y (- b y))))
(- (/ a (- y b)) (* t_4 (/ y z))))))))))
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) + (z * (t - a))) / t_1;
double t_3 = (z * ((t - a) / t_1)) + (x * (y / t_1));
double t_4 = (t - a) / pow((b - y), 2.0);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_3;
} else if (t_2 <= -4e-246) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = ((((x * y) / (b - y)) - (y * t_4)) / z) + ((t - a) / (b - y));
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = ((t / (b - y)) + ((x / z) * (y / (b - y)))) + ((a / (y - b)) - (t_4 * (y / z)));
}
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 = ((x * y) + (z * (t - a))) / t_1;
double t_3 = (z * ((t - a) / t_1)) + (x * (y / t_1));
double t_4 = (t - a) / Math.pow((b - y), 2.0);
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_3;
} else if (t_2 <= -4e-246) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = ((((x * y) / (b - y)) - (y * t_4)) / z) + ((t - a) / (b - y));
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = t_3;
} else {
tmp = ((t / (b - y)) + ((x / z) * (y / (b - y)))) + ((a / (y - b)) - (t_4 * (y / z)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (z * (b - y)) t_2 = ((x * y) + (z * (t - a))) / t_1 t_3 = (z * ((t - a) / t_1)) + (x * (y / t_1)) t_4 = (t - a) / math.pow((b - y), 2.0) tmp = 0 if t_2 <= -math.inf: tmp = t_3 elif t_2 <= -4e-246: tmp = t_2 elif t_2 <= 0.0: tmp = ((((x * y) / (b - y)) - (y * t_4)) / z) + ((t - a) / (b - y)) elif t_2 <= math.inf: tmp = t_3 else: tmp = ((t / (b - y)) + ((x / z) * (y / (b - y)))) + ((a / (y - b)) - (t_4 * (y / z))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(z * Float64(b - y))) t_2 = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / t_1) t_3 = Float64(Float64(z * Float64(Float64(t - a) / t_1)) + Float64(x * Float64(y / t_1))) t_4 = Float64(Float64(t - a) / (Float64(b - y) ^ 2.0)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_3; elseif (t_2 <= -4e-246) tmp = t_2; elseif (t_2 <= 0.0) tmp = Float64(Float64(Float64(Float64(Float64(x * y) / Float64(b - y)) - Float64(y * t_4)) / z) + Float64(Float64(t - a) / Float64(b - y))); elseif (t_2 <= Inf) tmp = t_3; else tmp = Float64(Float64(Float64(t / Float64(b - y)) + Float64(Float64(x / z) * Float64(y / Float64(b - y)))) + Float64(Float64(a / Float64(y - b)) - Float64(t_4 * Float64(y / z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (z * (b - y)); t_2 = ((x * y) + (z * (t - a))) / t_1; t_3 = (z * ((t - a) / t_1)) + (x * (y / t_1)); t_4 = (t - a) / ((b - y) ^ 2.0); tmp = 0.0; if (t_2 <= -Inf) tmp = t_3; elseif (t_2 <= -4e-246) tmp = t_2; elseif (t_2 <= 0.0) tmp = ((((x * y) / (b - y)) - (y * t_4)) / z) + ((t - a) / (b - y)); elseif (t_2 <= Inf) tmp = t_3; else tmp = ((t / (b - y)) + ((x / z) * (y / (b - y)))) + ((a / (y - b)) - (t_4 * (y / z))); 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[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(z * N[(N[(t - a), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x * N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(t - a), $MachinePrecision] / N[Power[N[(b - y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$3, If[LessEqual[t$95$2, -4e-246], t$95$2, If[LessEqual[t$95$2, 0.0], N[(N[(N[(N[(N[(x * y), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision] - N[(y * t$95$4), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] + N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], t$95$3, N[(N[(N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision] + N[(N[(x / z), $MachinePrecision] * N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a / N[(y - b), $MachinePrecision]), $MachinePrecision] - N[(t$95$4 * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + z \cdot \left(b - y\right)\\
t_2 := \frac{x \cdot y + z \cdot \left(t - a\right)}{t\_1}\\
t_3 := z \cdot \frac{t - a}{t\_1} + x \cdot \frac{y}{t\_1}\\
t_4 := \frac{t - a}{{\left(b - y\right)}^{2}}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq -4 \cdot 10^{-246}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\frac{\frac{x \cdot y}{b - y} - y \cdot t\_4}{z} + \frac{t - a}{b - y}\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{t}{b - y} + \frac{x}{z} \cdot \frac{y}{b - y}\right) + \left(\frac{a}{y - b} - t\_4 \cdot \frac{y}{z}\right)\\
\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 -0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < +inf.0Initial program 69.2%
fma-define69.2%
+-commutative69.2%
fma-define69.2%
Simplified69.2%
Taylor expanded in x around inf 79.1%
Taylor expanded in x around 0 69.2%
+-commutative69.2%
associate-/l*78.9%
associate-/l*97.1%
Simplified97.1%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -3.99999999999999982e-246Initial program 99.6%
if -3.99999999999999982e-246 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -0.0Initial program 23.6%
fma-define23.6%
+-commutative23.6%
fma-define23.6%
Simplified23.6%
Taylor expanded in z around -inf 75.1%
associate--l+75.1%
mul-1-neg75.1%
distribute-lft-out--75.1%
*-commutative75.1%
associate-/l*84.2%
div-sub84.2%
Simplified84.2%
if +inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 0.0%
fma-define0.0%
+-commutative0.0%
fma-define0.0%
Simplified0.0%
Taylor expanded in z around inf 18.2%
times-frac33.3%
times-frac100.0%
Simplified100.0%
Final simplification97.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (* z (- b y))))
(t_2 (/ (+ (* x y) (* z (- t a))) t_1))
(t_3 (/ (- t a) (- b y))))
(if (<= t_2 (- INFINITY))
(+ (* z (/ (- t a) t_1)) (* x (/ y t_1)))
(if (<= t_2 -4e-246)
t_2
(if (<= t_2 0.0)
(+
(/ (- (/ (* x y) (- b y)) (* y (/ (- t a) (pow (- b y) 2.0)))) z)
t_3)
(if (<= t_2 5e+288)
(/ (+ (* x y) (- (* z t) (* z a))) t_1)
(+ t_3 (/ x (- 1.0 z)))))))))
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) + (z * (t - a))) / t_1;
double t_3 = (t - a) / (b - y);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = (z * ((t - a) / t_1)) + (x * (y / t_1));
} else if (t_2 <= -4e-246) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = ((((x * y) / (b - y)) - (y * ((t - a) / pow((b - y), 2.0)))) / z) + t_3;
} else if (t_2 <= 5e+288) {
tmp = ((x * y) + ((z * t) - (z * a))) / t_1;
} else {
tmp = t_3 + (x / (1.0 - z));
}
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 = ((x * y) + (z * (t - a))) / t_1;
double t_3 = (t - a) / (b - y);
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = (z * ((t - a) / t_1)) + (x * (y / t_1));
} else if (t_2 <= -4e-246) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = ((((x * y) / (b - y)) - (y * ((t - a) / Math.pow((b - y), 2.0)))) / z) + t_3;
} else if (t_2 <= 5e+288) {
tmp = ((x * y) + ((z * t) - (z * a))) / t_1;
} else {
tmp = t_3 + (x / (1.0 - z));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (z * (b - y)) t_2 = ((x * y) + (z * (t - a))) / t_1 t_3 = (t - a) / (b - y) tmp = 0 if t_2 <= -math.inf: tmp = (z * ((t - a) / t_1)) + (x * (y / t_1)) elif t_2 <= -4e-246: tmp = t_2 elif t_2 <= 0.0: tmp = ((((x * y) / (b - y)) - (y * ((t - a) / math.pow((b - y), 2.0)))) / z) + t_3 elif t_2 <= 5e+288: tmp = ((x * y) + ((z * t) - (z * a))) / t_1 else: tmp = t_3 + (x / (1.0 - z)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(z * Float64(b - y))) t_2 = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / t_1) t_3 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(Float64(z * Float64(Float64(t - a) / t_1)) + Float64(x * Float64(y / t_1))); elseif (t_2 <= -4e-246) tmp = t_2; elseif (t_2 <= 0.0) tmp = Float64(Float64(Float64(Float64(Float64(x * y) / Float64(b - y)) - Float64(y * Float64(Float64(t - a) / (Float64(b - y) ^ 2.0)))) / z) + t_3); elseif (t_2 <= 5e+288) tmp = Float64(Float64(Float64(x * y) + Float64(Float64(z * t) - Float64(z * a))) / t_1); else tmp = Float64(t_3 + Float64(x / Float64(1.0 - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (z * (b - y)); t_2 = ((x * y) + (z * (t - a))) / t_1; t_3 = (t - a) / (b - y); tmp = 0.0; if (t_2 <= -Inf) tmp = (z * ((t - a) / t_1)) + (x * (y / t_1)); elseif (t_2 <= -4e-246) tmp = t_2; elseif (t_2 <= 0.0) tmp = ((((x * y) / (b - y)) - (y * ((t - a) / ((b - y) ^ 2.0)))) / z) + t_3; elseif (t_2 <= 5e+288) tmp = ((x * y) + ((z * t) - (z * a))) / t_1; else tmp = t_3 + (x / (1.0 - z)); 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[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(z * N[(N[(t - a), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(x * N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -4e-246], t$95$2, If[LessEqual[t$95$2, 0.0], N[(N[(N[(N[(N[(x * y), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision] - N[(y * N[(N[(t - a), $MachinePrecision] / N[Power[N[(b - y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] + t$95$3), $MachinePrecision], If[LessEqual[t$95$2, 5e+288], N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], N[(t$95$3 + N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + z \cdot \left(b - y\right)\\
t_2 := \frac{x \cdot y + z \cdot \left(t - a\right)}{t\_1}\\
t_3 := \frac{t - a}{b - y}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;z \cdot \frac{t - a}{t\_1} + x \cdot \frac{y}{t\_1}\\
\mathbf{elif}\;t\_2 \leq -4 \cdot 10^{-246}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\frac{\frac{x \cdot y}{b - y} - y \cdot \frac{t - a}{{\left(b - y\right)}^{2}}}{z} + t\_3\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+288}:\\
\;\;\;\;\frac{x \cdot y + \left(z \cdot t - z \cdot a\right)}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_3 + \frac{x}{1 - z}\\
\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 30.4%
fma-define30.4%
+-commutative30.4%
fma-define30.4%
Simplified30.4%
Taylor expanded in x around inf 66.5%
Taylor expanded in x around 0 30.4%
+-commutative30.4%
associate-/l*63.1%
associate-/l*99.8%
Simplified99.8%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -3.99999999999999982e-246Initial program 99.6%
if -3.99999999999999982e-246 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -0.0Initial program 23.6%
fma-define23.6%
+-commutative23.6%
fma-define23.6%
Simplified23.6%
Taylor expanded in z around -inf 75.1%
associate--l+75.1%
mul-1-neg75.1%
distribute-lft-out--75.1%
*-commutative75.1%
associate-/l*84.2%
div-sub84.2%
Simplified84.2%
if -0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 5.0000000000000003e288Initial program 99.6%
sub-neg99.6%
distribute-lft-in99.7%
Applied egg-rr99.7%
if 5.0000000000000003e288 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 10.3%
fma-define10.3%
+-commutative10.3%
fma-define10.3%
Simplified10.3%
Taylor expanded in x around inf 32.8%
Taylor expanded in x around 0 10.3%
+-commutative10.3%
associate-/l*24.5%
associate-/l*49.1%
Simplified49.1%
Taylor expanded in z around inf 80.0%
Taylor expanded in y around inf 86.9%
neg-mul-186.9%
sub-neg86.9%
Simplified86.9%
Final simplification95.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (* z (- b y))))
(t_2 (/ (- t a) (- b y)))
(t_3 (/ (+ (* x y) (* z (- t a))) t_1))
(t_4 (+ t_2 (/ x (- 1.0 z)))))
(if (<= t_3 (- INFINITY))
t_4
(if (<= t_3 -2e-247)
t_3
(if (<= t_3 0.0)
t_2
(if (<= t_3 5e+288) (/ (+ (* x y) (- (* z t) (* z a))) t_1) t_4))))))
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);
double t_3 = ((x * y) + (z * (t - a))) / t_1;
double t_4 = t_2 + (x / (1.0 - z));
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = t_4;
} else if (t_3 <= -2e-247) {
tmp = t_3;
} else if (t_3 <= 0.0) {
tmp = t_2;
} else if (t_3 <= 5e+288) {
tmp = ((x * y) + ((z * t) - (z * a))) / t_1;
} else {
tmp = t_4;
}
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 = (t - a) / (b - y);
double t_3 = ((x * y) + (z * (t - a))) / t_1;
double t_4 = t_2 + (x / (1.0 - z));
double tmp;
if (t_3 <= -Double.POSITIVE_INFINITY) {
tmp = t_4;
} else if (t_3 <= -2e-247) {
tmp = t_3;
} else if (t_3 <= 0.0) {
tmp = t_2;
} else if (t_3 <= 5e+288) {
tmp = ((x * y) + ((z * t) - (z * a))) / t_1;
} else {
tmp = t_4;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (z * (b - y)) t_2 = (t - a) / (b - y) t_3 = ((x * y) + (z * (t - a))) / t_1 t_4 = t_2 + (x / (1.0 - z)) tmp = 0 if t_3 <= -math.inf: tmp = t_4 elif t_3 <= -2e-247: tmp = t_3 elif t_3 <= 0.0: tmp = t_2 elif t_3 <= 5e+288: tmp = ((x * y) + ((z * t) - (z * a))) / t_1 else: tmp = t_4 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(z * Float64(b - y))) t_2 = Float64(Float64(t - a) / Float64(b - y)) t_3 = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / t_1) t_4 = Float64(t_2 + Float64(x / Float64(1.0 - z))) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = t_4; elseif (t_3 <= -2e-247) tmp = t_3; elseif (t_3 <= 0.0) tmp = t_2; elseif (t_3 <= 5e+288) tmp = Float64(Float64(Float64(x * y) + Float64(Float64(z * t) - Float64(z * a))) / t_1); else tmp = t_4; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (z * (b - y)); t_2 = (t - a) / (b - y); t_3 = ((x * y) + (z * (t - a))) / t_1; t_4 = t_2 + (x / (1.0 - z)); tmp = 0.0; if (t_3 <= -Inf) tmp = t_4; elseif (t_3 <= -2e-247) tmp = t_3; elseif (t_3 <= 0.0) tmp = t_2; elseif (t_3 <= 5e+288) tmp = ((x * y) + ((z * t) - (z * a))) / t_1; else tmp = t_4; 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[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$2 + N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], t$95$4, If[LessEqual[t$95$3, -2e-247], t$95$3, If[LessEqual[t$95$3, 0.0], t$95$2, If[LessEqual[t$95$3, 5e+288], N[(N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], t$95$4]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + z \cdot \left(b - y\right)\\
t_2 := \frac{t - a}{b - y}\\
t_3 := \frac{x \cdot y + z \cdot \left(t - a\right)}{t\_1}\\
t_4 := t\_2 + \frac{x}{1 - z}\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_3 \leq -2 \cdot 10^{-247}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+288}:\\
\;\;\;\;\frac{x \cdot y + \left(z \cdot t - z \cdot a\right)}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\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 5.0000000000000003e288 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 15.7%
fma-define15.7%
+-commutative15.7%
fma-define15.7%
Simplified15.7%
Taylor expanded in x around inf 41.8%
Taylor expanded in x around 0 15.7%
+-commutative15.7%
associate-/l*34.8%
associate-/l*62.7%
Simplified62.7%
Taylor expanded in z around inf 82.9%
Taylor expanded in y around inf 88.1%
neg-mul-188.1%
sub-neg88.1%
Simplified88.1%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -2e-247Initial program 99.6%
if -2e-247 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -0.0Initial program 19.6%
fma-define19.6%
+-commutative19.6%
fma-define19.6%
Simplified19.6%
Taylor expanded in z around inf 69.0%
if -0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 5.0000000000000003e288Initial program 99.6%
sub-neg99.6%
distribute-lft-in99.7%
Applied egg-rr99.7%
Final simplification93.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y)))
(t_2 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
(t_3 (+ t_1 (/ x (- 1.0 z)))))
(if (<= t_2 (- INFINITY))
t_3
(if (<= t_2 -2e-247)
t_2
(if (<= t_2 0.0) t_1 (if (<= t_2 5e+288) 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 = ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
double t_3 = t_1 + (x / (1.0 - z));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_3;
} else if (t_2 <= -2e-247) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = t_1;
} else if (t_2 <= 5e+288) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
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 = ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
double t_3 = t_1 + (x / (1.0 - z));
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_3;
} else if (t_2 <= -2e-247) {
tmp = t_2;
} else if (t_2 <= 0.0) {
tmp = t_1;
} else if (t_2 <= 5e+288) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / (b - y) t_2 = ((x * y) + (z * (t - a))) / (y + (z * (b - y))) t_3 = t_1 + (x / (1.0 - z)) tmp = 0 if t_2 <= -math.inf: tmp = t_3 elif t_2 <= -2e-247: tmp = t_2 elif t_2 <= 0.0: tmp = t_1 elif t_2 <= 5e+288: tmp = t_2 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) t_2 = Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) t_3 = Float64(t_1 + Float64(x / Float64(1.0 - z))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_3; elseif (t_2 <= -2e-247) tmp = t_2; elseif (t_2 <= 0.0) tmp = t_1; elseif (t_2 <= 5e+288) tmp = t_2; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - a) / (b - y); t_2 = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); t_3 = t_1 + (x / (1.0 - z)); tmp = 0.0; if (t_2 <= -Inf) tmp = t_3; elseif (t_2 <= -2e-247) tmp = t_2; elseif (t_2 <= 0.0) tmp = t_1; elseif (t_2 <= 5e+288) tmp = t_2; else tmp = 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[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 + N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$3, If[LessEqual[t$95$2, -2e-247], t$95$2, If[LessEqual[t$95$2, 0.0], t$95$1, If[LessEqual[t$95$2, 5e+288], t$95$2, t$95$3]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
t_2 := \frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
t_3 := t\_1 + \frac{x}{1 - z}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-247}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+288}:\\
\;\;\;\;t\_2\\
\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)))) < -inf.0 or 5.0000000000000003e288 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 15.7%
fma-define15.7%
+-commutative15.7%
fma-define15.7%
Simplified15.7%
Taylor expanded in x around inf 41.8%
Taylor expanded in x around 0 15.7%
+-commutative15.7%
associate-/l*34.8%
associate-/l*62.7%
Simplified62.7%
Taylor expanded in z around inf 82.9%
Taylor expanded in y around inf 88.1%
neg-mul-188.1%
sub-neg88.1%
Simplified88.1%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -2e-247 or -0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 5.0000000000000003e288Initial program 99.6%
if -2e-247 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -0.0Initial program 19.6%
fma-define19.6%
+-commutative19.6%
fma-define19.6%
Simplified19.6%
Taylor expanded in z around inf 69.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y)))
(t_2 (+ y (* z (- b y))))
(t_3 (* x (/ y t_2))))
(if (<= z -1220000000000.0)
(+ t_3 t_1)
(if (<= z 1.45e+58)
(+ (* z (/ (- t a) t_2)) t_3)
(+ t_1 (/ x (- 1.0 z)))))))
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 = x * (y / t_2);
double tmp;
if (z <= -1220000000000.0) {
tmp = t_3 + t_1;
} else if (z <= 1.45e+58) {
tmp = (z * ((t - a) / t_2)) + t_3;
} else {
tmp = t_1 + (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) :: 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 = x * (y / t_2)
if (z <= (-1220000000000.0d0)) then
tmp = t_3 + t_1
else if (z <= 1.45d+58) then
tmp = (z * ((t - a) / t_2)) + t_3
else
tmp = t_1 + (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 t_1 = (t - a) / (b - y);
double t_2 = y + (z * (b - y));
double t_3 = x * (y / t_2);
double tmp;
if (z <= -1220000000000.0) {
tmp = t_3 + t_1;
} else if (z <= 1.45e+58) {
tmp = (z * ((t - a) / t_2)) + t_3;
} else {
tmp = t_1 + (x / (1.0 - z));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / (b - y) t_2 = y + (z * (b - y)) t_3 = x * (y / t_2) tmp = 0 if z <= -1220000000000.0: tmp = t_3 + t_1 elif z <= 1.45e+58: tmp = (z * ((t - a) / t_2)) + t_3 else: tmp = t_1 + (x / (1.0 - z)) 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(x * Float64(y / t_2)) tmp = 0.0 if (z <= -1220000000000.0) tmp = Float64(t_3 + t_1); elseif (z <= 1.45e+58) tmp = Float64(Float64(z * Float64(Float64(t - a) / t_2)) + t_3); else tmp = Float64(t_1 + Float64(x / Float64(1.0 - z))); 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 = x * (y / t_2); tmp = 0.0; if (z <= -1220000000000.0) tmp = t_3 + t_1; elseif (z <= 1.45e+58) tmp = (z * ((t - a) / t_2)) + t_3; else tmp = t_1 + (x / (1.0 - z)); 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[(x * N[(y / t$95$2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1220000000000.0], N[(t$95$3 + t$95$1), $MachinePrecision], If[LessEqual[z, 1.45e+58], N[(N[(z * N[(N[(t - a), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision], N[(t$95$1 + N[(x / N[(1.0 - z), $MachinePrecision]), $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 := x \cdot \frac{y}{t\_2}\\
\mathbf{if}\;z \leq -1220000000000:\\
\;\;\;\;t\_3 + t\_1\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{+58}:\\
\;\;\;\;z \cdot \frac{t - a}{t\_2} + t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \frac{x}{1 - z}\\
\end{array}
\end{array}
if z < -1.22e12Initial program 43.8%
fma-define43.8%
+-commutative43.8%
fma-define43.8%
Simplified43.8%
Taylor expanded in x around inf 41.1%
Taylor expanded in x around 0 43.8%
+-commutative43.8%
associate-/l*53.5%
associate-/l*58.3%
Simplified58.3%
Taylor expanded in z around inf 88.2%
if -1.22e12 < z < 1.45000000000000001e58Initial program 82.3%
fma-define82.3%
+-commutative82.3%
fma-define82.3%
Simplified82.3%
Taylor expanded in x around inf 85.9%
Taylor expanded in x around 0 82.3%
+-commutative82.3%
associate-/l*79.4%
associate-/l*93.1%
Simplified93.1%
if 1.45000000000000001e58 < z Initial program 42.0%
fma-define42.0%
+-commutative42.0%
fma-define42.0%
Simplified42.0%
Taylor expanded in x around inf 37.7%
Taylor expanded in x around 0 42.0%
+-commutative42.0%
associate-/l*55.3%
associate-/l*58.0%
Simplified58.0%
Taylor expanded in z around inf 84.4%
Taylor expanded in y around inf 90.4%
neg-mul-190.4%
sub-neg90.4%
Simplified90.4%
Final simplification91.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -1.05e-19)
t_1
(if (<= z 5.5e-8)
(+ x (* z (/ (- t a) y)))
(if (<= z 1.02e+85) (* (/ x z) (/ y (- b y))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -1.05e-19) {
tmp = t_1;
} else if (z <= 5.5e-8) {
tmp = x + (z * ((t - a) / y));
} else if (z <= 1.02e+85) {
tmp = (x / z) * (y / (b - 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 = (t - a) / (b - y)
if (z <= (-1.05d-19)) then
tmp = t_1
else if (z <= 5.5d-8) then
tmp = x + (z * ((t - a) / y))
else if (z <= 1.02d+85) then
tmp = (x / z) * (y / (b - 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 = (t - a) / (b - y);
double tmp;
if (z <= -1.05e-19) {
tmp = t_1;
} else if (z <= 5.5e-8) {
tmp = x + (z * ((t - a) / y));
} else if (z <= 1.02e+85) {
tmp = (x / z) * (y / (b - y));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / (b - y) tmp = 0 if z <= -1.05e-19: tmp = t_1 elif z <= 5.5e-8: tmp = x + (z * ((t - a) / y)) elif z <= 1.02e+85: tmp = (x / z) * (y / (b - y)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -1.05e-19) tmp = t_1; elseif (z <= 5.5e-8) tmp = Float64(x + Float64(z * Float64(Float64(t - a) / y))); elseif (z <= 1.02e+85) tmp = Float64(Float64(x / z) * Float64(y / Float64(b - y))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - a) / (b - y); tmp = 0.0; if (z <= -1.05e-19) tmp = t_1; elseif (z <= 5.5e-8) tmp = x + (z * ((t - a) / y)); elseif (z <= 1.02e+85) tmp = (x / z) * (y / (b - y)); else tmp = t_1; 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]}, If[LessEqual[z, -1.05e-19], t$95$1, If[LessEqual[z, 5.5e-8], N[(x + N[(z * N[(N[(t - a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.02e+85], N[(N[(x / z), $MachinePrecision] * N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -1.05 \cdot 10^{-19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-8}:\\
\;\;\;\;x + z \cdot \frac{t - a}{y}\\
\mathbf{elif}\;z \leq 1.02 \cdot 10^{+85}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{y}{b - y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.0499999999999999e-19 or 1.02e85 < z Initial program 48.3%
fma-define48.3%
+-commutative48.3%
fma-define48.3%
Simplified48.3%
Taylor expanded in z around inf 73.9%
if -1.0499999999999999e-19 < z < 5.5000000000000003e-8Initial program 83.6%
Taylor expanded in z around 0 63.1%
Taylor expanded in x around 0 76.9%
associate-/l*74.6%
Simplified74.6%
if 5.5000000000000003e-8 < z < 1.02e85Initial program 54.2%
fma-define54.2%
+-commutative54.2%
fma-define54.3%
Simplified54.3%
Taylor expanded in x around inf 60.4%
Taylor expanded in x around inf 41.3%
associate-/l*48.1%
Simplified48.1%
Taylor expanded in z around inf 41.3%
times-frac67.8%
Simplified67.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -5.5e-24) (not (<= z 2.55e-45))) (+ (/ (- t a) (- b y)) (/ x (- 1.0 z))) (+ x (* z (/ (- t a) y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -5.5e-24) || !(z <= 2.55e-45)) {
tmp = ((t - a) / (b - y)) + (x / (1.0 - z));
} else {
tmp = x + (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 <= (-5.5d-24)) .or. (.not. (z <= 2.55d-45))) then
tmp = ((t - a) / (b - y)) + (x / (1.0d0 - z))
else
tmp = x + (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 <= -5.5e-24) || !(z <= 2.55e-45)) {
tmp = ((t - a) / (b - y)) + (x / (1.0 - z));
} else {
tmp = x + (z * ((t - a) / y));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -5.5e-24) or not (z <= 2.55e-45): tmp = ((t - a) / (b - y)) + (x / (1.0 - z)) else: tmp = x + (z * ((t - a) / y)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -5.5e-24) || !(z <= 2.55e-45)) tmp = Float64(Float64(Float64(t - a) / Float64(b - y)) + Float64(x / Float64(1.0 - z))); else tmp = Float64(x + Float64(z * Float64(Float64(t - a) / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -5.5e-24) || ~((z <= 2.55e-45))) tmp = ((t - a) / (b - y)) + (x / (1.0 - z)); else tmp = x + (z * ((t - a) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -5.5e-24], N[Not[LessEqual[z, 2.55e-45]], $MachinePrecision]], N[(N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision] + N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(N[(t - a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{-24} \lor \neg \left(z \leq 2.55 \cdot 10^{-45}\right):\\
\;\;\;\;\frac{t - a}{b - y} + \frac{x}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{t - a}{y}\\
\end{array}
\end{array}
if z < -5.4999999999999999e-24 or 2.5499999999999999e-45 < z Initial program 52.5%
fma-define52.5%
+-commutative52.5%
fma-define52.5%
Simplified52.5%
Taylor expanded in x around inf 47.9%
Taylor expanded in x around 0 52.5%
+-commutative52.5%
associate-/l*61.6%
associate-/l*66.5%
Simplified66.5%
Taylor expanded in z around inf 85.4%
Taylor expanded in y around inf 77.6%
neg-mul-177.6%
sub-neg77.6%
Simplified77.6%
if -5.4999999999999999e-24 < z < 2.5499999999999999e-45Initial program 82.2%
Taylor expanded in z around 0 65.1%
Taylor expanded in x around 0 80.1%
associate-/l*77.6%
Simplified77.6%
Final simplification77.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (- 1.0 z))))
(if (<= y -8e-26)
t_1
(if (<= y -3.3e-251) (/ t b) (if (<= y 8200.0) (/ a (- 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 <= -8e-26) {
tmp = t_1;
} else if (y <= -3.3e-251) {
tmp = t / b;
} else if (y <= 8200.0) {
tmp = a / -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 <= (-8d-26)) then
tmp = t_1
else if (y <= (-3.3d-251)) then
tmp = t / b
else if (y <= 8200.0d0) then
tmp = a / -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 <= -8e-26) {
tmp = t_1;
} else if (y <= -3.3e-251) {
tmp = t / b;
} else if (y <= 8200.0) {
tmp = a / -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 <= -8e-26: tmp = t_1 elif y <= -3.3e-251: tmp = t / b elif y <= 8200.0: tmp = a / -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 <= -8e-26) tmp = t_1; elseif (y <= -3.3e-251) tmp = Float64(t / b); elseif (y <= 8200.0) tmp = Float64(a / Float64(-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 <= -8e-26) tmp = t_1; elseif (y <= -3.3e-251) tmp = t / b; elseif (y <= 8200.0) tmp = a / -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, -8e-26], t$95$1, If[LessEqual[y, -3.3e-251], N[(t / b), $MachinePrecision], If[LessEqual[y, 8200.0], N[(a / (-b)), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{1 - z}\\
\mathbf{if}\;y \leq -8 \cdot 10^{-26}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -3.3 \cdot 10^{-251}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;y \leq 8200:\\
\;\;\;\;\frac{a}{-b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -8.0000000000000003e-26 or 8200 < y Initial program 58.6%
fma-define58.6%
+-commutative58.6%
fma-define58.6%
Simplified58.6%
Taylor expanded in y around inf 54.6%
mul-1-neg54.6%
unsub-neg54.6%
Simplified54.6%
if -8.0000000000000003e-26 < y < -3.3e-251Initial program 80.7%
fma-define80.7%
+-commutative80.7%
fma-define80.7%
Simplified80.7%
Taylor expanded in x around inf 67.7%
Taylor expanded in b around inf 67.5%
associate-/l*63.9%
associate--l+63.9%
Simplified63.9%
Taylor expanded in t around inf 45.7%
if -3.3e-251 < y < 8200Initial program 74.1%
fma-define74.1%
+-commutative74.1%
fma-define74.1%
Simplified74.1%
Taylor expanded in x around inf 55.1%
Taylor expanded in b around inf 47.0%
associate-/l*42.9%
associate--l+42.9%
Simplified42.9%
Taylor expanded in a around inf 38.5%
associate-*r/38.5%
mul-1-neg38.5%
Simplified38.5%
Final simplification49.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.26e-24) (not (<= z 8.5e-36))) (/ (- t a) (- b y)) (* x (/ y (+ y (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.26e-24) || !(z <= 8.5e-36)) {
tmp = (t - a) / (b - y);
} else {
tmp = x * (y / (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 <= (-1.26d-24)) .or. (.not. (z <= 8.5d-36))) then
tmp = (t - a) / (b - y)
else
tmp = x * (y / (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 <= -1.26e-24) || !(z <= 8.5e-36)) {
tmp = (t - a) / (b - y);
} else {
tmp = x * (y / (y + (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.26e-24) or not (z <= 8.5e-36): tmp = (t - a) / (b - y) else: tmp = x * (y / (y + (z * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.26e-24) || !(z <= 8.5e-36)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(x * Float64(y / Float64(y + Float64(z * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.26e-24) || ~((z <= 8.5e-36))) tmp = (t - a) / (b - y); else tmp = x * (y / (y + (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.26e-24], N[Not[LessEqual[z, 8.5e-36]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(x * N[(y / N[(y + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.26 \cdot 10^{-24} \lor \neg \left(z \leq 8.5 \cdot 10^{-36}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{y + z \cdot b}\\
\end{array}
\end{array}
if z < -1.25999999999999992e-24 or 8.5000000000000007e-36 < z Initial program 51.5%
fma-define51.4%
+-commutative51.4%
fma-define51.5%
Simplified51.5%
Taylor expanded in z around inf 67.9%
if -1.25999999999999992e-24 < z < 8.5000000000000007e-36Initial program 82.7%
fma-define82.7%
+-commutative82.7%
fma-define82.7%
Simplified82.7%
Taylor expanded in x around inf 88.8%
Taylor expanded in x around inf 48.2%
associate-/l*62.8%
Simplified62.8%
Taylor expanded in b around inf 62.8%
*-commutative62.8%
Simplified62.8%
Final simplification65.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ a (- b))))
(if (<= z -6.8e+19)
t_1
(if (<= z 4050.0) x (if (<= z 1.26e+132) (/ x (- z)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a / -b;
double tmp;
if (z <= -6.8e+19) {
tmp = t_1;
} else if (z <= 4050.0) {
tmp = x;
} else if (z <= 1.26e+132) {
tmp = x / -z;
} 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 = a / -b
if (z <= (-6.8d+19)) then
tmp = t_1
else if (z <= 4050.0d0) then
tmp = x
else if (z <= 1.26d+132) then
tmp = x / -z
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 = a / -b;
double tmp;
if (z <= -6.8e+19) {
tmp = t_1;
} else if (z <= 4050.0) {
tmp = x;
} else if (z <= 1.26e+132) {
tmp = x / -z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a / -b tmp = 0 if z <= -6.8e+19: tmp = t_1 elif z <= 4050.0: tmp = x elif z <= 1.26e+132: tmp = x / -z else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a / Float64(-b)) tmp = 0.0 if (z <= -6.8e+19) tmp = t_1; elseif (z <= 4050.0) tmp = x; elseif (z <= 1.26e+132) tmp = Float64(x / Float64(-z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a / -b; tmp = 0.0; if (z <= -6.8e+19) tmp = t_1; elseif (z <= 4050.0) tmp = x; elseif (z <= 1.26e+132) tmp = x / -z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a / (-b)), $MachinePrecision]}, If[LessEqual[z, -6.8e+19], t$95$1, If[LessEqual[z, 4050.0], x, If[LessEqual[z, 1.26e+132], N[(x / (-z)), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a}{-b}\\
\mathbf{if}\;z \leq -6.8 \cdot 10^{+19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4050:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.26 \cdot 10^{+132}:\\
\;\;\;\;\frac{x}{-z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.8e19 or 1.25999999999999999e132 < z Initial program 41.3%
fma-define41.3%
+-commutative41.3%
fma-define41.3%
Simplified41.3%
Taylor expanded in x around inf 38.3%
Taylor expanded in b around inf 44.1%
associate-/l*40.9%
associate--l+40.9%
Simplified40.9%
Taylor expanded in a around inf 32.8%
associate-*r/32.8%
mul-1-neg32.8%
Simplified32.8%
if -6.8e19 < z < 4050Initial program 83.6%
fma-define83.6%
+-commutative83.6%
fma-define83.6%
Simplified83.6%
Taylor expanded in z around 0 47.5%
if 4050 < z < 1.25999999999999999e132Initial program 52.8%
fma-define52.7%
+-commutative52.7%
fma-define52.7%
Simplified52.7%
Taylor expanded in y around inf 38.0%
mul-1-neg38.0%
unsub-neg38.0%
Simplified38.0%
Taylor expanded in z around inf 37.9%
associate-*r/37.9%
mul-1-neg37.9%
Simplified37.9%
Final simplification41.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.3e-23) (not (<= z 7.4e-60))) (/ (- t a) (- b y)) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.3e-23) || !(z <= 7.4e-60)) {
tmp = (t - a) / (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 <= (-1.3d-23)) .or. (.not. (z <= 7.4d-60))) then
tmp = (t - a) / (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 <= -1.3e-23) || !(z <= 7.4e-60)) {
tmp = (t - a) / (b - y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.3e-23) or not (z <= 7.4e-60): tmp = (t - a) / (b - y) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.3e-23) || !(z <= 7.4e-60)) tmp = Float64(Float64(t - a) / 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 <= -1.3e-23) || ~((z <= 7.4e-60))) tmp = (t - a) / (b - y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.3e-23], N[Not[LessEqual[z, 7.4e-60]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{-23} \lor \neg \left(z \leq 7.4 \cdot 10^{-60}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.3e-23 or 7.4000000000000005e-60 < z Initial program 53.7%
fma-define53.7%
+-commutative53.7%
fma-define53.7%
Simplified53.7%
Taylor expanded in z around inf 66.3%
if -1.3e-23 < z < 7.4000000000000005e-60Initial program 81.6%
fma-define81.6%
+-commutative81.6%
fma-define81.6%
Simplified81.6%
Taylor expanded in z around 0 57.0%
Final simplification62.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.95e-25) (not (<= y 12000.0))) (/ 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 <= -1.95e-25) || !(y <= 12000.0)) {
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 <= (-1.95d-25)) .or. (.not. (y <= 12000.0d0))) 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 <= -1.95e-25) || !(y <= 12000.0)) {
tmp = x / (1.0 - z);
} else {
tmp = (t - a) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.95e-25) or not (y <= 12000.0): 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 <= -1.95e-25) || !(y <= 12000.0)) 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 <= -1.95e-25) || ~((y <= 12000.0))) 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, -1.95e-25], N[Not[LessEqual[y, 12000.0]], $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 -1.95 \cdot 10^{-25} \lor \neg \left(y \leq 12000\right):\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b}\\
\end{array}
\end{array}
if y < -1.95e-25 or 12000 < y Initial program 58.6%
fma-define58.6%
+-commutative58.6%
fma-define58.6%
Simplified58.6%
Taylor expanded in y around inf 54.6%
mul-1-neg54.6%
unsub-neg54.6%
Simplified54.6%
if -1.95e-25 < y < 12000Initial program 76.1%
fma-define76.1%
+-commutative76.1%
fma-define76.1%
Simplified76.1%
Taylor expanded in y around 0 56.3%
Final simplification55.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -7.2e+18) (not (<= z 3.05e-56))) (/ a (- b)) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -7.2e+18) || !(z <= 3.05e-56)) {
tmp = a / -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 <= (-7.2d+18)) .or. (.not. (z <= 3.05d-56))) then
tmp = a / -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 <= -7.2e+18) || !(z <= 3.05e-56)) {
tmp = a / -b;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -7.2e+18) or not (z <= 3.05e-56): tmp = a / -b else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -7.2e+18) || !(z <= 3.05e-56)) tmp = Float64(a / Float64(-b)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -7.2e+18) || ~((z <= 3.05e-56))) tmp = a / -b; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -7.2e+18], N[Not[LessEqual[z, 3.05e-56]], $MachinePrecision]], N[(a / (-b)), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{+18} \lor \neg \left(z \leq 3.05 \cdot 10^{-56}\right):\\
\;\;\;\;\frac{a}{-b}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -7.2e18 or 3.0499999999999999e-56 < z Initial program 49.6%
fma-define49.6%
+-commutative49.6%
fma-define49.6%
Simplified49.6%
Taylor expanded in x around inf 45.3%
Taylor expanded in b around inf 44.4%
associate-/l*41.4%
associate--l+41.4%
Simplified41.4%
Taylor expanded in a around inf 28.2%
associate-*r/28.2%
mul-1-neg28.2%
Simplified28.2%
if -7.2e18 < z < 3.0499999999999999e-56Initial program 81.9%
fma-define81.9%
+-commutative81.9%
fma-define81.9%
Simplified81.9%
Taylor expanded in z around 0 51.0%
Final simplification39.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.05e-19) (not (<= z 1.05e-35))) (/ t b) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.05e-19) || !(z <= 1.05e-35)) {
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.05d-19)) .or. (.not. (z <= 1.05d-35))) 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.05e-19) || !(z <= 1.05e-35)) {
tmp = t / b;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.05e-19) or not (z <= 1.05e-35): tmp = t / b else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.05e-19) || !(z <= 1.05e-35)) 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.05e-19) || ~((z <= 1.05e-35))) tmp = t / b; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.05e-19], N[Not[LessEqual[z, 1.05e-35]], $MachinePrecision]], N[(t / b), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{-19} \lor \neg \left(z \leq 1.05 \cdot 10^{-35}\right):\\
\;\;\;\;\frac{t}{b}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.0499999999999999e-19 or 1.05e-35 < z Initial program 50.8%
fma-define50.7%
+-commutative50.7%
fma-define50.8%
Simplified50.8%
Taylor expanded in x around inf 46.7%
Taylor expanded in b around inf 40.9%
associate-/l*38.0%
associate--l+38.0%
Simplified38.0%
Taylor expanded in t around inf 22.1%
if -1.0499999999999999e-19 < z < 1.05e-35Initial program 83.0%
fma-define83.0%
+-commutative83.0%
fma-define83.0%
Simplified83.0%
Taylor expanded in z around 0 55.3%
Final simplification37.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 65.5%
fma-define65.5%
+-commutative65.5%
fma-define65.5%
Simplified65.5%
Taylor expanded in z around 0 27.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 2024163
(FPCore (x y z t a b)
:name "Development.Shake.Progress:decay from shake-0.15.5"
:precision binary64
:alt
(! :herbie-platform default (- (/ (+ (* z t) (* y x)) (+ y (* z (- b y)))) (/ a (+ (- b y) (/ y z)))))
(/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))