
(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 (/ (+ (* y x) (* z (- t a))) (- y (* z (- y b))))))
(if (<= t_1 -4e+307)
(- (/ (- a t) y) (/ x (+ z -1.0)))
(if (or (<= t_1 -1e-273) (and (not (<= t_1 0.0)) (<= t_1 5e+305)))
t_1
(/ (- t a) (- b y))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((y * x) + (z * (t - a))) / (y - (z * (y - b)));
double tmp;
if (t_1 <= -4e+307) {
tmp = ((a - t) / y) - (x / (z + -1.0));
} else if ((t_1 <= -1e-273) || (!(t_1 <= 0.0) && (t_1 <= 5e+305))) {
tmp = t_1;
} else {
tmp = (t - a) / (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) :: tmp
t_1 = ((y * x) + (z * (t - a))) / (y - (z * (y - b)))
if (t_1 <= (-4d+307)) then
tmp = ((a - t) / y) - (x / (z + (-1.0d0)))
else if ((t_1 <= (-1d-273)) .or. (.not. (t_1 <= 0.0d0)) .and. (t_1 <= 5d+305)) then
tmp = t_1
else
tmp = (t - a) / (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 = ((y * x) + (z * (t - a))) / (y - (z * (y - b)));
double tmp;
if (t_1 <= -4e+307) {
tmp = ((a - t) / y) - (x / (z + -1.0));
} else if ((t_1 <= -1e-273) || (!(t_1 <= 0.0) && (t_1 <= 5e+305))) {
tmp = t_1;
} else {
tmp = (t - a) / (b - y);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((y * x) + (z * (t - a))) / (y - (z * (y - b))) tmp = 0 if t_1 <= -4e+307: tmp = ((a - t) / y) - (x / (z + -1.0)) elif (t_1 <= -1e-273) or (not (t_1 <= 0.0) and (t_1 <= 5e+305)): tmp = t_1 else: tmp = (t - a) / (b - y) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(y * x) + Float64(z * Float64(t - a))) / Float64(y - Float64(z * Float64(y - b)))) tmp = 0.0 if (t_1 <= -4e+307) tmp = Float64(Float64(Float64(a - t) / y) - Float64(x / Float64(z + -1.0))); elseif ((t_1 <= -1e-273) || (!(t_1 <= 0.0) && (t_1 <= 5e+305))) tmp = t_1; else tmp = Float64(Float64(t - a) / Float64(b - y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((y * x) + (z * (t - a))) / (y - (z * (y - b))); tmp = 0.0; if (t_1 <= -4e+307) tmp = ((a - t) / y) - (x / (z + -1.0)); elseif ((t_1 <= -1e-273) || (~((t_1 <= 0.0)) && (t_1 <= 5e+305))) tmp = t_1; else tmp = (t - a) / (b - y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y * x), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y - N[(z * N[(y - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+307], N[(N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision] - N[(x / N[(z + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t$95$1, -1e-273], And[N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision], LessEqual[t$95$1, 5e+305]]], t$95$1, N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot x + z \cdot \left(t - a\right)}{y - z \cdot \left(y - b\right)}\\
\mathbf{if}\;t_1 \leq -4 \cdot 10^{+307}:\\
\;\;\;\;\frac{a - t}{y} - \frac{x}{z + -1}\\
\mathbf{elif}\;t_1 \leq -1 \cdot 10^{-273} \lor \neg \left(t_1 \leq 0\right) \land t_1 \leq 5 \cdot 10^{+305}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b - y}\\
\end{array}
\end{array}
if (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -3.99999999999999994e307Initial program 49.1%
Taylor expanded in y around -inf 55.3%
mul-1-neg55.3%
unsub-neg55.3%
associate-*r/55.3%
neg-mul-155.3%
sub-neg55.3%
metadata-eval55.3%
Simplified59.3%
Taylor expanded in z around inf 70.9%
if -3.99999999999999994e307 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < -1e-273 or 0.0 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 5.00000000000000009e305Initial program 99.2%
if -1e-273 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) < 0.0 or 5.00000000000000009e305 < (/.f64 (+.f64 (*.f64 x y) (*.f64 z (-.f64 t a))) (+.f64 y (*.f64 z (-.f64 b y)))) Initial program 14.2%
Taylor expanded in z around inf 76.3%
Final simplification89.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- y (* z (- y b))))
(t_2 (/ (* z t) t_1))
(t_3 (/ (- t a) (- b y)))
(t_4 (/ (* z a) t_1)))
(if (<= z -2e+131)
t_3
(if (<= z -4.15e-45)
(- (+ t_2 (* (/ x z) (/ y (- b y)))) t_4)
(if (<= z 4.2e+41) (- (+ t_2 (/ (* y x) t_1)) t_4) t_3)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y - (z * (y - b));
double t_2 = (z * t) / t_1;
double t_3 = (t - a) / (b - y);
double t_4 = (z * a) / t_1;
double tmp;
if (z <= -2e+131) {
tmp = t_3;
} else if (z <= -4.15e-45) {
tmp = (t_2 + ((x / z) * (y / (b - y)))) - t_4;
} else if (z <= 4.2e+41) {
tmp = (t_2 + ((y * x) / t_1)) - t_4;
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = y - (z * (y - b))
t_2 = (z * t) / t_1
t_3 = (t - a) / (b - y)
t_4 = (z * a) / t_1
if (z <= (-2d+131)) then
tmp = t_3
else if (z <= (-4.15d-45)) then
tmp = (t_2 + ((x / z) * (y / (b - y)))) - t_4
else if (z <= 4.2d+41) then
tmp = (t_2 + ((y * x) / t_1)) - t_4
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y - (z * (y - b));
double t_2 = (z * t) / t_1;
double t_3 = (t - a) / (b - y);
double t_4 = (z * a) / t_1;
double tmp;
if (z <= -2e+131) {
tmp = t_3;
} else if (z <= -4.15e-45) {
tmp = (t_2 + ((x / z) * (y / (b - y)))) - t_4;
} else if (z <= 4.2e+41) {
tmp = (t_2 + ((y * x) / t_1)) - t_4;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y - (z * (y - b)) t_2 = (z * t) / t_1 t_3 = (t - a) / (b - y) t_4 = (z * a) / t_1 tmp = 0 if z <= -2e+131: tmp = t_3 elif z <= -4.15e-45: tmp = (t_2 + ((x / z) * (y / (b - y)))) - t_4 elif z <= 4.2e+41: tmp = (t_2 + ((y * x) / t_1)) - t_4 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y - Float64(z * Float64(y - b))) t_2 = Float64(Float64(z * t) / t_1) t_3 = Float64(Float64(t - a) / Float64(b - y)) t_4 = Float64(Float64(z * a) / t_1) tmp = 0.0 if (z <= -2e+131) tmp = t_3; elseif (z <= -4.15e-45) tmp = Float64(Float64(t_2 + Float64(Float64(x / z) * Float64(y / Float64(b - y)))) - t_4); elseif (z <= 4.2e+41) tmp = Float64(Float64(t_2 + Float64(Float64(y * x) / t_1)) - t_4); else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y - (z * (y - b)); t_2 = (z * t) / t_1; t_3 = (t - a) / (b - y); t_4 = (z * a) / t_1; tmp = 0.0; if (z <= -2e+131) tmp = t_3; elseif (z <= -4.15e-45) tmp = (t_2 + ((x / z) * (y / (b - y)))) - t_4; elseif (z <= 4.2e+41) tmp = (t_2 + ((y * x) / t_1)) - t_4; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y - N[(z * N[(y - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(z * t), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(z * a), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[z, -2e+131], t$95$3, If[LessEqual[z, -4.15e-45], N[(N[(t$95$2 + N[(N[(x / z), $MachinePrecision] * N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$4), $MachinePrecision], If[LessEqual[z, 4.2e+41], N[(N[(t$95$2 + N[(N[(y * x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] - t$95$4), $MachinePrecision], t$95$3]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y - z \cdot \left(y - b\right)\\
t_2 := \frac{z \cdot t}{t_1}\\
t_3 := \frac{t - a}{b - y}\\
t_4 := \frac{z \cdot a}{t_1}\\
\mathbf{if}\;z \leq -2 \cdot 10^{+131}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq -4.15 \cdot 10^{-45}:\\
\;\;\;\;\left(t_2 + \frac{x}{z} \cdot \frac{y}{b - y}\right) - t_4\\
\mathbf{elif}\;z \leq 4.2 \cdot 10^{+41}:\\
\;\;\;\;\left(t_2 + \frac{y \cdot x}{t_1}\right) - t_4\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if z < -1.9999999999999998e131 or 4.1999999999999999e41 < z Initial program 36.7%
Taylor expanded in z around inf 87.7%
if -1.9999999999999998e131 < z < -4.1500000000000002e-45Initial program 74.0%
Taylor expanded in t around 0 74.0%
Taylor expanded in z around inf 74.0%
times-frac88.6%
Simplified88.6%
if -4.1500000000000002e-45 < z < 4.1999999999999999e41Initial program 88.6%
Taylor expanded in t around 0 88.6%
Final simplification88.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- y (* z (- y b)))) (t_2 (/ (- t a) (- b y))))
(if (<= z -1e+131)
t_2
(if (<= z -4.15e-45)
(- (+ (/ (* z t) t_1) (* (/ x z) (/ y (- b y)))) (/ (* z a) t_1))
(if (<= z 3.8e+41) (/ (+ (* y x) (* z (- t a))) t_1) t_2)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y - (z * (y - b));
double t_2 = (t - a) / (b - y);
double tmp;
if (z <= -1e+131) {
tmp = t_2;
} else if (z <= -4.15e-45) {
tmp = (((z * t) / t_1) + ((x / z) * (y / (b - y)))) - ((z * a) / t_1);
} else if (z <= 3.8e+41) {
tmp = ((y * x) + (z * (t - a))) / 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 = y - (z * (y - b))
t_2 = (t - a) / (b - y)
if (z <= (-1d+131)) then
tmp = t_2
else if (z <= (-4.15d-45)) then
tmp = (((z * t) / t_1) + ((x / z) * (y / (b - y)))) - ((z * a) / t_1)
else if (z <= 3.8d+41) then
tmp = ((y * x) + (z * (t - a))) / 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 = y - (z * (y - b));
double t_2 = (t - a) / (b - y);
double tmp;
if (z <= -1e+131) {
tmp = t_2;
} else if (z <= -4.15e-45) {
tmp = (((z * t) / t_1) + ((x / z) * (y / (b - y)))) - ((z * a) / t_1);
} else if (z <= 3.8e+41) {
tmp = ((y * x) + (z * (t - a))) / t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y - (z * (y - b)) t_2 = (t - a) / (b - y) tmp = 0 if z <= -1e+131: tmp = t_2 elif z <= -4.15e-45: tmp = (((z * t) / t_1) + ((x / z) * (y / (b - y)))) - ((z * a) / t_1) elif z <= 3.8e+41: tmp = ((y * x) + (z * (t - a))) / t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y - Float64(z * Float64(y - b))) t_2 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -1e+131) tmp = t_2; elseif (z <= -4.15e-45) tmp = Float64(Float64(Float64(Float64(z * t) / t_1) + Float64(Float64(x / z) * Float64(y / Float64(b - y)))) - Float64(Float64(z * a) / t_1)); elseif (z <= 3.8e+41) tmp = Float64(Float64(Float64(y * x) + Float64(z * Float64(t - a))) / t_1); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y - (z * (y - b)); t_2 = (t - a) / (b - y); tmp = 0.0; if (z <= -1e+131) tmp = t_2; elseif (z <= -4.15e-45) tmp = (((z * t) / t_1) + ((x / z) * (y / (b - y)))) - ((z * a) / t_1); elseif (z <= 3.8e+41) tmp = ((y * x) + (z * (t - a))) / t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y - N[(z * N[(y - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1e+131], t$95$2, If[LessEqual[z, -4.15e-45], N[(N[(N[(N[(z * t), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(N[(x / z), $MachinePrecision] * N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(z * a), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.8e+41], N[(N[(N[(y * x), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y - z \cdot \left(y - b\right)\\
t_2 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -1 \cdot 10^{+131}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -4.15 \cdot 10^{-45}:\\
\;\;\;\;\left(\frac{z \cdot t}{t_1} + \frac{x}{z} \cdot \frac{y}{b - y}\right) - \frac{z \cdot a}{t_1}\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{+41}:\\
\;\;\;\;\frac{y \cdot x + z \cdot \left(t - a\right)}{t_1}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -9.9999999999999991e130 or 3.8000000000000001e41 < z Initial program 36.7%
Taylor expanded in z around inf 87.7%
if -9.9999999999999991e130 < z < -4.1500000000000002e-45Initial program 74.0%
Taylor expanded in t around 0 74.0%
Taylor expanded in z around inf 74.0%
times-frac88.6%
Simplified88.6%
if -4.1500000000000002e-45 < z < 3.8000000000000001e41Initial program 88.6%
Final simplification88.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) y)) (t_2 (/ (- t a) (- b y))))
(if (<= z -3.5e-31)
t_2
(if (<= z -9.5e-230)
(+ x (* z (- t_1 (/ x (/ y (- b y))))))
(if (<= z 9.5e-270)
(/ (+ (* y x) (* z (- t a))) y)
(if (<= z 1.1e-14) (+ x (* z t_1)) t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / y;
double t_2 = (t - a) / (b - y);
double tmp;
if (z <= -3.5e-31) {
tmp = t_2;
} else if (z <= -9.5e-230) {
tmp = x + (z * (t_1 - (x / (y / (b - y)))));
} else if (z <= 9.5e-270) {
tmp = ((y * x) + (z * (t - a))) / y;
} else if (z <= 1.1e-14) {
tmp = x + (z * 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) / y
t_2 = (t - a) / (b - y)
if (z <= (-3.5d-31)) then
tmp = t_2
else if (z <= (-9.5d-230)) then
tmp = x + (z * (t_1 - (x / (y / (b - y)))))
else if (z <= 9.5d-270) then
tmp = ((y * x) + (z * (t - a))) / y
else if (z <= 1.1d-14) then
tmp = x + (z * 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) / y;
double t_2 = (t - a) / (b - y);
double tmp;
if (z <= -3.5e-31) {
tmp = t_2;
} else if (z <= -9.5e-230) {
tmp = x + (z * (t_1 - (x / (y / (b - y)))));
} else if (z <= 9.5e-270) {
tmp = ((y * x) + (z * (t - a))) / y;
} else if (z <= 1.1e-14) {
tmp = x + (z * t_1);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / y t_2 = (t - a) / (b - y) tmp = 0 if z <= -3.5e-31: tmp = t_2 elif z <= -9.5e-230: tmp = x + (z * (t_1 - (x / (y / (b - y))))) elif z <= 9.5e-270: tmp = ((y * x) + (z * (t - a))) / y elif z <= 1.1e-14: tmp = x + (z * t_1) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / y) t_2 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -3.5e-31) tmp = t_2; elseif (z <= -9.5e-230) tmp = Float64(x + Float64(z * Float64(t_1 - Float64(x / Float64(y / Float64(b - y)))))); elseif (z <= 9.5e-270) tmp = Float64(Float64(Float64(y * x) + Float64(z * Float64(t - a))) / y); elseif (z <= 1.1e-14) tmp = Float64(x + Float64(z * t_1)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - a) / y; t_2 = (t - a) / (b - y); tmp = 0.0; if (z <= -3.5e-31) tmp = t_2; elseif (z <= -9.5e-230) tmp = x + (z * (t_1 - (x / (y / (b - y))))); elseif (z <= 9.5e-270) tmp = ((y * x) + (z * (t - a))) / y; elseif (z <= 1.1e-14) tmp = x + (z * 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] / y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.5e-31], t$95$2, If[LessEqual[z, -9.5e-230], N[(x + N[(z * N[(t$95$1 - N[(x / N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.5e-270], N[(N[(N[(y * x), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 1.1e-14], N[(x + N[(z * t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{y}\\
t_2 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -3.5 \cdot 10^{-31}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -9.5 \cdot 10^{-230}:\\
\;\;\;\;x + z \cdot \left(t_1 - \frac{x}{\frac{y}{b - y}}\right)\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{-270}:\\
\;\;\;\;\frac{y \cdot x + z \cdot \left(t - a\right)}{y}\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{-14}:\\
\;\;\;\;x + z \cdot t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -3.49999999999999985e-31 or 1.1e-14 < z Initial program 50.7%
Taylor expanded in z around inf 82.0%
if -3.49999999999999985e-31 < z < -9.5000000000000004e-230Initial program 77.9%
Taylor expanded in t around 0 77.9%
Taylor expanded in z around 0 66.9%
+-commutative66.9%
mul-1-neg66.9%
sub-neg66.9%
div-sub67.0%
associate-/l*83.7%
Simplified83.7%
if -9.5000000000000004e-230 < z < 9.5000000000000006e-270Initial program 95.9%
Taylor expanded in z around 0 84.3%
if 9.5000000000000006e-270 < z < 1.1e-14Initial program 88.5%
Taylor expanded in y around inf 60.9%
mul-1-neg60.9%
unsub-neg60.9%
Simplified60.9%
Taylor expanded in z around 0 67.6%
associate--r+67.6%
cancel-sign-sub-inv67.6%
metadata-eval67.6%
*-lft-identity67.6%
Simplified67.6%
Taylor expanded in x around 0 67.6%
div-sub67.7%
Simplified67.7%
Final simplification78.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -3.5e-31) (not (<= z 3.6e-15))) (/ (- 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 <= -3.5e-31) || !(z <= 3.6e-15)) {
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 <= (-3.5d-31)) .or. (.not. (z <= 3.6d-15))) 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 <= -3.5e-31) || !(z <= 3.6e-15)) {
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 <= -3.5e-31) or not (z <= 3.6e-15): 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 <= -3.5e-31) || !(z <= 3.6e-15)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(x + Float64(z * Float64(Float64(t - a) / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -3.5e-31) || ~((z <= 3.6e-15))) 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, -3.5e-31], N[Not[LessEqual[z, 3.6e-15]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(N[(t - a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{-31} \lor \neg \left(z \leq 3.6 \cdot 10^{-15}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{t - a}{y}\\
\end{array}
\end{array}
if z < -3.49999999999999985e-31 or 3.6000000000000001e-15 < z Initial program 50.7%
Taylor expanded in z around inf 82.0%
if -3.49999999999999985e-31 < z < 3.6000000000000001e-15Initial program 87.4%
Taylor expanded in y around inf 66.6%
mul-1-neg66.6%
unsub-neg66.6%
Simplified66.6%
Taylor expanded in z around 0 71.6%
associate--r+71.6%
cancel-sign-sub-inv71.6%
metadata-eval71.6%
*-lft-identity71.6%
Simplified71.6%
Taylor expanded in x around 0 71.6%
div-sub71.7%
Simplified71.7%
Final simplification77.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (- 1.0 z))))
(if (<= y -2.2e-72)
t_1
(if (<= y 4.1e-240) (/ t b) (if (<= y 2.5e-78) (/ (- a) b) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (1.0 - z);
double tmp;
if (y <= -2.2e-72) {
tmp = t_1;
} else if (y <= 4.1e-240) {
tmp = t / b;
} else if (y <= 2.5e-78) {
tmp = -a / b;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x / (1.0d0 - z)
if (y <= (-2.2d-72)) then
tmp = t_1
else if (y <= 4.1d-240) then
tmp = t / b
else if (y <= 2.5d-78) then
tmp = -a / b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (1.0 - z);
double tmp;
if (y <= -2.2e-72) {
tmp = t_1;
} else if (y <= 4.1e-240) {
tmp = t / b;
} else if (y <= 2.5e-78) {
tmp = -a / b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (1.0 - z) tmp = 0 if y <= -2.2e-72: tmp = t_1 elif y <= 4.1e-240: tmp = t / b elif y <= 2.5e-78: tmp = -a / b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(1.0 - z)) tmp = 0.0 if (y <= -2.2e-72) tmp = t_1; elseif (y <= 4.1e-240) tmp = Float64(t / b); elseif (y <= 2.5e-78) tmp = Float64(Float64(-a) / b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x / (1.0 - z); tmp = 0.0; if (y <= -2.2e-72) tmp = t_1; elseif (y <= 4.1e-240) tmp = t / b; elseif (y <= 2.5e-78) tmp = -a / b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.2e-72], t$95$1, If[LessEqual[y, 4.1e-240], N[(t / b), $MachinePrecision], If[LessEqual[y, 2.5e-78], N[((-a) / b), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{1 - z}\\
\mathbf{if}\;y \leq -2.2 \cdot 10^{-72}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 4.1 \cdot 10^{-240}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{-78}:\\
\;\;\;\;\frac{-a}{b}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < -2.20000000000000002e-72 or 2.4999999999999998e-78 < y Initial program 58.3%
Taylor expanded in y around inf 48.6%
mul-1-neg48.6%
unsub-neg48.6%
Simplified48.6%
if -2.20000000000000002e-72 < y < 4.1000000000000001e-240Initial program 81.9%
Taylor expanded in t around 0 81.8%
Taylor expanded in b around inf 76.0%
mul-1-neg76.0%
associate-+r+76.0%
sub-neg76.0%
associate-/l*76.0%
Simplified76.0%
Taylor expanded in t around inf 47.0%
if 4.1000000000000001e-240 < y < 2.4999999999999998e-78Initial program 81.5%
Taylor expanded in t around 0 78.3%
Taylor expanded in b around inf 66.5%
mul-1-neg66.5%
associate-+r+66.5%
sub-neg66.5%
associate-/l*63.6%
Simplified63.6%
Taylor expanded in a around inf 48.1%
associate-*r/48.1%
mul-1-neg48.1%
Simplified48.1%
Final simplification48.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.28e-77) (not (<= z 4.4e-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.28e-77) || !(z <= 4.4e-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.28d-77)) .or. (.not. (z <= 4.4d-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.28e-77) || !(z <= 4.4e-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.28e-77) or not (z <= 4.4e-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.28e-77) || !(z <= 4.4e-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.28e-77) || ~((z <= 4.4e-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.28e-77], N[Not[LessEqual[z, 4.4e-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.28 \cdot 10^{-77} \lor \neg \left(z \leq 4.4 \cdot 10^{-15}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{1 - z}\\
\end{array}
\end{array}
if z < -1.28e-77 or 4.39999999999999971e-15 < z Initial program 51.7%
Taylor expanded in z around inf 80.0%
if -1.28e-77 < z < 4.39999999999999971e-15Initial program 87.7%
Taylor expanded in y around inf 60.1%
mul-1-neg60.1%
unsub-neg60.1%
Simplified60.1%
Final simplification71.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -9e-32) (not (<= z 1.45e-15))) (/ (- t a) (- b y)) (- x (/ a (/ y z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -9e-32) || !(z <= 1.45e-15)) {
tmp = (t - a) / (b - y);
} else {
tmp = x - (a / (y / 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 <= (-9d-32)) .or. (.not. (z <= 1.45d-15))) then
tmp = (t - a) / (b - y)
else
tmp = x - (a / (y / 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 <= -9e-32) || !(z <= 1.45e-15)) {
tmp = (t - a) / (b - y);
} else {
tmp = x - (a / (y / z));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -9e-32) or not (z <= 1.45e-15): tmp = (t - a) / (b - y) else: tmp = x - (a / (y / z)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -9e-32) || !(z <= 1.45e-15)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(x - Float64(a / Float64(y / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -9e-32) || ~((z <= 1.45e-15))) tmp = (t - a) / (b - y); else tmp = x - (a / (y / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -9e-32], N[Not[LessEqual[z, 1.45e-15]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(x - N[(a / N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{-32} \lor \neg \left(z \leq 1.45 \cdot 10^{-15}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{a}{\frac{y}{z}}\\
\end{array}
\end{array}
if z < -9.00000000000000009e-32 or 1.45000000000000009e-15 < z Initial program 50.7%
Taylor expanded in z around inf 82.0%
if -9.00000000000000009e-32 < z < 1.45000000000000009e-15Initial program 87.4%
Taylor expanded in y around inf 66.6%
mul-1-neg66.6%
unsub-neg66.6%
Simplified66.6%
Taylor expanded in z around 0 71.6%
associate--r+71.6%
cancel-sign-sub-inv71.6%
metadata-eval71.6%
*-lft-identity71.6%
Simplified71.6%
Taylor expanded in a around inf 72.2%
mul-1-neg72.2%
associate-/l*69.5%
distribute-neg-frac69.5%
Simplified69.5%
Final simplification76.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.05e+55) (not (<= y 1.48e-77))) (/ x (- 1.0 z)) (/ (- t a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.05e+55) || !(y <= 1.48e-77)) {
tmp = x / (1.0 - z);
} else {
tmp = (t - a) / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-2.05d+55)) .or. (.not. (y <= 1.48d-77))) then
tmp = x / (1.0d0 - z)
else
tmp = (t - a) / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.05e+55) || !(y <= 1.48e-77)) {
tmp = x / (1.0 - z);
} else {
tmp = (t - a) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -2.05e+55) or not (y <= 1.48e-77): tmp = x / (1.0 - z) else: tmp = (t - a) / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2.05e+55) || !(y <= 1.48e-77)) tmp = Float64(x / Float64(1.0 - z)); else tmp = Float64(Float64(t - a) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -2.05e+55) || ~((y <= 1.48e-77))) tmp = x / (1.0 - z); else tmp = (t - a) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -2.05e+55], N[Not[LessEqual[y, 1.48e-77]], $MachinePrecision]], N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision], N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.05 \cdot 10^{+55} \lor \neg \left(y \leq 1.48 \cdot 10^{-77}\right):\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b}\\
\end{array}
\end{array}
if y < -2.04999999999999991e55 or 1.48000000000000002e-77 < y Initial program 53.7%
Taylor expanded in y around inf 51.7%
mul-1-neg51.7%
unsub-neg51.7%
Simplified51.7%
if -2.04999999999999991e55 < y < 1.48000000000000002e-77Initial program 81.7%
Taylor expanded in y around 0 59.0%
Final simplification55.3%
(FPCore (x y z t a b) :precision binary64 (if (<= z -4.3e-72) (/ t b) (if (<= z 1.3e-15) x (/ (- a) b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.3e-72) {
tmp = t / b;
} else if (z <= 1.3e-15) {
tmp = x;
} else {
tmp = -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 (z <= (-4.3d-72)) then
tmp = t / b
else if (z <= 1.3d-15) then
tmp = x
else
tmp = -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 (z <= -4.3e-72) {
tmp = t / b;
} else if (z <= 1.3e-15) {
tmp = x;
} else {
tmp = -a / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -4.3e-72: tmp = t / b elif z <= 1.3e-15: tmp = x else: tmp = -a / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -4.3e-72) tmp = Float64(t / b); elseif (z <= 1.3e-15) tmp = x; else tmp = Float64(Float64(-a) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -4.3e-72) tmp = t / b; elseif (z <= 1.3e-15) tmp = x; else tmp = -a / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4.3e-72], N[(t / b), $MachinePrecision], If[LessEqual[z, 1.3e-15], x, N[((-a) / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.3 \cdot 10^{-72}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{-15}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{-a}{b}\\
\end{array}
\end{array}
if z < -4.2999999999999999e-72Initial program 59.4%
Taylor expanded in t around 0 59.4%
Taylor expanded in b around inf 55.4%
mul-1-neg55.4%
associate-+r+55.4%
sub-neg55.4%
associate-/l*55.4%
Simplified55.4%
Taylor expanded in t around inf 32.6%
if -4.2999999999999999e-72 < z < 1.30000000000000002e-15Initial program 87.7%
Taylor expanded in z around 0 60.1%
if 1.30000000000000002e-15 < z Initial program 40.1%
Taylor expanded in t around 0 38.2%
Taylor expanded in b around inf 42.7%
mul-1-neg42.7%
associate-+r+42.7%
sub-neg42.7%
associate-/l*41.9%
Simplified41.9%
Taylor expanded in a around inf 20.7%
associate-*r/20.7%
mul-1-neg20.7%
Simplified20.7%
Final simplification42.1%
(FPCore (x y z t a b) :precision binary64 (if (<= z -1.96e-72) (/ t b) (if (<= z 1.0) x (/ (- t) y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.96e-72) {
tmp = t / b;
} else if (z <= 1.0) {
tmp = x;
} else {
tmp = -t / y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-1.96d-72)) then
tmp = t / b
else if (z <= 1.0d0) then
tmp = x
else
tmp = -t / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.96e-72) {
tmp = t / b;
} else if (z <= 1.0) {
tmp = x;
} else {
tmp = -t / y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.96e-72: tmp = t / b elif z <= 1.0: tmp = x else: tmp = -t / y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.96e-72) tmp = Float64(t / b); elseif (z <= 1.0) tmp = x; else tmp = Float64(Float64(-t) / y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -1.96e-72) tmp = t / b; elseif (z <= 1.0) tmp = x; else tmp = -t / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.96e-72], N[(t / b), $MachinePrecision], If[LessEqual[z, 1.0], x, N[((-t) / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.96 \cdot 10^{-72}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{-t}{y}\\
\end{array}
\end{array}
if z < -1.96000000000000011e-72Initial program 59.4%
Taylor expanded in t around 0 59.4%
Taylor expanded in b around inf 55.4%
mul-1-neg55.4%
associate-+r+55.4%
sub-neg55.4%
associate-/l*55.4%
Simplified55.4%
Taylor expanded in t around inf 32.6%
if -1.96000000000000011e-72 < z < 1Initial program 87.9%
Taylor expanded in z around 0 59.2%
if 1 < z Initial program 38.0%
Taylor expanded in y around inf 20.6%
mul-1-neg20.6%
unsub-neg20.6%
Simplified20.6%
Taylor expanded in x around 0 17.3%
times-frac43.9%
Simplified43.9%
Taylor expanded in t around inf 33.2%
Taylor expanded in z around inf 33.2%
associate-*r/33.2%
mul-1-neg33.2%
Simplified33.2%
Final simplification44.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -4.3e-72) (not (<= z 62.0))) (/ t b) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -4.3e-72) || !(z <= 62.0)) {
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 <= (-4.3d-72)) .or. (.not. (z <= 62.0d0))) 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 <= -4.3e-72) || !(z <= 62.0)) {
tmp = t / b;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -4.3e-72) or not (z <= 62.0): tmp = t / b else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -4.3e-72) || !(z <= 62.0)) 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 <= -4.3e-72) || ~((z <= 62.0))) tmp = t / b; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -4.3e-72], N[Not[LessEqual[z, 62.0]], $MachinePrecision]], N[(t / b), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.3 \cdot 10^{-72} \lor \neg \left(z \leq 62\right):\\
\;\;\;\;\frac{t}{b}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -4.2999999999999999e-72 or 62 < z Initial program 50.7%
Taylor expanded in t around 0 49.9%
Taylor expanded in b around inf 50.0%
mul-1-neg50.0%
associate-+r+50.0%
sub-neg50.0%
associate-/l*49.6%
Simplified49.6%
Taylor expanded in t around inf 28.2%
if -4.2999999999999999e-72 < z < 62Initial program 88.0%
Taylor expanded in z around 0 58.7%
Final simplification42.0%
(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 67.6%
Taylor expanded in z around 0 28.8%
Final simplification28.8%
(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 2023320
(FPCore (x y z t a b)
:name "Development.Shake.Progress:decay from shake-0.15.5"
:precision binary64
:herbie-target
(- (/ (+ (* z t) (* y x)) (+ y (* z (- b y)))) (/ a (+ (- b y) (/ y z))))
(/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))