
(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 13 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 (pow (- b y) 2.0)) (t_2 (/ (- t a) (- b y))))
(if (<= z -27000.0)
(+ (/ (+ (* x (/ y (- b y))) (* y (/ (- a t) t_1))) z) t_2)
(if (<= z 4.4e+29)
(/ (fma x y (* z (- t a))) (fma z (- b y) y))
(+ (+ t_2 (* (/ y z) (/ x (- b y)))) (* y (/ (- a t) (* z t_1))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = pow((b - y), 2.0);
double t_2 = (t - a) / (b - y);
double tmp;
if (z <= -27000.0) {
tmp = (((x * (y / (b - y))) + (y * ((a - t) / t_1))) / z) + t_2;
} else if (z <= 4.4e+29) {
tmp = fma(x, y, (z * (t - a))) / fma(z, (b - y), y);
} else {
tmp = (t_2 + ((y / z) * (x / (b - y)))) + (y * ((a - t) / (z * t_1)));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(b - y) ^ 2.0 t_2 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -27000.0) tmp = Float64(Float64(Float64(Float64(x * Float64(y / Float64(b - y))) + Float64(y * Float64(Float64(a - t) / t_1))) / z) + t_2); elseif (z <= 4.4e+29) tmp = Float64(fma(x, y, Float64(z * Float64(t - a))) / fma(z, Float64(b - y), y)); else tmp = Float64(Float64(t_2 + Float64(Float64(y / z) * Float64(x / Float64(b - y)))) + Float64(y * Float64(Float64(a - t) / Float64(z * t_1)))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[Power[N[(b - y), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -27000.0], N[(N[(N[(N[(x * N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * N[(N[(a - t), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] + t$95$2), $MachinePrecision], If[LessEqual[z, 4.4e+29], N[(N[(x * y + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$2 + N[(N[(y / z), $MachinePrecision] * N[(x / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * N[(N[(a - t), $MachinePrecision] / N[(z * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := {\left(b - y\right)}^{2}\\
t_2 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -27000:\\
\;\;\;\;\frac{x \cdot \frac{y}{b - y} + y \cdot \frac{a - t}{t\_1}}{z} + t\_2\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{+29}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, z \cdot \left(t - a\right)\right)}{\mathsf{fma}\left(z, b - y, y\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(t\_2 + \frac{y}{z} \cdot \frac{x}{b - y}\right) + y \cdot \frac{a - t}{z \cdot t\_1}\\
\end{array}
\end{array}
if z < -27000Initial program 36.6%
Taylor expanded in z around -inf 64.4%
associate--l+64.4%
mul-1-neg64.4%
distribute-lft-out--64.4%
associate-/l*72.7%
associate-/l*94.1%
div-sub94.1%
Simplified94.1%
if -27000 < z < 4.4000000000000003e29Initial program 90.7%
fma-define90.7%
+-commutative90.7%
fma-define90.7%
Simplified90.7%
if 4.4000000000000003e29 < z Initial program 54.0%
Taylor expanded in z around inf 73.9%
associate--r+73.9%
+-commutative73.9%
associate--l+73.9%
*-commutative73.9%
times-frac73.8%
div-sub73.8%
associate-/l*94.9%
Simplified94.9%
Final simplification92.5%
(FPCore (x y z t a b)
:precision binary64
(if (or (<= z -5.2e-17) (not (<= z 4.4e+29)))
(+
(+ (/ (- t a) (- b y)) (* (/ y z) (/ x (- b y))))
(* y (/ (- a t) (* z (pow (- b y) 2.0)))))
(/ (+ (* z (- t a)) (* x y)) (+ y (* z (- b y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -5.2e-17) || !(z <= 4.4e+29)) {
tmp = (((t - a) / (b - y)) + ((y / z) * (x / (b - y)))) + (y * ((a - t) / (z * pow((b - y), 2.0))));
} else {
tmp = ((z * (t - a)) + (x * y)) / (y + (z * (b - y)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-5.2d-17)) .or. (.not. (z <= 4.4d+29))) then
tmp = (((t - a) / (b - y)) + ((y / z) * (x / (b - y)))) + (y * ((a - t) / (z * ((b - y) ** 2.0d0))))
else
tmp = ((z * (t - a)) + (x * y)) / (y + (z * (b - y)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -5.2e-17) || !(z <= 4.4e+29)) {
tmp = (((t - a) / (b - y)) + ((y / z) * (x / (b - y)))) + (y * ((a - t) / (z * Math.pow((b - y), 2.0))));
} else {
tmp = ((z * (t - a)) + (x * y)) / (y + (z * (b - y)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -5.2e-17) or not (z <= 4.4e+29): tmp = (((t - a) / (b - y)) + ((y / z) * (x / (b - y)))) + (y * ((a - t) / (z * math.pow((b - y), 2.0)))) else: tmp = ((z * (t - a)) + (x * y)) / (y + (z * (b - y))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -5.2e-17) || !(z <= 4.4e+29)) tmp = Float64(Float64(Float64(Float64(t - a) / Float64(b - y)) + Float64(Float64(y / z) * Float64(x / Float64(b - y)))) + Float64(y * Float64(Float64(a - t) / Float64(z * (Float64(b - y) ^ 2.0))))); else tmp = Float64(Float64(Float64(z * Float64(t - a)) + Float64(x * y)) / Float64(y + Float64(z * Float64(b - y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -5.2e-17) || ~((z <= 4.4e+29))) tmp = (((t - a) / (b - y)) + ((y / z) * (x / (b - y)))) + (y * ((a - t) / (z * ((b - y) ^ 2.0)))); else tmp = ((z * (t - a)) + (x * y)) / (y + (z * (b - y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -5.2e-17], N[Not[LessEqual[z, 4.4e+29]], $MachinePrecision]], N[(N[(N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision] + N[(N[(y / z), $MachinePrecision] * N[(x / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * N[(N[(a - t), $MachinePrecision] / N[(z * N[Power[N[(b - y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{-17} \lor \neg \left(z \leq 4.4 \cdot 10^{+29}\right):\\
\;\;\;\;\left(\frac{t - a}{b - y} + \frac{y}{z} \cdot \frac{x}{b - y}\right) + y \cdot \frac{a - t}{z \cdot {\left(b - y\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{z \cdot \left(t - a\right) + x \cdot y}{y + z \cdot \left(b - y\right)}\\
\end{array}
\end{array}
if z < -5.20000000000000006e-17 or 4.4000000000000003e29 < z Initial program 47.2%
Taylor expanded in z around inf 68.6%
associate--r+68.6%
+-commutative68.6%
associate--l+68.6%
*-commutative68.6%
times-frac72.0%
div-sub72.0%
associate-/l*92.4%
Simplified92.4%
if -5.20000000000000006e-17 < z < 4.4000000000000003e29Initial program 90.4%
Final simplification91.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (pow (- b y) 2.0)) (t_2 (/ (- t a) (- b y))))
(if (<= z -27000.0)
(+ (/ (+ (* x (/ y (- b y))) (* y (/ (- a t) t_1))) z) t_2)
(if (<= z 5.6e+29)
(/ (+ (* z (- t a)) (* x y)) (+ y (* z (- b y))))
(+ (+ t_2 (* (/ y z) (/ x (- b y)))) (* y (/ (- a t) (* z t_1))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = pow((b - y), 2.0);
double t_2 = (t - a) / (b - y);
double tmp;
if (z <= -27000.0) {
tmp = (((x * (y / (b - y))) + (y * ((a - t) / t_1))) / z) + t_2;
} else if (z <= 5.6e+29) {
tmp = ((z * (t - a)) + (x * y)) / (y + (z * (b - y)));
} else {
tmp = (t_2 + ((y / z) * (x / (b - y)))) + (y * ((a - t) / (z * t_1)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (b - y) ** 2.0d0
t_2 = (t - a) / (b - y)
if (z <= (-27000.0d0)) then
tmp = (((x * (y / (b - y))) + (y * ((a - t) / t_1))) / z) + t_2
else if (z <= 5.6d+29) then
tmp = ((z * (t - a)) + (x * y)) / (y + (z * (b - y)))
else
tmp = (t_2 + ((y / z) * (x / (b - y)))) + (y * ((a - t) / (z * 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 = Math.pow((b - y), 2.0);
double t_2 = (t - a) / (b - y);
double tmp;
if (z <= -27000.0) {
tmp = (((x * (y / (b - y))) + (y * ((a - t) / t_1))) / z) + t_2;
} else if (z <= 5.6e+29) {
tmp = ((z * (t - a)) + (x * y)) / (y + (z * (b - y)));
} else {
tmp = (t_2 + ((y / z) * (x / (b - y)))) + (y * ((a - t) / (z * t_1)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = math.pow((b - y), 2.0) t_2 = (t - a) / (b - y) tmp = 0 if z <= -27000.0: tmp = (((x * (y / (b - y))) + (y * ((a - t) / t_1))) / z) + t_2 elif z <= 5.6e+29: tmp = ((z * (t - a)) + (x * y)) / (y + (z * (b - y))) else: tmp = (t_2 + ((y / z) * (x / (b - y)))) + (y * ((a - t) / (z * t_1))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b - y) ^ 2.0 t_2 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -27000.0) tmp = Float64(Float64(Float64(Float64(x * Float64(y / Float64(b - y))) + Float64(y * Float64(Float64(a - t) / t_1))) / z) + t_2); elseif (z <= 5.6e+29) tmp = Float64(Float64(Float64(z * Float64(t - a)) + Float64(x * y)) / Float64(y + Float64(z * Float64(b - y)))); else tmp = Float64(Float64(t_2 + Float64(Float64(y / z) * Float64(x / Float64(b - y)))) + Float64(y * Float64(Float64(a - t) / Float64(z * t_1)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (b - y) ^ 2.0; t_2 = (t - a) / (b - y); tmp = 0.0; if (z <= -27000.0) tmp = (((x * (y / (b - y))) + (y * ((a - t) / t_1))) / z) + t_2; elseif (z <= 5.6e+29) tmp = ((z * (t - a)) + (x * y)) / (y + (z * (b - y))); else tmp = (t_2 + ((y / z) * (x / (b - y)))) + (y * ((a - t) / (z * t_1))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[Power[N[(b - y), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -27000.0], N[(N[(N[(N[(x * N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * N[(N[(a - t), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] + t$95$2), $MachinePrecision], If[LessEqual[z, 5.6e+29], N[(N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$2 + N[(N[(y / z), $MachinePrecision] * N[(x / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * N[(N[(a - t), $MachinePrecision] / N[(z * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := {\left(b - y\right)}^{2}\\
t_2 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -27000:\\
\;\;\;\;\frac{x \cdot \frac{y}{b - y} + y \cdot \frac{a - t}{t\_1}}{z} + t\_2\\
\mathbf{elif}\;z \leq 5.6 \cdot 10^{+29}:\\
\;\;\;\;\frac{z \cdot \left(t - a\right) + x \cdot y}{y + z \cdot \left(b - y\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(t\_2 + \frac{y}{z} \cdot \frac{x}{b - y}\right) + y \cdot \frac{a - t}{z \cdot t\_1}\\
\end{array}
\end{array}
if z < -27000Initial program 36.6%
Taylor expanded in z around -inf 64.4%
associate--l+64.4%
mul-1-neg64.4%
distribute-lft-out--64.4%
associate-/l*72.7%
associate-/l*94.1%
div-sub94.1%
Simplified94.1%
if -27000 < z < 5.5999999999999999e29Initial program 90.7%
if 5.5999999999999999e29 < z Initial program 54.0%
Taylor expanded in z around inf 73.9%
associate--r+73.9%
+-commutative73.9%
associate--l+73.9%
*-commutative73.9%
times-frac73.8%
div-sub73.8%
associate-/l*94.9%
Simplified94.9%
Final simplification92.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- a t) y)) (t_2 (* z (/ (- t a) y))) (t_3 (/ x (- 1.0 z))))
(if (<= y -3.1e+31)
t_3
(if (<= y -4.6e-17)
t_1
(if (<= y -9e-46)
t_2
(if (<= y 1.9e-75)
(/ (- t a) b)
(if (<= y 0.07) t_1 (if (<= y 4400000000000.0) t_2 t_3))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a - t) / y;
double t_2 = z * ((t - a) / y);
double t_3 = x / (1.0 - z);
double tmp;
if (y <= -3.1e+31) {
tmp = t_3;
} else if (y <= -4.6e-17) {
tmp = t_1;
} else if (y <= -9e-46) {
tmp = t_2;
} else if (y <= 1.9e-75) {
tmp = (t - a) / b;
} else if (y <= 0.07) {
tmp = t_1;
} else if (y <= 4400000000000.0) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (a - t) / y
t_2 = z * ((t - a) / y)
t_3 = x / (1.0d0 - z)
if (y <= (-3.1d+31)) then
tmp = t_3
else if (y <= (-4.6d-17)) then
tmp = t_1
else if (y <= (-9d-46)) then
tmp = t_2
else if (y <= 1.9d-75) then
tmp = (t - a) / b
else if (y <= 0.07d0) then
tmp = t_1
else if (y <= 4400000000000.0d0) then
tmp = t_2
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a - t) / y;
double t_2 = z * ((t - a) / y);
double t_3 = x / (1.0 - z);
double tmp;
if (y <= -3.1e+31) {
tmp = t_3;
} else if (y <= -4.6e-17) {
tmp = t_1;
} else if (y <= -9e-46) {
tmp = t_2;
} else if (y <= 1.9e-75) {
tmp = (t - a) / b;
} else if (y <= 0.07) {
tmp = t_1;
} else if (y <= 4400000000000.0) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a - t) / y t_2 = z * ((t - a) / y) t_3 = x / (1.0 - z) tmp = 0 if y <= -3.1e+31: tmp = t_3 elif y <= -4.6e-17: tmp = t_1 elif y <= -9e-46: tmp = t_2 elif y <= 1.9e-75: tmp = (t - a) / b elif y <= 0.07: tmp = t_1 elif y <= 4400000000000.0: tmp = t_2 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a - t) / y) t_2 = Float64(z * Float64(Float64(t - a) / y)) t_3 = Float64(x / Float64(1.0 - z)) tmp = 0.0 if (y <= -3.1e+31) tmp = t_3; elseif (y <= -4.6e-17) tmp = t_1; elseif (y <= -9e-46) tmp = t_2; elseif (y <= 1.9e-75) tmp = Float64(Float64(t - a) / b); elseif (y <= 0.07) tmp = t_1; elseif (y <= 4400000000000.0) tmp = t_2; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a - t) / y; t_2 = z * ((t - a) / y); t_3 = x / (1.0 - z); tmp = 0.0; if (y <= -3.1e+31) tmp = t_3; elseif (y <= -4.6e-17) tmp = t_1; elseif (y <= -9e-46) tmp = t_2; elseif (y <= 1.9e-75) tmp = (t - a) / b; elseif (y <= 0.07) tmp = t_1; elseif (y <= 4400000000000.0) 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[(a - t), $MachinePrecision] / y), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(N[(t - a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.1e+31], t$95$3, If[LessEqual[y, -4.6e-17], t$95$1, If[LessEqual[y, -9e-46], t$95$2, If[LessEqual[y, 1.9e-75], N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[y, 0.07], t$95$1, If[LessEqual[y, 4400000000000.0], t$95$2, t$95$3]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a - t}{y}\\
t_2 := z \cdot \frac{t - a}{y}\\
t_3 := \frac{x}{1 - z}\\
\mathbf{if}\;y \leq -3.1 \cdot 10^{+31}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y \leq -4.6 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -9 \cdot 10^{-46}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{-75}:\\
\;\;\;\;\frac{t - a}{b}\\
\mathbf{elif}\;y \leq 0.07:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 4400000000000:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if y < -3.1000000000000002e31 or 4.4e12 < y Initial program 52.4%
Taylor expanded in y around inf 54.0%
mul-1-neg54.0%
unsub-neg54.0%
Simplified54.0%
if -3.1000000000000002e31 < y < -4.60000000000000018e-17 or 1.89999999999999997e-75 < y < 0.070000000000000007Initial program 81.0%
Taylor expanded in z around inf 72.6%
Taylor expanded in b around 0 54.8%
mul-1-neg54.8%
distribute-neg-frac254.8%
Simplified54.8%
if -4.60000000000000018e-17 < y < -9.00000000000000001e-46 or 0.070000000000000007 < y < 4.4e12Initial program 92.3%
Taylor expanded in z around 0 58.5%
Taylor expanded in x around 0 44.8%
associate-/l*44.8%
Simplified44.8%
if -9.00000000000000001e-46 < y < 1.89999999999999997e-75Initial program 82.9%
Taylor expanded in y around 0 56.3%
Final simplification54.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -6e-43)
t_1
(if (<= z 1.15e-203)
x
(if (<= z 5.1e-139)
(* z (/ (- t a) y))
(if (<= z 1.46e-5) (/ x (- 1.0 z)) 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 <= -6e-43) {
tmp = t_1;
} else if (z <= 1.15e-203) {
tmp = x;
} else if (z <= 5.1e-139) {
tmp = z * ((t - a) / y);
} else if (z <= 1.46e-5) {
tmp = x / (1.0 - 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 = (t - a) / (b - y)
if (z <= (-6d-43)) then
tmp = t_1
else if (z <= 1.15d-203) then
tmp = x
else if (z <= 5.1d-139) then
tmp = z * ((t - a) / y)
else if (z <= 1.46d-5) then
tmp = x / (1.0d0 - 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 = (t - a) / (b - y);
double tmp;
if (z <= -6e-43) {
tmp = t_1;
} else if (z <= 1.15e-203) {
tmp = x;
} else if (z <= 5.1e-139) {
tmp = z * ((t - a) / y);
} else if (z <= 1.46e-5) {
tmp = x / (1.0 - z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / (b - y) tmp = 0 if z <= -6e-43: tmp = t_1 elif z <= 1.15e-203: tmp = x elif z <= 5.1e-139: tmp = z * ((t - a) / y) elif z <= 1.46e-5: tmp = x / (1.0 - z) 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 <= -6e-43) tmp = t_1; elseif (z <= 1.15e-203) tmp = x; elseif (z <= 5.1e-139) tmp = Float64(z * Float64(Float64(t - a) / y)); elseif (z <= 1.46e-5) tmp = Float64(x / Float64(1.0 - z)); 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 <= -6e-43) tmp = t_1; elseif (z <= 1.15e-203) tmp = x; elseif (z <= 5.1e-139) tmp = z * ((t - a) / y); elseif (z <= 1.46e-5) tmp = x / (1.0 - z); 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, -6e-43], t$95$1, If[LessEqual[z, 1.15e-203], x, If[LessEqual[z, 5.1e-139], N[(z * N[(N[(t - a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.46e-5], N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -6 \cdot 10^{-43}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{-203}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 5.1 \cdot 10^{-139}:\\
\;\;\;\;z \cdot \frac{t - a}{y}\\
\mathbf{elif}\;z \leq 1.46 \cdot 10^{-5}:\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.00000000000000007e-43 or 1.46000000000000008e-5 < z Initial program 49.3%
Taylor expanded in z around inf 79.6%
if -6.00000000000000007e-43 < z < 1.14999999999999996e-203Initial program 86.4%
Taylor expanded in z around 0 49.3%
if 1.14999999999999996e-203 < z < 5.10000000000000036e-139Initial program 99.5%
Taylor expanded in z around 0 61.3%
Taylor expanded in x around 0 44.4%
associate-/l*39.5%
Simplified39.5%
if 5.10000000000000036e-139 < z < 1.46000000000000008e-5Initial program 93.5%
Taylor expanded in y around inf 47.1%
mul-1-neg47.1%
unsub-neg47.1%
Simplified47.1%
Final simplification63.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -2.7e+18) (not (<= z 2.7e+54))) (/ (- t a) (- b y)) (/ (+ (* z (- t a)) (* x y)) (+ y (* z (- b y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.7e+18) || !(z <= 2.7e+54)) {
tmp = (t - a) / (b - y);
} else {
tmp = ((z * (t - a)) + (x * y)) / (y + (z * (b - y)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-2.7d+18)) .or. (.not. (z <= 2.7d+54))) then
tmp = (t - a) / (b - y)
else
tmp = ((z * (t - a)) + (x * y)) / (y + (z * (b - y)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.7e+18) || !(z <= 2.7e+54)) {
tmp = (t - a) / (b - y);
} else {
tmp = ((z * (t - a)) + (x * y)) / (y + (z * (b - y)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -2.7e+18) or not (z <= 2.7e+54): tmp = (t - a) / (b - y) else: tmp = ((z * (t - a)) + (x * y)) / (y + (z * (b - y))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -2.7e+18) || !(z <= 2.7e+54)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(Float64(Float64(z * Float64(t - a)) + Float64(x * y)) / Float64(y + Float64(z * Float64(b - y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -2.7e+18) || ~((z <= 2.7e+54))) tmp = (t - a) / (b - y); else tmp = ((z * (t - a)) + (x * y)) / (y + (z * (b - y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2.7e+18], N[Not[LessEqual[z, 2.7e+54]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{+18} \lor \neg \left(z \leq 2.7 \cdot 10^{+54}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{z \cdot \left(t - a\right) + x \cdot y}{y + z \cdot \left(b - y\right)}\\
\end{array}
\end{array}
if z < -2.7e18 or 2.70000000000000011e54 < z Initial program 42.8%
Taylor expanded in z around inf 81.8%
if -2.7e18 < z < 2.70000000000000011e54Initial program 90.5%
Final simplification86.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) b)) (t_2 (/ x (- 1.0 z))))
(if (<= y -2.8e+45)
t_2
(if (<= y 1.55e-90)
t_1
(if (<= y 0.00075)
(/ t (- b y))
(if (<= y 5800000000000.0) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / b;
double t_2 = x / (1.0 - z);
double tmp;
if (y <= -2.8e+45) {
tmp = t_2;
} else if (y <= 1.55e-90) {
tmp = t_1;
} else if (y <= 0.00075) {
tmp = t / (b - y);
} else if (y <= 5800000000000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (t - a) / b
t_2 = x / (1.0d0 - z)
if (y <= (-2.8d+45)) then
tmp = t_2
else if (y <= 1.55d-90) then
tmp = t_1
else if (y <= 0.00075d0) then
tmp = t / (b - y)
else if (y <= 5800000000000.0d0) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / b;
double t_2 = x / (1.0 - z);
double tmp;
if (y <= -2.8e+45) {
tmp = t_2;
} else if (y <= 1.55e-90) {
tmp = t_1;
} else if (y <= 0.00075) {
tmp = t / (b - y);
} else if (y <= 5800000000000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / b t_2 = x / (1.0 - z) tmp = 0 if y <= -2.8e+45: tmp = t_2 elif y <= 1.55e-90: tmp = t_1 elif y <= 0.00075: tmp = t / (b - y) elif y <= 5800000000000.0: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / b) t_2 = Float64(x / Float64(1.0 - z)) tmp = 0.0 if (y <= -2.8e+45) tmp = t_2; elseif (y <= 1.55e-90) tmp = t_1; elseif (y <= 0.00075) tmp = Float64(t / Float64(b - y)); elseif (y <= 5800000000000.0) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - a) / b; t_2 = x / (1.0 - z); tmp = 0.0; if (y <= -2.8e+45) tmp = t_2; elseif (y <= 1.55e-90) tmp = t_1; elseif (y <= 0.00075) tmp = t / (b - y); elseif (y <= 5800000000000.0) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.8e+45], t$95$2, If[LessEqual[y, 1.55e-90], t$95$1, If[LessEqual[y, 0.00075], N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5800000000000.0], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b}\\
t_2 := \frac{x}{1 - z}\\
\mathbf{if}\;y \leq -2.8 \cdot 10^{+45}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 1.55 \cdot 10^{-90}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 0.00075:\\
\;\;\;\;\frac{t}{b - y}\\
\mathbf{elif}\;y \leq 5800000000000:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -2.7999999999999999e45 or 5.8e12 < y Initial program 52.4%
Taylor expanded in y around inf 54.9%
mul-1-neg54.9%
unsub-neg54.9%
Simplified54.9%
if -2.7999999999999999e45 < y < 1.5500000000000001e-90 or 7.5000000000000002e-4 < y < 5.8e12Initial program 82.3%
Taylor expanded in y around 0 51.3%
if 1.5500000000000001e-90 < y < 7.5000000000000002e-4Initial program 84.9%
Taylor expanded in z around inf 84.9%
Taylor expanded in t around inf 47.5%
Taylor expanded in z around inf 42.4%
Final simplification52.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) b)) (t_2 (/ x (- 1.0 z))))
(if (<= y -7e+45)
t_2
(if (<= y 2.7e-75)
t_1
(if (<= y 0.0205)
(/ (- a t) y)
(if (<= y 14600000000000.0) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / b;
double t_2 = x / (1.0 - z);
double tmp;
if (y <= -7e+45) {
tmp = t_2;
} else if (y <= 2.7e-75) {
tmp = t_1;
} else if (y <= 0.0205) {
tmp = (a - t) / y;
} else if (y <= 14600000000000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (t - a) / b
t_2 = x / (1.0d0 - z)
if (y <= (-7d+45)) then
tmp = t_2
else if (y <= 2.7d-75) then
tmp = t_1
else if (y <= 0.0205d0) then
tmp = (a - t) / y
else if (y <= 14600000000000.0d0) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / b;
double t_2 = x / (1.0 - z);
double tmp;
if (y <= -7e+45) {
tmp = t_2;
} else if (y <= 2.7e-75) {
tmp = t_1;
} else if (y <= 0.0205) {
tmp = (a - t) / y;
} else if (y <= 14600000000000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / b t_2 = x / (1.0 - z) tmp = 0 if y <= -7e+45: tmp = t_2 elif y <= 2.7e-75: tmp = t_1 elif y <= 0.0205: tmp = (a - t) / y elif y <= 14600000000000.0: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / b) t_2 = Float64(x / Float64(1.0 - z)) tmp = 0.0 if (y <= -7e+45) tmp = t_2; elseif (y <= 2.7e-75) tmp = t_1; elseif (y <= 0.0205) tmp = Float64(Float64(a - t) / y); elseif (y <= 14600000000000.0) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - a) / b; t_2 = x / (1.0 - z); tmp = 0.0; if (y <= -7e+45) tmp = t_2; elseif (y <= 2.7e-75) tmp = t_1; elseif (y <= 0.0205) tmp = (a - t) / y; elseif (y <= 14600000000000.0) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7e+45], t$95$2, If[LessEqual[y, 2.7e-75], t$95$1, If[LessEqual[y, 0.0205], N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[y, 14600000000000.0], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b}\\
t_2 := \frac{x}{1 - z}\\
\mathbf{if}\;y \leq -7 \cdot 10^{+45}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 2.7 \cdot 10^{-75}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 0.0205:\\
\;\;\;\;\frac{a - t}{y}\\
\mathbf{elif}\;y \leq 14600000000000:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -7.00000000000000046e45 or 1.46e13 < y Initial program 52.4%
Taylor expanded in y around inf 54.9%
mul-1-neg54.9%
unsub-neg54.9%
Simplified54.9%
if -7.00000000000000046e45 < y < 2.6999999999999998e-75 or 0.0205000000000000009 < y < 1.46e13Initial program 81.6%
Taylor expanded in y around 0 50.6%
if 2.6999999999999998e-75 < y < 0.0205000000000000009Initial program 92.7%
Taylor expanded in z around inf 62.1%
Taylor expanded in b around 0 54.5%
mul-1-neg54.5%
distribute-neg-frac254.5%
Simplified54.5%
Final simplification52.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -2.2e-26) (not (<= z 0.000112))) (/ (- t a) (- b y)) (+ x (/ (* z (- t a)) y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.2e-26) || !(z <= 0.000112)) {
tmp = (t - a) / (b - y);
} 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 <= (-2.2d-26)) .or. (.not. (z <= 0.000112d0))) then
tmp = (t - a) / (b - y)
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 <= -2.2e-26) || !(z <= 0.000112)) {
tmp = (t - a) / (b - y);
} else {
tmp = x + ((z * (t - a)) / y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -2.2e-26) or not (z <= 0.000112): tmp = (t - a) / (b - y) else: tmp = x + ((z * (t - a)) / y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -2.2e-26) || !(z <= 0.000112)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(x + Float64(Float64(z * Float64(t - a)) / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -2.2e-26) || ~((z <= 0.000112))) tmp = (t - a) / (b - y); else tmp = x + ((z * (t - a)) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2.2e-26], N[Not[LessEqual[z, 0.000112]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{-26} \lor \neg \left(z \leq 0.000112\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z \cdot \left(t - a\right)}{y}\\
\end{array}
\end{array}
if z < -2.2000000000000001e-26 or 1.11999999999999998e-4 < z Initial program 48.9%
Taylor expanded in z around inf 80.2%
if -2.2000000000000001e-26 < z < 1.11999999999999998e-4Initial program 90.1%
Taylor expanded in z around 0 66.6%
Taylor expanded in x around 0 74.7%
Final simplification77.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.8e-41) (not (<= z 6.2e+36))) (/ t (- b y)) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.8e-41) || !(z <= 6.2e+36)) {
tmp = t / (b - y);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-1.8d-41)) .or. (.not. (z <= 6.2d+36))) then
tmp = t / (b - y)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.8e-41) || !(z <= 6.2e+36)) {
tmp = t / (b - y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.8e-41) or not (z <= 6.2e+36): tmp = t / (b - y) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.8e-41) || !(z <= 6.2e+36)) tmp = Float64(t / Float64(b - y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.8e-41) || ~((z <= 6.2e+36))) tmp = t / (b - y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.8e-41], N[Not[LessEqual[z, 6.2e+36]], $MachinePrecision]], N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{-41} \lor \neg \left(z \leq 6.2 \cdot 10^{+36}\right):\\
\;\;\;\;\frac{t}{b - y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.8e-41 or 6.1999999999999999e36 < z Initial program 46.8%
Taylor expanded in z around inf 46.8%
Taylor expanded in t around inf 44.7%
Taylor expanded in z around inf 44.7%
if -1.8e-41 < z < 6.1999999999999999e36Initial program 90.5%
Taylor expanded in z around 0 41.4%
Final simplification42.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.15e+83) (not (<= y 1.02e+61))) (/ x (- 1.0 z)) (/ t (- b y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.15e+83) || !(y <= 1.02e+61)) {
tmp = x / (1.0 - z);
} else {
tmp = t / (b - y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-1.15d+83)) .or. (.not. (y <= 1.02d+61))) then
tmp = x / (1.0d0 - z)
else
tmp = t / (b - y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.15e+83) || !(y <= 1.02e+61)) {
tmp = x / (1.0 - z);
} else {
tmp = t / (b - y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.15e+83) or not (y <= 1.02e+61): tmp = x / (1.0 - z) else: tmp = t / (b - y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.15e+83) || !(y <= 1.02e+61)) tmp = Float64(x / Float64(1.0 - z)); else tmp = Float64(t / Float64(b - y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.15e+83) || ~((y <= 1.02e+61))) tmp = x / (1.0 - z); else tmp = t / (b - y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.15e+83], N[Not[LessEqual[y, 1.02e+61]], $MachinePrecision]], N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision], N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.15 \cdot 10^{+83} \lor \neg \left(y \leq 1.02 \cdot 10^{+61}\right):\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b - y}\\
\end{array}
\end{array}
if y < -1.14999999999999997e83 or 1.01999999999999999e61 < y Initial program 49.7%
Taylor expanded in y around inf 57.1%
mul-1-neg57.1%
unsub-neg57.1%
Simplified57.1%
if -1.14999999999999997e83 < y < 1.01999999999999999e61Initial program 82.9%
Taylor expanded in z around inf 82.3%
Taylor expanded in t around inf 41.1%
Taylor expanded in z around inf 34.7%
Final simplification43.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.9e-9) (not (<= z 2.3e-5))) (/ t b) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.9e-9) || !(z <= 2.3e-5)) {
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.9d-9)) .or. (.not. (z <= 2.3d-5))) 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.9e-9) || !(z <= 2.3e-5)) {
tmp = t / b;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.9e-9) or not (z <= 2.3e-5): tmp = t / b else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.9e-9) || !(z <= 2.3e-5)) 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.9e-9) || ~((z <= 2.3e-5))) tmp = t / b; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.9e-9], N[Not[LessEqual[z, 2.3e-5]], $MachinePrecision]], N[(t / b), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{-9} \lor \neg \left(z \leq 2.3 \cdot 10^{-5}\right):\\
\;\;\;\;\frac{t}{b}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.90000000000000006e-9 or 2.3e-5 < z Initial program 48.0%
Taylor expanded in z around inf 48.0%
Taylor expanded in t around inf 43.7%
Taylor expanded in b around inf 24.3%
if -1.90000000000000006e-9 < z < 2.3e-5Initial program 90.3%
Taylor expanded in z around 0 42.2%
Final simplification33.4%
(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 69.6%
Taylor expanded in z around 0 23.5%
Final simplification23.5%
(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 2024071
(FPCore (x y z t a b)
:name "Development.Shake.Progress:decay from shake-0.15.5"
:precision binary64
:alt
(- (/ (+ (* z t) (* y x)) (+ y (* z (- b y)))) (/ a (+ (- b y) (/ y z))))
(/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))