
(FPCore (x y z t a b) :precision binary64 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
def code(x, y, z, t, a, b): return ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
def code(x, y, z, t, a, b): return ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))) (t_2 (+ y (* z (- b y)))))
(if (<= z -1.02e-5)
(+ (* (/ x z) (/ y (- b y))) t_1)
(if (<= z 480000000.0)
(* x (+ (/ y t_2) (/ (* z (- t a)) (* x t_2))))
(+ t_1 (/ (* (/ x z) y) (- b y)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double t_2 = y + (z * (b - y));
double tmp;
if (z <= -1.02e-5) {
tmp = ((x / z) * (y / (b - y))) + t_1;
} else if (z <= 480000000.0) {
tmp = x * ((y / t_2) + ((z * (t - a)) / (x * t_2)));
} else {
tmp = t_1 + (((x / z) * y) / (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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (t - a) / (b - y)
t_2 = y + (z * (b - y))
if (z <= (-1.02d-5)) then
tmp = ((x / z) * (y / (b - y))) + t_1
else if (z <= 480000000.0d0) then
tmp = x * ((y / t_2) + ((z * (t - a)) / (x * t_2)))
else
tmp = t_1 + (((x / z) * y) / (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 t_1 = (t - a) / (b - y);
double t_2 = y + (z * (b - y));
double tmp;
if (z <= -1.02e-5) {
tmp = ((x / z) * (y / (b - y))) + t_1;
} else if (z <= 480000000.0) {
tmp = x * ((y / t_2) + ((z * (t - a)) / (x * t_2)));
} else {
tmp = t_1 + (((x / z) * y) / (b - y));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / (b - y) t_2 = y + (z * (b - y)) tmp = 0 if z <= -1.02e-5: tmp = ((x / z) * (y / (b - y))) + t_1 elif z <= 480000000.0: tmp = x * ((y / t_2) + ((z * (t - a)) / (x * t_2))) else: tmp = t_1 + (((x / z) * y) / (b - y)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) t_2 = Float64(y + Float64(z * Float64(b - y))) tmp = 0.0 if (z <= -1.02e-5) tmp = Float64(Float64(Float64(x / z) * Float64(y / Float64(b - y))) + t_1); elseif (z <= 480000000.0) tmp = Float64(x * Float64(Float64(y / t_2) + Float64(Float64(z * Float64(t - a)) / Float64(x * t_2)))); else tmp = Float64(t_1 + Float64(Float64(Float64(x / z) * y) / Float64(b - y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - a) / (b - y); t_2 = y + (z * (b - y)); tmp = 0.0; if (z <= -1.02e-5) tmp = ((x / z) * (y / (b - y))) + t_1; elseif (z <= 480000000.0) tmp = x * ((y / t_2) + ((z * (t - a)) / (x * t_2))); else tmp = t_1 + (((x / z) * y) / (b - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.02e-5], N[(N[(N[(x / z), $MachinePrecision] * N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[z, 480000000.0], N[(x * N[(N[(y / t$95$2), $MachinePrecision] + N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] / N[(x * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(N[(x / z), $MachinePrecision] * y), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
t_2 := y + z \cdot \left(b - y\right)\\
\mathbf{if}\;z \leq -1.02 \cdot 10^{-5}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{y}{b - y} + t\_1\\
\mathbf{elif}\;z \leq 480000000:\\
\;\;\;\;x \cdot \left(\frac{y}{t\_2} + \frac{z \cdot \left(t - a\right)}{x \cdot t\_2}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \frac{\frac{x}{z} \cdot y}{b - y}\\
\end{array}
\end{array}
if z < -1.0200000000000001e-5Initial program 56.6%
Taylor expanded in z around -inf 74.7%
associate--l+74.7%
mul-1-neg74.7%
distribute-lft-out--74.7%
associate-/l*74.9%
associate-/l*85.4%
div-sub85.4%
Simplified85.4%
Taylor expanded in x around inf 81.1%
times-frac97.2%
Simplified97.2%
if -1.0200000000000001e-5 < z < 4.8e8Initial program 85.5%
Taylor expanded in x around inf 92.9%
if 4.8e8 < z Initial program 53.2%
Taylor expanded in z around -inf 74.9%
associate--l+74.9%
mul-1-neg74.9%
distribute-lft-out--74.9%
associate-/l*75.0%
associate-/l*86.6%
div-sub88.3%
Simplified88.3%
Taylor expanded in x around inf 89.1%
times-frac97.4%
Simplified97.4%
associate-*r/98.9%
Applied egg-rr98.9%
Final simplification95.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (- t a))) (t_2 (- (/ (- t a) (- b y)) (/ x z))))
(if (<= z -4.2e+27)
t_2
(if (<= z -4.9e-198)
(/ t_1 (* z (- (+ b (/ y z)) y)))
(if (<= z 1.38e-213)
x
(if (<= z 440000000.0) (/ t_1 (+ y (* z (- b y)))) t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (t - a);
double t_2 = ((t - a) / (b - y)) - (x / z);
double tmp;
if (z <= -4.2e+27) {
tmp = t_2;
} else if (z <= -4.9e-198) {
tmp = t_1 / (z * ((b + (y / z)) - y));
} else if (z <= 1.38e-213) {
tmp = x;
} else if (z <= 440000000.0) {
tmp = t_1 / (y + (z * (b - y)));
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = z * (t - a)
t_2 = ((t - a) / (b - y)) - (x / z)
if (z <= (-4.2d+27)) then
tmp = t_2
else if (z <= (-4.9d-198)) then
tmp = t_1 / (z * ((b + (y / z)) - y))
else if (z <= 1.38d-213) then
tmp = x
else if (z <= 440000000.0d0) then
tmp = t_1 / (y + (z * (b - y)))
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (t - a);
double t_2 = ((t - a) / (b - y)) - (x / z);
double tmp;
if (z <= -4.2e+27) {
tmp = t_2;
} else if (z <= -4.9e-198) {
tmp = t_1 / (z * ((b + (y / z)) - y));
} else if (z <= 1.38e-213) {
tmp = x;
} else if (z <= 440000000.0) {
tmp = t_1 / (y + (z * (b - y)));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (t - a) t_2 = ((t - a) / (b - y)) - (x / z) tmp = 0 if z <= -4.2e+27: tmp = t_2 elif z <= -4.9e-198: tmp = t_1 / (z * ((b + (y / z)) - y)) elif z <= 1.38e-213: tmp = x elif z <= 440000000.0: tmp = t_1 / (y + (z * (b - y))) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(t - a)) t_2 = Float64(Float64(Float64(t - a) / Float64(b - y)) - Float64(x / z)) tmp = 0.0 if (z <= -4.2e+27) tmp = t_2; elseif (z <= -4.9e-198) tmp = Float64(t_1 / Float64(z * Float64(Float64(b + Float64(y / z)) - y))); elseif (z <= 1.38e-213) tmp = x; elseif (z <= 440000000.0) tmp = Float64(t_1 / Float64(y + Float64(z * Float64(b - y)))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (t - a); t_2 = ((t - a) / (b - y)) - (x / z); tmp = 0.0; if (z <= -4.2e+27) tmp = t_2; elseif (z <= -4.9e-198) tmp = t_1 / (z * ((b + (y / z)) - y)); elseif (z <= 1.38e-213) tmp = x; elseif (z <= 440000000.0) tmp = t_1 / (y + (z * (b - y))); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision] - N[(x / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.2e+27], t$95$2, If[LessEqual[z, -4.9e-198], N[(t$95$1 / N[(z * N[(N[(b + N[(y / z), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.38e-213], x, If[LessEqual[z, 440000000.0], N[(t$95$1 / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(t - a\right)\\
t_2 := \frac{t - a}{b - y} - \frac{x}{z}\\
\mathbf{if}\;z \leq -4.2 \cdot 10^{+27}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -4.9 \cdot 10^{-198}:\\
\;\;\;\;\frac{t\_1}{z \cdot \left(\left(b + \frac{y}{z}\right) - y\right)}\\
\mathbf{elif}\;z \leq 1.38 \cdot 10^{-213}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 440000000:\\
\;\;\;\;\frac{t\_1}{y + z \cdot \left(b - y\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -4.19999999999999989e27 or 4.4e8 < z Initial program 53.5%
Taylor expanded in z around -inf 74.0%
associate--l+74.0%
mul-1-neg74.0%
distribute-lft-out--74.0%
associate-/l*74.1%
associate-/l*85.5%
div-sub86.3%
Simplified86.3%
Taylor expanded in y around inf 86.8%
mul-1-neg86.8%
Simplified86.8%
if -4.19999999999999989e27 < z < -4.9000000000000002e-198Initial program 89.6%
Taylor expanded in x around 0 53.9%
Taylor expanded in z around inf 54.0%
if -4.9000000000000002e-198 < z < 1.37999999999999998e-213Initial program 88.3%
Taylor expanded in z around 0 73.1%
if 1.37999999999999998e-213 < z < 4.4e8Initial program 79.3%
Taylor expanded in x around 0 52.5%
Final simplification73.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* z (- t a)) (+ y (* z (- b y)))))
(t_2 (- (/ (- t a) (- b y)) (/ x z))))
(if (<= z -4.2e+27)
t_2
(if (<= z -3.2e-200)
t_1
(if (<= z 2.2e-213) x (if (<= z 320000000.0) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z * (t - a)) / (y + (z * (b - y)));
double t_2 = ((t - a) / (b - y)) - (x / z);
double tmp;
if (z <= -4.2e+27) {
tmp = t_2;
} else if (z <= -3.2e-200) {
tmp = t_1;
} else if (z <= 2.2e-213) {
tmp = x;
} else if (z <= 320000000.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 = (z * (t - a)) / (y + (z * (b - y)))
t_2 = ((t - a) / (b - y)) - (x / z)
if (z <= (-4.2d+27)) then
tmp = t_2
else if (z <= (-3.2d-200)) then
tmp = t_1
else if (z <= 2.2d-213) then
tmp = x
else if (z <= 320000000.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 = (z * (t - a)) / (y + (z * (b - y)));
double t_2 = ((t - a) / (b - y)) - (x / z);
double tmp;
if (z <= -4.2e+27) {
tmp = t_2;
} else if (z <= -3.2e-200) {
tmp = t_1;
} else if (z <= 2.2e-213) {
tmp = x;
} else if (z <= 320000000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z * (t - a)) / (y + (z * (b - y))) t_2 = ((t - a) / (b - y)) - (x / z) tmp = 0 if z <= -4.2e+27: tmp = t_2 elif z <= -3.2e-200: tmp = t_1 elif z <= 2.2e-213: tmp = x elif z <= 320000000.0: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z * Float64(t - a)) / Float64(y + Float64(z * Float64(b - y)))) t_2 = Float64(Float64(Float64(t - a) / Float64(b - y)) - Float64(x / z)) tmp = 0.0 if (z <= -4.2e+27) tmp = t_2; elseif (z <= -3.2e-200) tmp = t_1; elseif (z <= 2.2e-213) tmp = x; elseif (z <= 320000000.0) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z * (t - a)) / (y + (z * (b - y))); t_2 = ((t - a) / (b - y)) - (x / z); tmp = 0.0; if (z <= -4.2e+27) tmp = t_2; elseif (z <= -3.2e-200) tmp = t_1; elseif (z <= 2.2e-213) tmp = x; elseif (z <= 320000000.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[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision] - N[(x / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.2e+27], t$95$2, If[LessEqual[z, -3.2e-200], t$95$1, If[LessEqual[z, 2.2e-213], x, If[LessEqual[z, 320000000.0], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
t_2 := \frac{t - a}{b - y} - \frac{x}{z}\\
\mathbf{if}\;z \leq -4.2 \cdot 10^{+27}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -3.2 \cdot 10^{-200}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{-213}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 320000000:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -4.19999999999999989e27 or 3.2e8 < z Initial program 53.5%
Taylor expanded in z around -inf 74.0%
associate--l+74.0%
mul-1-neg74.0%
distribute-lft-out--74.0%
associate-/l*74.1%
associate-/l*85.5%
div-sub86.3%
Simplified86.3%
Taylor expanded in y around inf 86.8%
mul-1-neg86.8%
Simplified86.8%
if -4.19999999999999989e27 < z < -3.19999999999999983e-200 or 2.2000000000000001e-213 < z < 3.2e8Initial program 84.5%
Taylor expanded in x around 0 53.3%
if -3.19999999999999983e-200 < z < 2.2000000000000001e-213Initial program 88.3%
Taylor expanded in z around 0 73.1%
Final simplification73.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (/ (- t a) (- b y)) (/ x z))))
(if (<= z -3.4e+24)
t_1
(if (<= z -1.9e-86)
(/ (+ t (- (* x (/ y z)) a)) b)
(if (<= z 2.2e-213)
x
(if (<= z 13.0) (/ (* z (- t a)) (+ y (* z b))) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t - a) / (b - y)) - (x / z);
double tmp;
if (z <= -3.4e+24) {
tmp = t_1;
} else if (z <= -1.9e-86) {
tmp = (t + ((x * (y / z)) - a)) / b;
} else if (z <= 2.2e-213) {
tmp = x;
} else if (z <= 13.0) {
tmp = (z * (t - a)) / (y + (z * 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 = ((t - a) / (b - y)) - (x / z)
if (z <= (-3.4d+24)) then
tmp = t_1
else if (z <= (-1.9d-86)) then
tmp = (t + ((x * (y / z)) - a)) / b
else if (z <= 2.2d-213) then
tmp = x
else if (z <= 13.0d0) then
tmp = (z * (t - a)) / (y + (z * 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 = ((t - a) / (b - y)) - (x / z);
double tmp;
if (z <= -3.4e+24) {
tmp = t_1;
} else if (z <= -1.9e-86) {
tmp = (t + ((x * (y / z)) - a)) / b;
} else if (z <= 2.2e-213) {
tmp = x;
} else if (z <= 13.0) {
tmp = (z * (t - a)) / (y + (z * b));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((t - a) / (b - y)) - (x / z) tmp = 0 if z <= -3.4e+24: tmp = t_1 elif z <= -1.9e-86: tmp = (t + ((x * (y / z)) - a)) / b elif z <= 2.2e-213: tmp = x elif z <= 13.0: tmp = (z * (t - a)) / (y + (z * b)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(t - a) / Float64(b - y)) - Float64(x / z)) tmp = 0.0 if (z <= -3.4e+24) tmp = t_1; elseif (z <= -1.9e-86) tmp = Float64(Float64(t + Float64(Float64(x * Float64(y / z)) - a)) / b); elseif (z <= 2.2e-213) tmp = x; elseif (z <= 13.0) tmp = Float64(Float64(z * Float64(t - a)) / Float64(y + Float64(z * b))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((t - a) / (b - y)) - (x / z); tmp = 0.0; if (z <= -3.4e+24) tmp = t_1; elseif (z <= -1.9e-86) tmp = (t + ((x * (y / z)) - a)) / b; elseif (z <= 2.2e-213) tmp = x; elseif (z <= 13.0) tmp = (z * (t - a)) / (y + (z * b)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision] - N[(x / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.4e+24], t$95$1, If[LessEqual[z, -1.9e-86], N[(N[(t + N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[z, 2.2e-213], x, If[LessEqual[z, 13.0], N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y} - \frac{x}{z}\\
\mathbf{if}\;z \leq -3.4 \cdot 10^{+24}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.9 \cdot 10^{-86}:\\
\;\;\;\;\frac{t + \left(x \cdot \frac{y}{z} - a\right)}{b}\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{-213}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 13:\\
\;\;\;\;\frac{z \cdot \left(t - a\right)}{y + z \cdot b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.4000000000000001e24 or 13 < z Initial program 54.3%
Taylor expanded in z around -inf 72.8%
associate--l+72.8%
mul-1-neg72.8%
distribute-lft-out--72.8%
associate-/l*73.0%
associate-/l*84.8%
div-sub85.6%
Simplified85.6%
Taylor expanded in y around inf 86.6%
mul-1-neg86.6%
Simplified86.6%
if -3.4000000000000001e24 < z < -1.9e-86Initial program 95.4%
Taylor expanded in z around inf 95.4%
associate--l+95.4%
associate-/l*95.4%
Simplified95.4%
Taylor expanded in b around inf 65.8%
associate-*r/65.8%
associate--l+65.8%
Simplified65.8%
if -1.9e-86 < z < 2.2000000000000001e-213Initial program 86.8%
Taylor expanded in z around 0 62.7%
if 2.2000000000000001e-213 < z < 13Initial program 78.8%
Taylor expanded in x around 0 51.4%
Taylor expanded in b around inf 50.9%
Final simplification72.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -360000.0)
t_1
(if (<= z -1.3e-88)
(/ (+ t (- (* x (/ y z)) a)) b)
(if (<= z 2.2e-213)
x
(if (<= z 1.0) (/ (* z (- t a)) (+ y (* z b))) 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 <= -360000.0) {
tmp = t_1;
} else if (z <= -1.3e-88) {
tmp = (t + ((x * (y / z)) - a)) / b;
} else if (z <= 2.2e-213) {
tmp = x;
} else if (z <= 1.0) {
tmp = (z * (t - a)) / (y + (z * 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 = (t - a) / (b - y)
if (z <= (-360000.0d0)) then
tmp = t_1
else if (z <= (-1.3d-88)) then
tmp = (t + ((x * (y / z)) - a)) / b
else if (z <= 2.2d-213) then
tmp = x
else if (z <= 1.0d0) then
tmp = (z * (t - a)) / (y + (z * 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 = (t - a) / (b - y);
double tmp;
if (z <= -360000.0) {
tmp = t_1;
} else if (z <= -1.3e-88) {
tmp = (t + ((x * (y / z)) - a)) / b;
} else if (z <= 2.2e-213) {
tmp = x;
} else if (z <= 1.0) {
tmp = (z * (t - a)) / (y + (z * b));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / (b - y) tmp = 0 if z <= -360000.0: tmp = t_1 elif z <= -1.3e-88: tmp = (t + ((x * (y / z)) - a)) / b elif z <= 2.2e-213: tmp = x elif z <= 1.0: tmp = (z * (t - a)) / (y + (z * b)) 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 <= -360000.0) tmp = t_1; elseif (z <= -1.3e-88) tmp = Float64(Float64(t + Float64(Float64(x * Float64(y / z)) - a)) / b); elseif (z <= 2.2e-213) tmp = x; elseif (z <= 1.0) tmp = Float64(Float64(z * Float64(t - a)) / Float64(y + Float64(z * b))); 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 <= -360000.0) tmp = t_1; elseif (z <= -1.3e-88) tmp = (t + ((x * (y / z)) - a)) / b; elseif (z <= 2.2e-213) tmp = x; elseif (z <= 1.0) tmp = (z * (t - a)) / (y + (z * b)); 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, -360000.0], t$95$1, If[LessEqual[z, -1.3e-88], N[(N[(t + N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], If[LessEqual[z, 2.2e-213], x, If[LessEqual[z, 1.0], N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -360000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.3 \cdot 10^{-88}:\\
\;\;\;\;\frac{t + \left(x \cdot \frac{y}{z} - a\right)}{b}\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{-213}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;\frac{z \cdot \left(t - a\right)}{y + z \cdot b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.6e5 or 1 < z Initial program 55.0%
Taylor expanded in z around inf 77.6%
if -3.6e5 < z < -1.30000000000000007e-88Initial program 94.9%
Taylor expanded in z around inf 94.9%
associate--l+94.9%
associate-/l*94.9%
Simplified94.9%
Taylor expanded in b around inf 67.2%
associate-*r/67.2%
associate--l+67.2%
Simplified67.2%
if -1.30000000000000007e-88 < z < 2.2000000000000001e-213Initial program 86.8%
Taylor expanded in z around 0 62.7%
if 2.2000000000000001e-213 < z < 1Initial program 78.8%
Taylor expanded in x around 0 51.4%
Taylor expanded in b around inf 50.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* z (- t a)) (+ y (* z b)))) (t_2 (/ (- t a) (- b y))))
(if (<= z -1.05e-24)
t_2
(if (<= z -1.1e-200)
t_1
(if (<= z 2.1e-213) x (if (<= z 1.0) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z * (t - a)) / (y + (z * b));
double t_2 = (t - a) / (b - y);
double tmp;
if (z <= -1.05e-24) {
tmp = t_2;
} else if (z <= -1.1e-200) {
tmp = t_1;
} else if (z <= 2.1e-213) {
tmp = x;
} else if (z <= 1.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 = (z * (t - a)) / (y + (z * b))
t_2 = (t - a) / (b - y)
if (z <= (-1.05d-24)) then
tmp = t_2
else if (z <= (-1.1d-200)) then
tmp = t_1
else if (z <= 2.1d-213) then
tmp = x
else if (z <= 1.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 = (z * (t - a)) / (y + (z * b));
double t_2 = (t - a) / (b - y);
double tmp;
if (z <= -1.05e-24) {
tmp = t_2;
} else if (z <= -1.1e-200) {
tmp = t_1;
} else if (z <= 2.1e-213) {
tmp = x;
} else if (z <= 1.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z * (t - a)) / (y + (z * b)) t_2 = (t - a) / (b - y) tmp = 0 if z <= -1.05e-24: tmp = t_2 elif z <= -1.1e-200: tmp = t_1 elif z <= 2.1e-213: tmp = x elif z <= 1.0: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z * Float64(t - a)) / Float64(y + Float64(z * b))) t_2 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -1.05e-24) tmp = t_2; elseif (z <= -1.1e-200) tmp = t_1; elseif (z <= 2.1e-213) tmp = x; elseif (z <= 1.0) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z * (t - a)) / (y + (z * b)); t_2 = (t - a) / (b - y); tmp = 0.0; if (z <= -1.05e-24) tmp = t_2; elseif (z <= -1.1e-200) tmp = t_1; elseif (z <= 2.1e-213) tmp = x; elseif (z <= 1.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[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.05e-24], t$95$2, If[LessEqual[z, -1.1e-200], t$95$1, If[LessEqual[z, 2.1e-213], x, If[LessEqual[z, 1.0], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z \cdot \left(t - a\right)}{y + z \cdot b}\\
t_2 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -1.05 \cdot 10^{-24}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.1 \cdot 10^{-200}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-213}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -1.05e-24 or 1 < z Initial program 56.0%
Taylor expanded in z around inf 76.0%
if -1.05e-24 < z < -1.10000000000000007e-200 or 2.0999999999999998e-213 < z < 1Initial program 83.8%
Taylor expanded in x around 0 52.0%
Taylor expanded in b around inf 51.7%
if -1.10000000000000007e-200 < z < 2.0999999999999998e-213Initial program 88.3%
Taylor expanded in z around 0 73.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -4.2e+27) (not (<= z 50000000000000.0))) (+ (* (/ x z) (/ y (- b y))) (/ (- 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 <= -4.2e+27) || !(z <= 50000000000000.0)) {
tmp = ((x / z) * (y / (b - y))) + ((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 <= (-4.2d+27)) .or. (.not. (z <= 50000000000000.0d0))) then
tmp = ((x / z) * (y / (b - y))) + ((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 <= -4.2e+27) || !(z <= 50000000000000.0)) {
tmp = ((x / z) * (y / (b - y))) + ((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 <= -4.2e+27) or not (z <= 50000000000000.0): tmp = ((x / z) * (y / (b - y))) + ((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 <= -4.2e+27) || !(z <= 50000000000000.0)) tmp = Float64(Float64(Float64(x / z) * Float64(y / Float64(b - y))) + 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 <= -4.2e+27) || ~((z <= 50000000000000.0))) tmp = ((x / z) * (y / (b - y))) + ((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, -4.2e+27], N[Not[LessEqual[z, 50000000000000.0]], $MachinePrecision]], N[(N[(N[(x / z), $MachinePrecision] * N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t - a), $MachinePrecision] / N[(b - y), $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 -4.2 \cdot 10^{+27} \lor \neg \left(z \leq 50000000000000\right):\\
\;\;\;\;\frac{x}{z} \cdot \frac{y}{b - y} + \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 < -4.19999999999999989e27 or 5e13 < z Initial program 52.0%
Taylor expanded in z around -inf 74.1%
associate--l+74.1%
mul-1-neg74.1%
distribute-lft-out--74.1%
associate-/l*75.1%
associate-/l*86.8%
div-sub87.7%
Simplified87.7%
Taylor expanded in x around inf 84.4%
times-frac98.4%
Simplified98.4%
if -4.19999999999999989e27 < z < 5e13Initial program 86.3%
Final simplification91.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -8.5e-9) (not (<= z 50000000000000.0))) (+ (* (/ x z) (/ y (- b y))) (/ (- t a) (- b y))) (/ (+ (* x y) (* z t)) (+ y (* z (- b y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -8.5e-9) || !(z <= 50000000000000.0)) {
tmp = ((x / z) * (y / (b - y))) + ((t - a) / (b - y));
} else {
tmp = ((x * y) + (z * t)) / (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 <= (-8.5d-9)) .or. (.not. (z <= 50000000000000.0d0))) then
tmp = ((x / z) * (y / (b - y))) + ((t - a) / (b - y))
else
tmp = ((x * y) + (z * t)) / (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 <= -8.5e-9) || !(z <= 50000000000000.0)) {
tmp = ((x / z) * (y / (b - y))) + ((t - a) / (b - y));
} else {
tmp = ((x * y) + (z * t)) / (y + (z * (b - y)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -8.5e-9) or not (z <= 50000000000000.0): tmp = ((x / z) * (y / (b - y))) + ((t - a) / (b - y)) else: tmp = ((x * y) + (z * t)) / (y + (z * (b - y))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -8.5e-9) || !(z <= 50000000000000.0)) tmp = Float64(Float64(Float64(x / z) * Float64(y / Float64(b - y))) + Float64(Float64(t - a) / Float64(b - y))); else tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) / 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 <= -8.5e-9) || ~((z <= 50000000000000.0))) tmp = ((x / z) * (y / (b - y))) + ((t - a) / (b - y)); else tmp = ((x * y) + (z * t)) / (y + (z * (b - y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -8.5e-9], N[Not[LessEqual[z, 50000000000000.0]], $MachinePrecision]], N[(N[(N[(x / z), $MachinePrecision] * N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{-9} \lor \neg \left(z \leq 50000000000000\right):\\
\;\;\;\;\frac{x}{z} \cdot \frac{y}{b - y} + \frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y + z \cdot t}{y + z \cdot \left(b - y\right)}\\
\end{array}
\end{array}
if z < -8.5e-9 or 5e13 < z Initial program 53.9%
Taylor expanded in z around -inf 74.4%
associate--l+74.4%
mul-1-neg74.4%
distribute-lft-out--74.4%
associate-/l*75.3%
associate-/l*86.6%
div-sub87.4%
Simplified87.4%
Taylor expanded in x around inf 85.0%
times-frac98.5%
Simplified98.5%
if -8.5e-9 < z < 5e13Initial program 85.8%
Taylor expanded in t around inf 70.4%
*-commutative70.4%
Simplified70.4%
Final simplification84.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -4.2e+27) (not (<= z 2.5e+21))) (- (/ (- t a) (- b y)) (/ x z)) (/ (+ (* x y) (* z t)) (+ y (* z (- b y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -4.2e+27) || !(z <= 2.5e+21)) {
tmp = ((t - a) / (b - y)) - (x / z);
} else {
tmp = ((x * y) + (z * t)) / (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 <= (-4.2d+27)) .or. (.not. (z <= 2.5d+21))) then
tmp = ((t - a) / (b - y)) - (x / z)
else
tmp = ((x * y) + (z * t)) / (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 <= -4.2e+27) || !(z <= 2.5e+21)) {
tmp = ((t - a) / (b - y)) - (x / z);
} else {
tmp = ((x * y) + (z * t)) / (y + (z * (b - y)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -4.2e+27) or not (z <= 2.5e+21): tmp = ((t - a) / (b - y)) - (x / z) else: tmp = ((x * y) + (z * t)) / (y + (z * (b - y))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -4.2e+27) || !(z <= 2.5e+21)) tmp = Float64(Float64(Float64(t - a) / Float64(b - y)) - Float64(x / z)); else tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) / 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 <= -4.2e+27) || ~((z <= 2.5e+21))) tmp = ((t - a) / (b - y)) - (x / z); else tmp = ((x * y) + (z * t)) / (y + (z * (b - y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -4.2e+27], N[Not[LessEqual[z, 2.5e+21]], $MachinePrecision]], N[(N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision] - N[(x / z), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{+27} \lor \neg \left(z \leq 2.5 \cdot 10^{+21}\right):\\
\;\;\;\;\frac{t - a}{b - y} - \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y + z \cdot t}{y + z \cdot \left(b - y\right)}\\
\end{array}
\end{array}
if z < -4.19999999999999989e27 or 2.5e21 < z Initial program 51.1%
Taylor expanded in z around -inf 73.3%
associate--l+73.3%
mul-1-neg73.3%
distribute-lft-out--73.3%
associate-/l*74.2%
associate-/l*86.4%
div-sub87.3%
Simplified87.3%
Taylor expanded in y around inf 88.6%
mul-1-neg88.6%
Simplified88.6%
if -4.19999999999999989e27 < z < 2.5e21Initial program 86.0%
Taylor expanded in t around inf 70.3%
*-commutative70.3%
Simplified70.3%
Final simplification78.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.85e-94) (not (<= z 4.2e+15))) (/ (- t a) (- b y)) (/ x (- 1.0 z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.85e-94) || !(z <= 4.2e+15)) {
tmp = (t - a) / (b - y);
} else {
tmp = x / (1.0 - z);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-1.85d-94)) .or. (.not. (z <= 4.2d+15))) then
tmp = (t - a) / (b - y)
else
tmp = x / (1.0d0 - z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.85e-94) || !(z <= 4.2e+15)) {
tmp = (t - a) / (b - y);
} else {
tmp = x / (1.0 - z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.85e-94) or not (z <= 4.2e+15): tmp = (t - a) / (b - y) else: tmp = x / (1.0 - z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.85e-94) || !(z <= 4.2e+15)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(x / Float64(1.0 - z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.85e-94) || ~((z <= 4.2e+15))) tmp = (t - a) / (b - y); else tmp = x / (1.0 - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.85e-94], N[Not[LessEqual[z, 4.2e+15]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{-94} \lor \neg \left(z \leq 4.2 \cdot 10^{+15}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{1 - z}\\
\end{array}
\end{array}
if z < -1.8499999999999999e-94 or 4.2e15 < z Initial program 59.2%
Taylor expanded in z around inf 75.3%
if -1.8499999999999999e-94 < z < 4.2e15Initial program 83.9%
Taylor expanded in y around inf 52.2%
mul-1-neg52.2%
unsub-neg52.2%
Simplified52.2%
Final simplification64.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.65e-27) (not (<= y 2.8e+34))) (/ x (- 1.0 z)) (/ (- t a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.65e-27) || !(y <= 2.8e+34)) {
tmp = x / (1.0 - z);
} else {
tmp = (t - a) / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-1.65d-27)) .or. (.not. (y <= 2.8d+34))) then
tmp = x / (1.0d0 - z)
else
tmp = (t - a) / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.65e-27) || !(y <= 2.8e+34)) {
tmp = x / (1.0 - z);
} else {
tmp = (t - a) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.65e-27) or not (y <= 2.8e+34): tmp = x / (1.0 - z) else: tmp = (t - a) / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.65e-27) || !(y <= 2.8e+34)) tmp = Float64(x / Float64(1.0 - z)); else tmp = Float64(Float64(t - a) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.65e-27) || ~((y <= 2.8e+34))) tmp = x / (1.0 - z); else tmp = (t - a) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.65e-27], N[Not[LessEqual[y, 2.8e+34]], $MachinePrecision]], N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision], N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.65 \cdot 10^{-27} \lor \neg \left(y \leq 2.8 \cdot 10^{+34}\right):\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b}\\
\end{array}
\end{array}
if y < -1.64999999999999999e-27 or 2.80000000000000008e34 < y Initial program 54.1%
Taylor expanded in y around inf 58.9%
mul-1-neg58.9%
unsub-neg58.9%
Simplified58.9%
if -1.64999999999999999e-27 < y < 2.80000000000000008e34Initial program 85.9%
Taylor expanded in y around 0 55.2%
Final simplification57.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -3.1e-5) (not (<= y 1.45e+40))) (/ 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 <= -3.1e-5) || !(y <= 1.45e+40)) {
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 <= (-3.1d-5)) .or. (.not. (y <= 1.45d+40))) 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 <= -3.1e-5) || !(y <= 1.45e+40)) {
tmp = x / (1.0 - z);
} else {
tmp = t / (b - y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -3.1e-5) or not (y <= 1.45e+40): 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 <= -3.1e-5) || !(y <= 1.45e+40)) 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 <= -3.1e-5) || ~((y <= 1.45e+40))) 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, -3.1e-5], N[Not[LessEqual[y, 1.45e+40]], $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 -3.1 \cdot 10^{-5} \lor \neg \left(y \leq 1.45 \cdot 10^{+40}\right):\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b - y}\\
\end{array}
\end{array}
if y < -3.10000000000000014e-5 or 1.45000000000000009e40 < y Initial program 53.8%
Taylor expanded in y around inf 60.3%
mul-1-neg60.3%
unsub-neg60.3%
Simplified60.3%
if -3.10000000000000014e-5 < y < 1.45000000000000009e40Initial program 85.5%
Taylor expanded in z around -inf 71.6%
associate--l+71.6%
mul-1-neg71.6%
distribute-lft-out--71.6%
associate-/l*67.9%
associate-/l*64.3%
div-sub65.0%
Simplified65.0%
Taylor expanded in x around inf 78.6%
times-frac72.3%
Simplified72.3%
Taylor expanded in t around inf 43.1%
Final simplification51.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -7.2e-86) (not (<= z 4e-42))) (/ t (- b y)) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -7.2e-86) || !(z <= 4e-42)) {
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 <= (-7.2d-86)) .or. (.not. (z <= 4d-42))) 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 <= -7.2e-86) || !(z <= 4e-42)) {
tmp = t / (b - y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -7.2e-86) or not (z <= 4e-42): tmp = t / (b - y) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -7.2e-86) || !(z <= 4e-42)) 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 <= -7.2e-86) || ~((z <= 4e-42))) tmp = t / (b - y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -7.2e-86], N[Not[LessEqual[z, 4e-42]], $MachinePrecision]], N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{-86} \lor \neg \left(z \leq 4 \cdot 10^{-42}\right):\\
\;\;\;\;\frac{t}{b - y}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -7.19999999999999932e-86 or 4.00000000000000015e-42 < z Initial program 61.8%
Taylor expanded in z around -inf 70.6%
associate--l+70.6%
mul-1-neg70.6%
distribute-lft-out--70.6%
associate-/l*70.7%
associate-/l*81.2%
div-sub81.8%
Simplified81.8%
Taylor expanded in x around inf 80.6%
times-frac88.4%
Simplified88.4%
Taylor expanded in t around inf 45.5%
if -7.19999999999999932e-86 < z < 4.00000000000000015e-42Initial program 82.9%
Taylor expanded in z around 0 55.6%
Final simplification49.6%
(FPCore (x y z t a b) :precision binary64 (if (<= y -7e-49) x (if (<= y 1.3e+38) (/ t b) x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -7e-49) {
tmp = x;
} else if (y <= 1.3e+38) {
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 <= (-7d-49)) then
tmp = x
else if (y <= 1.3d+38) 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 <= -7e-49) {
tmp = x;
} else if (y <= 1.3e+38) {
tmp = t / b;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -7e-49: tmp = x elif y <= 1.3e+38: tmp = t / b else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -7e-49) tmp = x; elseif (y <= 1.3e+38) 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 <= -7e-49) tmp = x; elseif (y <= 1.3e+38) tmp = t / b; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -7e-49], x, If[LessEqual[y, 1.3e+38], N[(t / b), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7 \cdot 10^{-49}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{+38}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -7.00000000000000012e-49 or 1.3e38 < y Initial program 55.5%
Taylor expanded in z around 0 43.9%
if -7.00000000000000012e-49 < y < 1.3e38Initial program 85.5%
Taylor expanded in z around inf 83.9%
associate--l+83.9%
associate-/l*83.7%
Simplified83.7%
Taylor expanded in b around inf 67.6%
Taylor expanded in t around inf 35.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 70.4%
Taylor expanded in z around 0 25.9%
(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 2024186
(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)))))