
(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 (+ b (- (/ y z) y)))
(t_3 (* z (- t a)))
(t_4 (/ (+ (* y x) t_3) t_1))
(t_5
(+ (/ t t_2) (- (* x (/ (/ 1.0 z) (+ (/ 1.0 z) -1.0))) (/ a t_2))))
(t_6 (+ (/ (* y x) t_1) (/ t_3 t_1))))
(if (<= t_4 (- INFINITY))
t_5
(if (<= t_4 -5e-297)
t_6
(if (<= t_4 0.0)
(* x (+ (/ (/ y z) t_2) (/ (/ (- t a) t_2) x)))
(if (<= t_4 1e+287) t_6 t_5))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (z * (b - y));
double t_2 = b + ((y / z) - y);
double t_3 = z * (t - a);
double t_4 = ((y * x) + t_3) / t_1;
double t_5 = (t / t_2) + ((x * ((1.0 / z) / ((1.0 / z) + -1.0))) - (a / t_2));
double t_6 = ((y * x) / t_1) + (t_3 / t_1);
double tmp;
if (t_4 <= -((double) INFINITY)) {
tmp = t_5;
} else if (t_4 <= -5e-297) {
tmp = t_6;
} else if (t_4 <= 0.0) {
tmp = x * (((y / z) / t_2) + (((t - a) / t_2) / x));
} else if (t_4 <= 1e+287) {
tmp = t_6;
} else {
tmp = t_5;
}
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 = b + ((y / z) - y);
double t_3 = z * (t - a);
double t_4 = ((y * x) + t_3) / t_1;
double t_5 = (t / t_2) + ((x * ((1.0 / z) / ((1.0 / z) + -1.0))) - (a / t_2));
double t_6 = ((y * x) / t_1) + (t_3 / t_1);
double tmp;
if (t_4 <= -Double.POSITIVE_INFINITY) {
tmp = t_5;
} else if (t_4 <= -5e-297) {
tmp = t_6;
} else if (t_4 <= 0.0) {
tmp = x * (((y / z) / t_2) + (((t - a) / t_2) / x));
} else if (t_4 <= 1e+287) {
tmp = t_6;
} else {
tmp = t_5;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (z * (b - y)) t_2 = b + ((y / z) - y) t_3 = z * (t - a) t_4 = ((y * x) + t_3) / t_1 t_5 = (t / t_2) + ((x * ((1.0 / z) / ((1.0 / z) + -1.0))) - (a / t_2)) t_6 = ((y * x) / t_1) + (t_3 / t_1) tmp = 0 if t_4 <= -math.inf: tmp = t_5 elif t_4 <= -5e-297: tmp = t_6 elif t_4 <= 0.0: tmp = x * (((y / z) / t_2) + (((t - a) / t_2) / x)) elif t_4 <= 1e+287: tmp = t_6 else: tmp = t_5 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(z * Float64(b - y))) t_2 = Float64(b + Float64(Float64(y / z) - y)) t_3 = Float64(z * Float64(t - a)) t_4 = Float64(Float64(Float64(y * x) + t_3) / t_1) t_5 = Float64(Float64(t / t_2) + Float64(Float64(x * Float64(Float64(1.0 / z) / Float64(Float64(1.0 / z) + -1.0))) - Float64(a / t_2))) t_6 = Float64(Float64(Float64(y * x) / t_1) + Float64(t_3 / t_1)) tmp = 0.0 if (t_4 <= Float64(-Inf)) tmp = t_5; elseif (t_4 <= -5e-297) tmp = t_6; elseif (t_4 <= 0.0) tmp = Float64(x * Float64(Float64(Float64(y / z) / t_2) + Float64(Float64(Float64(t - a) / t_2) / x))); elseif (t_4 <= 1e+287) tmp = t_6; else tmp = t_5; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (z * (b - y)); t_2 = b + ((y / z) - y); t_3 = z * (t - a); t_4 = ((y * x) + t_3) / t_1; t_5 = (t / t_2) + ((x * ((1.0 / z) / ((1.0 / z) + -1.0))) - (a / t_2)); t_6 = ((y * x) / t_1) + (t_3 / t_1); tmp = 0.0; if (t_4 <= -Inf) tmp = t_5; elseif (t_4 <= -5e-297) tmp = t_6; elseif (t_4 <= 0.0) tmp = x * (((y / z) / t_2) + (((t - a) / t_2) / x)); elseif (t_4 <= 1e+287) tmp = t_6; else tmp = t_5; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b + N[(N[(y / z), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(y * x), $MachinePrecision] + t$95$3), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$5 = N[(N[(t / t$95$2), $MachinePrecision] + N[(N[(x * N[(N[(1.0 / z), $MachinePrecision] / N[(N[(1.0 / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(N[(y * x), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(t$95$3 / t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, (-Infinity)], t$95$5, If[LessEqual[t$95$4, -5e-297], t$95$6, If[LessEqual[t$95$4, 0.0], N[(x * N[(N[(N[(y / z), $MachinePrecision] / t$95$2), $MachinePrecision] + N[(N[(N[(t - a), $MachinePrecision] / t$95$2), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, 1e+287], t$95$6, t$95$5]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + z \cdot \left(b - y\right)\\
t_2 := b + \left(\frac{y}{z} - y\right)\\
t_3 := z \cdot \left(t - a\right)\\
t_4 := \frac{y \cdot x + t\_3}{t\_1}\\
t_5 := \frac{t}{t\_2} + \left(x \cdot \frac{\frac{1}{z}}{\frac{1}{z} + -1} - \frac{a}{t\_2}\right)\\
t_6 := \frac{y \cdot x}{t\_1} + \frac{t\_3}{t\_1}\\
\mathbf{if}\;t\_4 \leq -\infty:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;t\_4 \leq -5 \cdot 10^{-297}:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;t\_4 \leq 0:\\
\;\;\;\;x \cdot \left(\frac{\frac{y}{z}}{t\_2} + \frac{\frac{t - a}{t\_2}}{x}\right)\\
\mathbf{elif}\;t\_4 \leq 10^{+287}:\\
\;\;\;\;t\_6\\
\mathbf{else}:\\
\;\;\;\;t\_5\\
\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 1.0000000000000001e287 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 20.7%
Taylor expanded in z around inf 19.9%
Taylor expanded in x around 0 66.4%
associate--l+66.4%
associate-+r-66.4%
associate-/l*79.1%
associate-/r*88.0%
associate-+r-88.0%
associate-+r-88.0%
Simplified88.0%
Taylor expanded in y around inf 93.5%
associate-/r*93.5%
sub-neg93.5%
metadata-eval93.5%
Simplified93.5%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -5e-297 or -0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 1.0000000000000001e287Initial program 99.5%
fma-define99.5%
+-commutative99.5%
fma-define99.5%
Simplified99.5%
Taylor expanded in x around 0 99.5%
if -5e-297 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -0.0Initial program 25.0%
Taylor expanded in z around inf 25.0%
Taylor expanded in x around -inf 84.4%
associate-*r*84.4%
mul-1-neg84.4%
mul-1-neg84.4%
unsub-neg84.4%
mul-1-neg84.4%
associate-/r*99.8%
associate-+r-99.8%
Simplified99.9%
Final simplification97.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (* z (- b y))))
(t_2 (+ b (- (/ y z) y)))
(t_3 (* z (- t a)))
(t_4 (/ (+ (* y x) t_3) t_1)))
(if (or (<= t_4 (- INFINITY))
(not
(or (<= t_4 -5e-297) (and (not (<= t_4 0.0)) (<= t_4 1e+287)))))
(* x (+ (/ (/ y z) t_2) (/ (/ (- t a) t_2) x)))
(+ (/ (* y x) t_1) (/ t_3 t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (z * (b - y));
double t_2 = b + ((y / z) - y);
double t_3 = z * (t - a);
double t_4 = ((y * x) + t_3) / t_1;
double tmp;
if ((t_4 <= -((double) INFINITY)) || !((t_4 <= -5e-297) || (!(t_4 <= 0.0) && (t_4 <= 1e+287)))) {
tmp = x * (((y / z) / t_2) + (((t - a) / t_2) / x));
} else {
tmp = ((y * x) / t_1) + (t_3 / t_1);
}
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 = b + ((y / z) - y);
double t_3 = z * (t - a);
double t_4 = ((y * x) + t_3) / t_1;
double tmp;
if ((t_4 <= -Double.POSITIVE_INFINITY) || !((t_4 <= -5e-297) || (!(t_4 <= 0.0) && (t_4 <= 1e+287)))) {
tmp = x * (((y / z) / t_2) + (((t - a) / t_2) / x));
} else {
tmp = ((y * x) / t_1) + (t_3 / t_1);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (z * (b - y)) t_2 = b + ((y / z) - y) t_3 = z * (t - a) t_4 = ((y * x) + t_3) / t_1 tmp = 0 if (t_4 <= -math.inf) or not ((t_4 <= -5e-297) or (not (t_4 <= 0.0) and (t_4 <= 1e+287))): tmp = x * (((y / z) / t_2) + (((t - a) / t_2) / x)) else: tmp = ((y * x) / t_1) + (t_3 / t_1) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(z * Float64(b - y))) t_2 = Float64(b + Float64(Float64(y / z) - y)) t_3 = Float64(z * Float64(t - a)) t_4 = Float64(Float64(Float64(y * x) + t_3) / t_1) tmp = 0.0 if ((t_4 <= Float64(-Inf)) || !((t_4 <= -5e-297) || (!(t_4 <= 0.0) && (t_4 <= 1e+287)))) tmp = Float64(x * Float64(Float64(Float64(y / z) / t_2) + Float64(Float64(Float64(t - a) / t_2) / x))); else tmp = Float64(Float64(Float64(y * x) / t_1) + Float64(t_3 / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (z * (b - y)); t_2 = b + ((y / z) - y); t_3 = z * (t - a); t_4 = ((y * x) + t_3) / t_1; tmp = 0.0; if ((t_4 <= -Inf) || ~(((t_4 <= -5e-297) || (~((t_4 <= 0.0)) && (t_4 <= 1e+287))))) tmp = x * (((y / z) / t_2) + (((t - a) / t_2) / x)); else tmp = ((y * x) / t_1) + (t_3 / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b + N[(N[(y / z), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(y * x), $MachinePrecision] + t$95$3), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[Or[LessEqual[t$95$4, (-Infinity)], N[Not[Or[LessEqual[t$95$4, -5e-297], And[N[Not[LessEqual[t$95$4, 0.0]], $MachinePrecision], LessEqual[t$95$4, 1e+287]]]], $MachinePrecision]], N[(x * N[(N[(N[(y / z), $MachinePrecision] / t$95$2), $MachinePrecision] + N[(N[(N[(t - a), $MachinePrecision] / t$95$2), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * x), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(t$95$3 / t$95$1), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + z \cdot \left(b - y\right)\\
t_2 := b + \left(\frac{y}{z} - y\right)\\
t_3 := z \cdot \left(t - a\right)\\
t_4 := \frac{y \cdot x + t\_3}{t\_1}\\
\mathbf{if}\;t\_4 \leq -\infty \lor \neg \left(t\_4 \leq -5 \cdot 10^{-297} \lor \neg \left(t\_4 \leq 0\right) \land t\_4 \leq 10^{+287}\right):\\
\;\;\;\;x \cdot \left(\frac{\frac{y}{z}}{t\_2} + \frac{\frac{t - a}{t\_2}}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{t\_1} + \frac{t\_3}{t\_1}\\
\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 -5e-297 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -0.0 or 1.0000000000000001e287 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 21.4%
Taylor expanded in z around inf 20.8%
Taylor expanded in x around -inf 72.8%
associate-*r*72.8%
mul-1-neg72.8%
mul-1-neg72.8%
unsub-neg72.8%
mul-1-neg72.8%
associate-/r*82.7%
associate-+r-82.7%
Simplified82.8%
if -inf.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -5e-297 or -0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 1.0000000000000001e287Initial program 99.5%
fma-define99.5%
+-commutative99.5%
fma-define99.5%
Simplified99.5%
Taylor expanded in x around 0 99.5%
Final simplification93.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ b (- (/ y z) y))) (t_2 (/ t t_1)))
(if (or (<= y -1.5e+123) (not (<= y 29000000.0)))
(+ t_2 (- (* x (/ (/ 1.0 z) (+ (/ 1.0 z) -1.0))) (/ a t_1)))
(+ t_2 (+ (* x (/ (/ y z) t_1)) (/ a (- (- y (/ y z)) b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b + ((y / z) - y);
double t_2 = t / t_1;
double tmp;
if ((y <= -1.5e+123) || !(y <= 29000000.0)) {
tmp = t_2 + ((x * ((1.0 / z) / ((1.0 / z) + -1.0))) - (a / t_1));
} else {
tmp = t_2 + ((x * ((y / z) / t_1)) + (a / ((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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = b + ((y / z) - y)
t_2 = t / t_1
if ((y <= (-1.5d+123)) .or. (.not. (y <= 29000000.0d0))) then
tmp = t_2 + ((x * ((1.0d0 / z) / ((1.0d0 / z) + (-1.0d0)))) - (a / t_1))
else
tmp = t_2 + ((x * ((y / z) / t_1)) + (a / ((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 t_1 = b + ((y / z) - y);
double t_2 = t / t_1;
double tmp;
if ((y <= -1.5e+123) || !(y <= 29000000.0)) {
tmp = t_2 + ((x * ((1.0 / z) / ((1.0 / z) + -1.0))) - (a / t_1));
} else {
tmp = t_2 + ((x * ((y / z) / t_1)) + (a / ((y - (y / z)) - b)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b + ((y / z) - y) t_2 = t / t_1 tmp = 0 if (y <= -1.5e+123) or not (y <= 29000000.0): tmp = t_2 + ((x * ((1.0 / z) / ((1.0 / z) + -1.0))) - (a / t_1)) else: tmp = t_2 + ((x * ((y / z) / t_1)) + (a / ((y - (y / z)) - b))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b + Float64(Float64(y / z) - y)) t_2 = Float64(t / t_1) tmp = 0.0 if ((y <= -1.5e+123) || !(y <= 29000000.0)) tmp = Float64(t_2 + Float64(Float64(x * Float64(Float64(1.0 / z) / Float64(Float64(1.0 / z) + -1.0))) - Float64(a / t_1))); else tmp = Float64(t_2 + Float64(Float64(x * Float64(Float64(y / z) / t_1)) + Float64(a / Float64(Float64(y - Float64(y / z)) - b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b + ((y / z) - y); t_2 = t / t_1; tmp = 0.0; if ((y <= -1.5e+123) || ~((y <= 29000000.0))) tmp = t_2 + ((x * ((1.0 / z) / ((1.0 / z) + -1.0))) - (a / t_1)); else tmp = t_2 + ((x * ((y / z) / t_1)) + (a / ((y - (y / z)) - b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b + N[(N[(y / z), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t / t$95$1), $MachinePrecision]}, If[Or[LessEqual[y, -1.5e+123], N[Not[LessEqual[y, 29000000.0]], $MachinePrecision]], N[(t$95$2 + N[(N[(x * N[(N[(1.0 / z), $MachinePrecision] / N[(N[(1.0 / z), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 + N[(N[(x * N[(N[(y / z), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(a / N[(N[(y - N[(y / z), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b + \left(\frac{y}{z} - y\right)\\
t_2 := \frac{t}{t\_1}\\
\mathbf{if}\;y \leq -1.5 \cdot 10^{+123} \lor \neg \left(y \leq 29000000\right):\\
\;\;\;\;t\_2 + \left(x \cdot \frac{\frac{1}{z}}{\frac{1}{z} + -1} - \frac{a}{t\_1}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 + \left(x \cdot \frac{\frac{y}{z}}{t\_1} + \frac{a}{\left(y - \frac{y}{z}\right) - b}\right)\\
\end{array}
\end{array}
if y < -1.50000000000000004e123 or 2.9e7 < y Initial program 60.8%
Taylor expanded in z around inf 39.6%
Taylor expanded in x around 0 51.9%
associate--l+51.9%
associate-+r-51.9%
associate-/l*60.1%
associate-/r*68.5%
associate-+r-68.5%
associate-+r-68.5%
Simplified68.5%
Taylor expanded in y around inf 91.4%
associate-/r*91.5%
sub-neg91.5%
metadata-eval91.5%
Simplified91.5%
if -1.50000000000000004e123 < y < 2.9e7Initial program 77.8%
Taylor expanded in z around inf 77.2%
Taylor expanded in x around 0 98.0%
associate--l+98.0%
associate-+r-98.0%
associate-/l*98.6%
associate-/r*98.6%
associate-+r-98.6%
associate-+r-98.6%
Simplified98.6%
Final simplification95.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (* z (- b y)))))
(if (or (<= z -6.2e+65) (not (<= z 5.8e+45)))
(/ (- t a) (- b y))
(+ (/ (* y x) t_1) (/ (* z (- t a)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (z * (b - y));
double tmp;
if ((z <= -6.2e+65) || !(z <= 5.8e+45)) {
tmp = (t - a) / (b - y);
} else {
tmp = ((y * x) / t_1) + ((z * (t - a)) / t_1);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = y + (z * (b - y))
if ((z <= (-6.2d+65)) .or. (.not. (z <= 5.8d+45))) then
tmp = (t - a) / (b - y)
else
tmp = ((y * x) / t_1) + ((z * (t - a)) / t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (z * (b - y));
double tmp;
if ((z <= -6.2e+65) || !(z <= 5.8e+45)) {
tmp = (t - a) / (b - y);
} else {
tmp = ((y * x) / t_1) + ((z * (t - a)) / t_1);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (z * (b - y)) tmp = 0 if (z <= -6.2e+65) or not (z <= 5.8e+45): tmp = (t - a) / (b - y) else: tmp = ((y * x) / t_1) + ((z * (t - a)) / t_1) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(z * Float64(b - y))) tmp = 0.0 if ((z <= -6.2e+65) || !(z <= 5.8e+45)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(Float64(Float64(y * x) / t_1) + Float64(Float64(z * Float64(t - a)) / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (z * (b - y)); tmp = 0.0; if ((z <= -6.2e+65) || ~((z <= 5.8e+45))) tmp = (t - a) / (b - y); else tmp = ((y * x) / t_1) + ((z * (t - a)) / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[z, -6.2e+65], N[Not[LessEqual[z, 5.8e+45]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * x), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + z \cdot \left(b - y\right)\\
\mathbf{if}\;z \leq -6.2 \cdot 10^{+65} \lor \neg \left(z \leq 5.8 \cdot 10^{+45}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{t\_1} + \frac{z \cdot \left(t - a\right)}{t\_1}\\
\end{array}
\end{array}
if z < -6.19999999999999981e65 or 5.7999999999999994e45 < z Initial program 45.2%
fma-define45.2%
+-commutative45.2%
fma-define45.2%
Simplified45.2%
Taylor expanded in z around inf 84.3%
if -6.19999999999999981e65 < z < 5.7999999999999994e45Initial program 87.7%
fma-define87.7%
+-commutative87.7%
fma-define87.7%
Simplified87.7%
Taylor expanded in x around 0 87.7%
Final simplification86.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (- 1.0 z))))
(if (<= y -7.9e+121)
t_1
(if (<= y 8e+20)
(/ (- t a) (- (+ b (/ y z)) y))
(if (<= y 9.5e+106)
(/ (- (* z (- a t)) (* y x)) (* y (+ z -1.0)))
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 <= -7.9e+121) {
tmp = t_1;
} else if (y <= 8e+20) {
tmp = (t - a) / ((b + (y / z)) - y);
} else if (y <= 9.5e+106) {
tmp = ((z * (a - t)) - (y * x)) / (y * (z + -1.0));
} 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 <= (-7.9d+121)) then
tmp = t_1
else if (y <= 8d+20) then
tmp = (t - a) / ((b + (y / z)) - y)
else if (y <= 9.5d+106) then
tmp = ((z * (a - t)) - (y * x)) / (y * (z + (-1.0d0)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (1.0 - z);
double tmp;
if (y <= -7.9e+121) {
tmp = t_1;
} else if (y <= 8e+20) {
tmp = (t - a) / ((b + (y / z)) - y);
} else if (y <= 9.5e+106) {
tmp = ((z * (a - t)) - (y * x)) / (y * (z + -1.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (1.0 - z) tmp = 0 if y <= -7.9e+121: tmp = t_1 elif y <= 8e+20: tmp = (t - a) / ((b + (y / z)) - y) elif y <= 9.5e+106: tmp = ((z * (a - t)) - (y * x)) / (y * (z + -1.0)) 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 <= -7.9e+121) tmp = t_1; elseif (y <= 8e+20) tmp = Float64(Float64(t - a) / Float64(Float64(b + Float64(y / z)) - y)); elseif (y <= 9.5e+106) tmp = Float64(Float64(Float64(z * Float64(a - t)) - Float64(y * x)) / Float64(y * Float64(z + -1.0))); 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 <= -7.9e+121) tmp = t_1; elseif (y <= 8e+20) tmp = (t - a) / ((b + (y / z)) - y); elseif (y <= 9.5e+106) tmp = ((z * (a - t)) - (y * x)) / (y * (z + -1.0)); 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, -7.9e+121], t$95$1, If[LessEqual[y, 8e+20], N[(N[(t - a), $MachinePrecision] / N[(N[(b + N[(y / z), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.5e+106], N[(N[(N[(z * N[(a - t), $MachinePrecision]), $MachinePrecision] - N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(y * N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{1 - z}\\
\mathbf{if}\;y \leq -7.9 \cdot 10^{+121}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 8 \cdot 10^{+20}:\\
\;\;\;\;\frac{t - a}{\left(b + \frac{y}{z}\right) - y}\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{+106}:\\
\;\;\;\;\frac{z \cdot \left(a - t\right) - y \cdot x}{y \cdot \left(z + -1\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -7.9e121 or 9.4999999999999995e106 < y Initial program 51.0%
fma-define51.0%
+-commutative51.0%
fma-define51.1%
Simplified51.1%
Taylor expanded in y around inf 67.4%
mul-1-neg67.4%
unsub-neg67.4%
Simplified67.4%
if -7.9e121 < y < 8e20Initial program 77.9%
Taylor expanded in z around inf 77.3%
Taylor expanded in x around 0 79.4%
if 8e20 < y < 9.4999999999999995e106Initial program 85.4%
Taylor expanded in y around inf 85.3%
mul-1-neg85.3%
unsub-neg85.3%
Simplified85.3%
Final simplification76.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (- 1.0 z))))
(if (<= y -1.8e+121)
t_1
(if (<= y -8e+86)
(/ a (- y b))
(if (<= y 2.5e-94)
(/ (- t a) b)
(if (<= y 7e+155) (+ x (/ (* t z) y)) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (1.0 - z);
double tmp;
if (y <= -1.8e+121) {
tmp = t_1;
} else if (y <= -8e+86) {
tmp = a / (y - b);
} else if (y <= 2.5e-94) {
tmp = (t - a) / b;
} else if (y <= 7e+155) {
tmp = x + ((t * z) / y);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x / (1.0d0 - z)
if (y <= (-1.8d+121)) then
tmp = t_1
else if (y <= (-8d+86)) then
tmp = a / (y - b)
else if (y <= 2.5d-94) then
tmp = (t - a) / b
else if (y <= 7d+155) then
tmp = x + ((t * z) / y)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (1.0 - z);
double tmp;
if (y <= -1.8e+121) {
tmp = t_1;
} else if (y <= -8e+86) {
tmp = a / (y - b);
} else if (y <= 2.5e-94) {
tmp = (t - a) / b;
} else if (y <= 7e+155) {
tmp = x + ((t * z) / y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (1.0 - z) tmp = 0 if y <= -1.8e+121: tmp = t_1 elif y <= -8e+86: tmp = a / (y - b) elif y <= 2.5e-94: tmp = (t - a) / b elif y <= 7e+155: tmp = x + ((t * z) / y) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(1.0 - z)) tmp = 0.0 if (y <= -1.8e+121) tmp = t_1; elseif (y <= -8e+86) tmp = Float64(a / Float64(y - b)); elseif (y <= 2.5e-94) tmp = Float64(Float64(t - a) / b); elseif (y <= 7e+155) tmp = Float64(x + Float64(Float64(t * z) / y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x / (1.0 - z); tmp = 0.0; if (y <= -1.8e+121) tmp = t_1; elseif (y <= -8e+86) tmp = a / (y - b); elseif (y <= 2.5e-94) tmp = (t - a) / b; elseif (y <= 7e+155) tmp = x + ((t * z) / y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.8e+121], t$95$1, If[LessEqual[y, -8e+86], N[(a / N[(y - b), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.5e-94], N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[y, 7e+155], N[(x + N[(N[(t * z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{1 - z}\\
\mathbf{if}\;y \leq -1.8 \cdot 10^{+121}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -8 \cdot 10^{+86}:\\
\;\;\;\;\frac{a}{y - b}\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{-94}:\\
\;\;\;\;\frac{t - a}{b}\\
\mathbf{elif}\;y \leq 7 \cdot 10^{+155}:\\
\;\;\;\;x + \frac{t \cdot z}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.79999999999999991e121 or 6.99999999999999969e155 < y Initial program 49.2%
fma-define49.2%
+-commutative49.2%
fma-define49.3%
Simplified49.3%
Taylor expanded in y around inf 70.0%
mul-1-neg70.0%
unsub-neg70.0%
Simplified70.0%
if -1.79999999999999991e121 < y < -8.0000000000000001e86Initial program 46.5%
Taylor expanded in z around inf 46.5%
Taylor expanded in x around 0 88.6%
Taylor expanded in t around 0 77.7%
neg-mul-177.7%
Simplified77.7%
Taylor expanded in z around inf 67.3%
associate-*r/67.3%
neg-mul-167.3%
Simplified67.3%
if -8.0000000000000001e86 < y < 2.4999999999999998e-94Initial program 79.7%
fma-define79.7%
+-commutative79.7%
fma-define79.7%
Simplified79.7%
Taylor expanded in y around 0 57.5%
if 2.4999999999999998e-94 < y < 6.99999999999999969e155Initial program 79.3%
Taylor expanded in z around 0 44.3%
Taylor expanded in x around 0 51.0%
Taylor expanded in t around inf 48.2%
*-commutative48.2%
Simplified48.2%
Final simplification58.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.15e+66) (not (<= z 1.9e+46))) (/ (- t a) (- b y)) (/ (+ (* y x) (* 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.15e+66) || !(z <= 1.9e+46)) {
tmp = (t - a) / (b - y);
} else {
tmp = ((y * x) + (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.15d+66)) .or. (.not. (z <= 1.9d+46))) then
tmp = (t - a) / (b - y)
else
tmp = ((y * x) + (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.15e+66) || !(z <= 1.9e+46)) {
tmp = (t - a) / (b - y);
} else {
tmp = ((y * x) + (z * (t - a))) / (y + (z * (b - y)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.15e+66) or not (z <= 1.9e+46): tmp = (t - a) / (b - y) else: tmp = ((y * x) + (z * (t - a))) / (y + (z * (b - y))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.15e+66) || !(z <= 1.9e+46)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(Float64(Float64(y * x) + 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.15e+66) || ~((z <= 1.9e+46))) tmp = (t - a) / (b - y); else tmp = ((y * x) + (z * (t - a))) / (y + (z * (b - y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.15e+66], N[Not[LessEqual[z, 1.9e+46]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * x), $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.15 \cdot 10^{+66} \lor \neg \left(z \leq 1.9 \cdot 10^{+46}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
\end{array}
\end{array}
if z < -1.15e66 or 1.9e46 < z Initial program 45.2%
fma-define45.2%
+-commutative45.2%
fma-define45.2%
Simplified45.2%
Taylor expanded in z around inf 84.3%
if -1.15e66 < z < 1.9e46Initial program 87.7%
Final simplification86.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ a (- y b))) (t_2 (/ x (- 1.0 z))))
(if (<= y -2.95e+121)
t_2
(if (<= y -2.85e+81)
t_1
(if (<= y 1e-30) (/ (- t a) b) (if (<= y 5e+21) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a / (y - b);
double t_2 = x / (1.0 - z);
double tmp;
if (y <= -2.95e+121) {
tmp = t_2;
} else if (y <= -2.85e+81) {
tmp = t_1;
} else if (y <= 1e-30) {
tmp = (t - a) / b;
} else if (y <= 5e+21) {
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 = a / (y - b)
t_2 = x / (1.0d0 - z)
if (y <= (-2.95d+121)) then
tmp = t_2
else if (y <= (-2.85d+81)) then
tmp = t_1
else if (y <= 1d-30) then
tmp = (t - a) / b
else if (y <= 5d+21) 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 = a / (y - b);
double t_2 = x / (1.0 - z);
double tmp;
if (y <= -2.95e+121) {
tmp = t_2;
} else if (y <= -2.85e+81) {
tmp = t_1;
} else if (y <= 1e-30) {
tmp = (t - a) / b;
} else if (y <= 5e+21) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a / (y - b) t_2 = x / (1.0 - z) tmp = 0 if y <= -2.95e+121: tmp = t_2 elif y <= -2.85e+81: tmp = t_1 elif y <= 1e-30: tmp = (t - a) / b elif y <= 5e+21: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a / Float64(y - b)) t_2 = Float64(x / Float64(1.0 - z)) tmp = 0.0 if (y <= -2.95e+121) tmp = t_2; elseif (y <= -2.85e+81) tmp = t_1; elseif (y <= 1e-30) tmp = Float64(Float64(t - a) / b); elseif (y <= 5e+21) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a / (y - b); t_2 = x / (1.0 - z); tmp = 0.0; if (y <= -2.95e+121) tmp = t_2; elseif (y <= -2.85e+81) tmp = t_1; elseif (y <= 1e-30) tmp = (t - a) / b; elseif (y <= 5e+21) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a / N[(y - b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.95e+121], t$95$2, If[LessEqual[y, -2.85e+81], t$95$1, If[LessEqual[y, 1e-30], N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[y, 5e+21], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a}{y - b}\\
t_2 := \frac{x}{1 - z}\\
\mathbf{if}\;y \leq -2.95 \cdot 10^{+121}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -2.85 \cdot 10^{+81}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 10^{-30}:\\
\;\;\;\;\frac{t - a}{b}\\
\mathbf{elif}\;y \leq 5 \cdot 10^{+21}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -2.95000000000000007e121 or 5e21 < y Initial program 60.3%
fma-define60.3%
+-commutative60.3%
fma-define60.3%
Simplified60.3%
Taylor expanded in y around inf 60.2%
mul-1-neg60.2%
unsub-neg60.2%
Simplified60.2%
if -2.95000000000000007e121 < y < -2.85000000000000017e81 or 1e-30 < y < 5e21Initial program 63.5%
Taylor expanded in z around inf 63.5%
Taylor expanded in x around 0 90.4%
Taylor expanded in t around 0 81.4%
neg-mul-181.4%
Simplified81.4%
Taylor expanded in z around inf 67.1%
associate-*r/67.1%
neg-mul-167.1%
Simplified67.1%
if -2.85000000000000017e81 < y < 1e-30Initial program 80.2%
fma-define80.2%
+-commutative80.2%
fma-define80.2%
Simplified80.2%
Taylor expanded in y around 0 55.8%
Final simplification58.4%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -2.3e+19)
(/ (- t a) (- b y))
(if (<= z 6.8e-19)
(/ (+ (* y x) (* z (- t a))) (+ y (* b z)))
(/ (- t a) (- (+ b (/ y z)) y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2.3e+19) {
tmp = (t - a) / (b - y);
} else if (z <= 6.8e-19) {
tmp = ((y * x) + (z * (t - a))) / (y + (b * z));
} else {
tmp = (t - a) / ((b + (y / z)) - 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 <= (-2.3d+19)) then
tmp = (t - a) / (b - y)
else if (z <= 6.8d-19) then
tmp = ((y * x) + (z * (t - a))) / (y + (b * z))
else
tmp = (t - a) / ((b + (y / z)) - 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 <= -2.3e+19) {
tmp = (t - a) / (b - y);
} else if (z <= 6.8e-19) {
tmp = ((y * x) + (z * (t - a))) / (y + (b * z));
} else {
tmp = (t - a) / ((b + (y / z)) - y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -2.3e+19: tmp = (t - a) / (b - y) elif z <= 6.8e-19: tmp = ((y * x) + (z * (t - a))) / (y + (b * z)) else: tmp = (t - a) / ((b + (y / z)) - y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2.3e+19) tmp = Float64(Float64(t - a) / Float64(b - y)); elseif (z <= 6.8e-19) tmp = Float64(Float64(Float64(y * x) + Float64(z * Float64(t - a))) / Float64(y + Float64(b * z))); else tmp = Float64(Float64(t - a) / Float64(Float64(b + Float64(y / z)) - y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -2.3e+19) tmp = (t - a) / (b - y); elseif (z <= 6.8e-19) tmp = ((y * x) + (z * (t - a))) / (y + (b * z)); else tmp = (t - a) / ((b + (y / z)) - y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2.3e+19], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.8e-19], N[(N[(N[(y * x), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t - a), $MachinePrecision] / N[(N[(b + N[(y / z), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.3 \cdot 10^{+19}:\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{-19}:\\
\;\;\;\;\frac{y \cdot x + z \cdot \left(t - a\right)}{y + b \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{\left(b + \frac{y}{z}\right) - y}\\
\end{array}
\end{array}
if z < -2.3e19Initial program 52.2%
fma-define52.2%
+-commutative52.2%
fma-define52.2%
Simplified52.2%
Taylor expanded in z around inf 84.6%
if -2.3e19 < z < 6.8000000000000004e-19Initial program 87.7%
Taylor expanded in b around inf 85.7%
*-commutative85.7%
Simplified85.7%
if 6.8000000000000004e-19 < z Initial program 54.6%
Taylor expanded in z around inf 54.7%
Taylor expanded in x around 0 81.0%
Final simplification84.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -7.5e-18) (not (<= z 2.8e-40))) (/ (- t a) (- (+ b (/ y z)) y)) (- x (/ (* z (- a t)) y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -7.5e-18) || !(z <= 2.8e-40)) {
tmp = (t - a) / ((b + (y / z)) - y);
} else {
tmp = x - ((z * (a - t)) / 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 <= (-7.5d-18)) .or. (.not. (z <= 2.8d-40))) then
tmp = (t - a) / ((b + (y / z)) - y)
else
tmp = x - ((z * (a - t)) / 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 <= -7.5e-18) || !(z <= 2.8e-40)) {
tmp = (t - a) / ((b + (y / z)) - y);
} else {
tmp = x - ((z * (a - t)) / y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -7.5e-18) or not (z <= 2.8e-40): tmp = (t - a) / ((b + (y / z)) - y) else: tmp = x - ((z * (a - t)) / y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -7.5e-18) || !(z <= 2.8e-40)) tmp = Float64(Float64(t - a) / Float64(Float64(b + Float64(y / z)) - y)); else tmp = Float64(x - Float64(Float64(z * Float64(a - t)) / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -7.5e-18) || ~((z <= 2.8e-40))) tmp = (t - a) / ((b + (y / z)) - y); else tmp = x - ((z * (a - t)) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -7.5e-18], N[Not[LessEqual[z, 2.8e-40]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(N[(b + N[(y / z), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(z * N[(a - t), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{-18} \lor \neg \left(z \leq 2.8 \cdot 10^{-40}\right):\\
\;\;\;\;\frac{t - a}{\left(b + \frac{y}{z}\right) - y}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{z \cdot \left(a - t\right)}{y}\\
\end{array}
\end{array}
if z < -7.50000000000000015e-18 or 2.8e-40 < z Initial program 57.0%
Taylor expanded in z around inf 57.0%
Taylor expanded in x around 0 80.6%
if -7.50000000000000015e-18 < z < 2.8e-40Initial program 87.3%
Taylor expanded in z around 0 58.0%
Taylor expanded in x around 0 68.2%
Final simplification74.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (- 1.0 z))))
(if (<= y -7e+96)
t_1
(if (<= y -1.05e-239) (/ t b) (if (<= y 1.45e-51) (/ 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 <= -7e+96) {
tmp = t_1;
} else if (y <= -1.05e-239) {
tmp = t / b;
} else if (y <= 1.45e-51) {
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 <= (-7d+96)) then
tmp = t_1
else if (y <= (-1.05d-239)) then
tmp = t / b
else if (y <= 1.45d-51) 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 <= -7e+96) {
tmp = t_1;
} else if (y <= -1.05e-239) {
tmp = t / b;
} else if (y <= 1.45e-51) {
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 <= -7e+96: tmp = t_1 elif y <= -1.05e-239: tmp = t / b elif y <= 1.45e-51: 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 <= -7e+96) tmp = t_1; elseif (y <= -1.05e-239) tmp = Float64(t / b); elseif (y <= 1.45e-51) 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 <= -7e+96) tmp = t_1; elseif (y <= -1.05e-239) tmp = t / b; elseif (y <= 1.45e-51) 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, -7e+96], t$95$1, If[LessEqual[y, -1.05e-239], N[(t / b), $MachinePrecision], If[LessEqual[y, 1.45e-51], N[(a / (-b)), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{1 - z}\\
\mathbf{if}\;y \leq -7 \cdot 10^{+96}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1.05 \cdot 10^{-239}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;y \leq 1.45 \cdot 10^{-51}:\\
\;\;\;\;\frac{a}{-b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -6.9999999999999998e96 or 1.44999999999999986e-51 < y Initial program 62.2%
fma-define62.2%
+-commutative62.2%
fma-define62.2%
Simplified62.2%
Taylor expanded in y around inf 52.1%
mul-1-neg52.1%
unsub-neg52.1%
Simplified52.1%
if -6.9999999999999998e96 < y < -1.0500000000000001e-239Initial program 71.1%
fma-define71.1%
+-commutative71.1%
fma-define71.1%
Simplified71.1%
Taylor expanded in z around inf 67.1%
associate--l+67.1%
associate-/l*65.7%
Simplified65.7%
Taylor expanded in b around inf 62.4%
Taylor expanded in t around inf 37.5%
if -1.0500000000000001e-239 < y < 1.44999999999999986e-51Initial program 87.1%
Taylor expanded in z around inf 87.1%
Taylor expanded in x around 0 79.7%
Taylor expanded in t around 0 38.4%
neg-mul-138.4%
Simplified38.4%
Taylor expanded in b around inf 35.5%
associate-*r/35.5%
neg-mul-135.5%
Simplified35.5%
Final simplification43.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -5.0) (not (<= z 1.65e-20))) (/ (- t a) (- b y)) (- x (/ (* z (- a t)) y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -5.0) || !(z <= 1.65e-20)) {
tmp = (t - a) / (b - y);
} else {
tmp = x - ((z * (a - t)) / 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.0d0)) .or. (.not. (z <= 1.65d-20))) then
tmp = (t - a) / (b - y)
else
tmp = x - ((z * (a - t)) / 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.0) || !(z <= 1.65e-20)) {
tmp = (t - a) / (b - y);
} else {
tmp = x - ((z * (a - t)) / y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -5.0) or not (z <= 1.65e-20): tmp = (t - a) / (b - y) else: tmp = x - ((z * (a - t)) / y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -5.0) || !(z <= 1.65e-20)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(x - Float64(Float64(z * Float64(a - t)) / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -5.0) || ~((z <= 1.65e-20))) tmp = (t - a) / (b - y); else tmp = x - ((z * (a - t)) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -5.0], N[Not[LessEqual[z, 1.65e-20]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(z * N[(a - t), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \lor \neg \left(z \leq 1.65 \cdot 10^{-20}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{z \cdot \left(a - t\right)}{y}\\
\end{array}
\end{array}
if z < -5 or 1.65e-20 < z Initial program 55.0%
fma-define55.0%
+-commutative55.0%
fma-define55.0%
Simplified55.0%
Taylor expanded in z around inf 78.5%
if -5 < z < 1.65e-20Initial program 87.9%
Taylor expanded in z around 0 58.9%
Taylor expanded in x around 0 68.6%
Final simplification73.5%
(FPCore (x y z t a b) :precision binary64 (if (<= y -2.5e+81) x (if (<= y -1.5e-239) (/ t b) (if (<= y 7e+17) (/ a (- b)) x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.5e+81) {
tmp = x;
} else if (y <= -1.5e-239) {
tmp = t / b;
} else if (y <= 7e+17) {
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 (y <= (-2.5d+81)) then
tmp = x
else if (y <= (-1.5d-239)) then
tmp = t / b
else if (y <= 7d+17) 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 (y <= -2.5e+81) {
tmp = x;
} else if (y <= -1.5e-239) {
tmp = t / b;
} else if (y <= 7e+17) {
tmp = a / -b;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2.5e+81: tmp = x elif y <= -1.5e-239: tmp = t / b elif y <= 7e+17: tmp = a / -b else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.5e+81) tmp = x; elseif (y <= -1.5e-239) tmp = Float64(t / b); elseif (y <= 7e+17) 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 (y <= -2.5e+81) tmp = x; elseif (y <= -1.5e-239) tmp = t / b; elseif (y <= 7e+17) tmp = a / -b; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.5e+81], x, If[LessEqual[y, -1.5e-239], N[(t / b), $MachinePrecision], If[LessEqual[y, 7e+17], N[(a / (-b)), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{+81}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -1.5 \cdot 10^{-239}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;y \leq 7 \cdot 10^{+17}:\\
\;\;\;\;\frac{a}{-b}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -2.4999999999999999e81 or 7e17 < y Initial program 59.5%
fma-define59.5%
+-commutative59.5%
fma-define59.5%
Simplified59.5%
Taylor expanded in z around 0 38.8%
if -2.4999999999999999e81 < y < -1.4999999999999999e-239Initial program 72.9%
fma-define72.9%
+-commutative72.9%
fma-define72.9%
Simplified72.9%
Taylor expanded in z around inf 68.9%
associate--l+68.9%
associate-/l*67.4%
Simplified67.4%
Taylor expanded in b around inf 64.1%
Taylor expanded in t around inf 38.4%
if -1.4999999999999999e-239 < y < 7e17Initial program 85.5%
Taylor expanded in z around inf 85.5%
Taylor expanded in x around 0 80.3%
Taylor expanded in t around 0 43.9%
neg-mul-143.9%
Simplified43.9%
Taylor expanded in b around inf 33.1%
associate-*r/33.1%
neg-mul-133.1%
Simplified33.1%
Final simplification36.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -5.0) (not (<= z 9.5e-20))) (/ (- t a) (- b y)) (+ x (/ (* t z) y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -5.0) || !(z <= 9.5e-20)) {
tmp = (t - a) / (b - y);
} else {
tmp = x + ((t * z) / 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.0d0)) .or. (.not. (z <= 9.5d-20))) then
tmp = (t - a) / (b - y)
else
tmp = x + ((t * z) / 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.0) || !(z <= 9.5e-20)) {
tmp = (t - a) / (b - y);
} else {
tmp = x + ((t * z) / y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -5.0) or not (z <= 9.5e-20): tmp = (t - a) / (b - y) else: tmp = x + ((t * z) / y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -5.0) || !(z <= 9.5e-20)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(x + Float64(Float64(t * z) / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -5.0) || ~((z <= 9.5e-20))) tmp = (t - a) / (b - y); else tmp = x + ((t * z) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -5.0], N[Not[LessEqual[z, 9.5e-20]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t * z), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \lor \neg \left(z \leq 9.5 \cdot 10^{-20}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t \cdot z}{y}\\
\end{array}
\end{array}
if z < -5 or 9.5e-20 < z Initial program 55.0%
fma-define55.0%
+-commutative55.0%
fma-define55.0%
Simplified55.0%
Taylor expanded in z around inf 78.5%
if -5 < z < 9.5e-20Initial program 87.9%
Taylor expanded in z around 0 58.9%
Taylor expanded in x around 0 68.6%
Taylor expanded in t around inf 58.1%
*-commutative58.1%
Simplified58.1%
Final simplification68.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.15e+103) (not (<= y 1.8e-40))) (/ 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 <= -2.15e+103) || !(y <= 1.8e-40)) {
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 <= (-2.15d+103)) .or. (.not. (y <= 1.8d-40))) 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 <= -2.15e+103) || !(y <= 1.8e-40)) {
tmp = x / (1.0 - z);
} else {
tmp = (t - a) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.15e+103) or not (y <= 1.8e-40): 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 <= -2.15e+103) || !(y <= 1.8e-40)) 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 <= -2.15e+103) || ~((y <= 1.8e-40))) 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, -2.15e+103], N[Not[LessEqual[y, 1.8e-40]], $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 -2.15 \cdot 10^{+103} \lor \neg \left(y \leq 1.8 \cdot 10^{-40}\right):\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b}\\
\end{array}
\end{array}
if y < -2.14999999999999984e103 or 1.8e-40 < y Initial program 62.4%
fma-define62.4%
+-commutative62.4%
fma-define62.4%
Simplified62.4%
Taylor expanded in y around inf 52.9%
mul-1-neg52.9%
unsub-neg52.9%
Simplified52.9%
if -2.14999999999999984e103 < y < 1.8e-40Initial program 78.6%
fma-define78.6%
+-commutative78.6%
fma-define78.6%
Simplified78.6%
Taylor expanded in y around 0 54.9%
Final simplification54.0%
(FPCore (x y z t a b) :precision binary64 (if (<= y -2.5e+81) x (if (<= y 3.05e-52) (/ t b) x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.5e+81) {
tmp = x;
} else if (y <= 3.05e-52) {
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 (y <= (-2.5d+81)) then
tmp = x
else if (y <= 3.05d-52) 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 (y <= -2.5e+81) {
tmp = x;
} else if (y <= 3.05e-52) {
tmp = t / b;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2.5e+81: tmp = x elif y <= 3.05e-52: tmp = t / b else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.5e+81) tmp = x; elseif (y <= 3.05e-52) 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 (y <= -2.5e+81) tmp = x; elseif (y <= 3.05e-52) tmp = t / b; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.5e+81], x, If[LessEqual[y, 3.05e-52], N[(t / b), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{+81}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 3.05 \cdot 10^{-52}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -2.4999999999999999e81 or 3.04999999999999995e-52 < y Initial program 61.2%
fma-define61.2%
+-commutative61.2%
fma-define61.2%
Simplified61.2%
Taylor expanded in z around 0 36.8%
if -2.4999999999999999e81 < y < 3.04999999999999995e-52Initial program 80.1%
fma-define80.1%
+-commutative80.1%
fma-define80.1%
Simplified80.1%
Taylor expanded in z around inf 78.0%
associate--l+78.0%
associate-/l*77.3%
Simplified77.3%
Taylor expanded in b around inf 67.8%
Taylor expanded in t around inf 32.6%
(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 71.4%
fma-define71.4%
+-commutative71.4%
fma-define71.5%
Simplified71.5%
Taylor expanded in z around 0 22.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 2024165
(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)))))