
(FPCore (x y z t a b) :precision binary64 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
def code(x, y, z, t, a, b): return ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (+ (* x y) (* z (- t a))) (+ y (* z (- b y)))))
double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * y) + (z * (t - a))) / (y + (z * (b - y)));
}
def code(x, y, z, t, a, b): return ((x * y) + (z * (t - a))) / (y + (z * (b - y)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x * y) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))) end
function tmp = code(x, y, z, t, a, b) tmp = ((x * y) + (z * (t - a))) / (y + (z * (b - y))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (* z (- b y)))))
(if (or (<= z -1.35e+60) (not (<= z 26000000000000.0)))
(+
(/ (+ (* x (/ y (- b y))) (* y (/ (- a t) (pow (- b y) 2.0)))) z)
(/ (- t a) (- b y)))
(+ (/ (* x y) t_1) (/ (* z (- t a)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (z * (b - y));
double tmp;
if ((z <= -1.35e+60) || !(z <= 26000000000000.0)) {
tmp = (((x * (y / (b - y))) + (y * ((a - t) / pow((b - y), 2.0)))) / z) + ((t - a) / (b - y));
} else {
tmp = ((x * y) / t_1) + ((z * (t - a)) / t_1);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = y + (z * (b - y))
if ((z <= (-1.35d+60)) .or. (.not. (z <= 26000000000000.0d0))) then
tmp = (((x * (y / (b - y))) + (y * ((a - t) / ((b - y) ** 2.0d0)))) / z) + ((t - a) / (b - y))
else
tmp = ((x * y) / t_1) + ((z * (t - a)) / t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (z * (b - y));
double tmp;
if ((z <= -1.35e+60) || !(z <= 26000000000000.0)) {
tmp = (((x * (y / (b - y))) + (y * ((a - t) / Math.pow((b - y), 2.0)))) / z) + ((t - a) / (b - y));
} else {
tmp = ((x * y) / t_1) + ((z * (t - a)) / t_1);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (z * (b - y)) tmp = 0 if (z <= -1.35e+60) or not (z <= 26000000000000.0): tmp = (((x * (y / (b - y))) + (y * ((a - t) / math.pow((b - y), 2.0)))) / z) + ((t - a) / (b - y)) else: tmp = ((x * y) / t_1) + ((z * (t - a)) / t_1) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(z * Float64(b - y))) tmp = 0.0 if ((z <= -1.35e+60) || !(z <= 26000000000000.0)) tmp = Float64(Float64(Float64(Float64(x * Float64(y / Float64(b - y))) + Float64(y * Float64(Float64(a - t) / (Float64(b - y) ^ 2.0)))) / z) + Float64(Float64(t - a) / Float64(b - y))); else tmp = Float64(Float64(Float64(x * y) / t_1) + Float64(Float64(z * Float64(t - a)) / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (z * (b - y)); tmp = 0.0; if ((z <= -1.35e+60) || ~((z <= 26000000000000.0))) tmp = (((x * (y / (b - y))) + (y * ((a - t) / ((b - y) ^ 2.0)))) / z) + ((t - a) / (b - y)); else tmp = ((x * y) / t_1) + ((z * (t - a)) / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[z, -1.35e+60], N[Not[LessEqual[z, 26000000000000.0]], $MachinePrecision]], N[(N[(N[(N[(x * N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * N[(N[(a - t), $MachinePrecision] / N[Power[N[(b - y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision] + N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + z \cdot \left(b - y\right)\\
\mathbf{if}\;z \leq -1.35 \cdot 10^{+60} \lor \neg \left(z \leq 26000000000000\right):\\
\;\;\;\;\frac{x \cdot \frac{y}{b - y} + y \cdot \frac{a - t}{{\left(b - y\right)}^{2}}}{z} + \frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{t\_1} + \frac{z \cdot \left(t - a\right)}{t\_1}\\
\end{array}
\end{array}
if z < -1.35e60 or 2.6e13 < z Initial program 38.1%
Taylor expanded in z around -inf 67.8%
associate--l+67.8%
mul-1-neg67.8%
distribute-lft-out--67.8%
associate-/l*71.3%
associate-/l*94.7%
div-sub95.6%
Simplified95.6%
if -1.35e60 < z < 2.6e13Initial program 87.4%
Taylor expanded in x around 0 87.4%
Final simplification91.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (* z (- b y)))))
(if (<= z -2e+15)
(+ (/ t (- b y)) (/ a (- y b)))
(if (<= z 8.5e+29)
(+ (/ (* x y) t_1) (/ (* z (- t a)) t_1))
(/ (- t a) (- b y))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (z * (b - y));
double tmp;
if (z <= -2e+15) {
tmp = (t / (b - y)) + (a / (y - b));
} else if (z <= 8.5e+29) {
tmp = ((x * y) / t_1) + ((z * (t - a)) / 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 + (z * (b - y))
if (z <= (-2d+15)) then
tmp = (t / (b - y)) + (a / (y - b))
else if (z <= 8.5d+29) then
tmp = ((x * y) / t_1) + ((z * (t - a)) / 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 + (z * (b - y));
double tmp;
if (z <= -2e+15) {
tmp = (t / (b - y)) + (a / (y - b));
} else if (z <= 8.5e+29) {
tmp = ((x * y) / t_1) + ((z * (t - a)) / t_1);
} else {
tmp = (t - a) / (b - y);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (z * (b - y)) tmp = 0 if z <= -2e+15: tmp = (t / (b - y)) + (a / (y - b)) elif z <= 8.5e+29: tmp = ((x * y) / t_1) + ((z * (t - a)) / t_1) else: tmp = (t - a) / (b - y) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(z * Float64(b - y))) tmp = 0.0 if (z <= -2e+15) tmp = Float64(Float64(t / Float64(b - y)) + Float64(a / Float64(y - b))); elseif (z <= 8.5e+29) tmp = Float64(Float64(Float64(x * y) / t_1) + Float64(Float64(z * Float64(t - a)) / 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 + (z * (b - y)); tmp = 0.0; if (z <= -2e+15) tmp = (t / (b - y)) + (a / (y - b)); elseif (z <= 8.5e+29) tmp = ((x * y) / t_1) + ((z * (t - a)) / 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[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2e+15], N[(N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision] + N[(a / N[(y - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.5e+29], N[(N[(N[(x * y), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + z \cdot \left(b - y\right)\\
\mathbf{if}\;z \leq -2 \cdot 10^{+15}:\\
\;\;\;\;\frac{t}{b - y} + \frac{a}{y - b}\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{+29}:\\
\;\;\;\;\frac{x \cdot y}{t\_1} + \frac{z \cdot \left(t - a\right)}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b - y}\\
\end{array}
\end{array}
if z < -2e15Initial program 37.1%
Taylor expanded in z around inf 80.6%
Taylor expanded in t around 0 80.6%
+-commutative80.6%
mul-1-neg80.6%
sub-neg80.6%
Simplified80.6%
if -2e15 < z < 8.5000000000000006e29Initial program 88.1%
Taylor expanded in x around 0 88.1%
if 8.5000000000000006e29 < z Initial program 37.4%
Taylor expanded in z around inf 87.4%
Final simplification86.3%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -2e+15)
(- (/ t (- b y)) (/ a (- b y)))
(if (<= z 9e+29)
(/ (- (* x y) (* z (- a t))) (+ y (* z (- b y))))
(/ (- t a) (- b y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -2e+15) {
tmp = (t / (b - y)) - (a / (b - y));
} else if (z <= 9e+29) {
tmp = ((x * y) - (z * (a - t))) / (y + (z * (b - y)));
} 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) :: tmp
if (z <= (-2d+15)) then
tmp = (t / (b - y)) - (a / (b - y))
else if (z <= 9d+29) then
tmp = ((x * y) - (z * (a - t))) / (y + (z * (b - y)))
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 tmp;
if (z <= -2e+15) {
tmp = (t / (b - y)) - (a / (b - y));
} else if (z <= 9e+29) {
tmp = ((x * y) - (z * (a - t))) / (y + (z * (b - y)));
} else {
tmp = (t - a) / (b - y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -2e+15: tmp = (t / (b - y)) - (a / (b - y)) elif z <= 9e+29: tmp = ((x * y) - (z * (a - t))) / (y + (z * (b - y))) else: tmp = (t - a) / (b - y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -2e+15) tmp = Float64(Float64(t / Float64(b - y)) - Float64(a / Float64(b - y))); elseif (z <= 9e+29) tmp = Float64(Float64(Float64(x * y) - Float64(z * Float64(a - t))) / Float64(y + Float64(z * Float64(b - y)))); else tmp = Float64(Float64(t - a) / Float64(b - y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -2e+15) tmp = (t / (b - y)) - (a / (b - y)); elseif (z <= 9e+29) tmp = ((x * y) - (z * (a - t))) / (y + (z * (b - y))); else tmp = (t - a) / (b - y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -2e+15], N[(N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision] - N[(a / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9e+29], N[(N[(N[(x * y), $MachinePrecision] - N[(z * N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+15}:\\
\;\;\;\;\frac{t}{b - y} - \frac{a}{b - y}\\
\mathbf{elif}\;z \leq 9 \cdot 10^{+29}:\\
\;\;\;\;\frac{x \cdot y - z \cdot \left(a - t\right)}{y + z \cdot \left(b - y\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b - y}\\
\end{array}
\end{array}
if z < -2e15Initial program 37.1%
Taylor expanded in z around inf 80.6%
Taylor expanded in t around 0 80.6%
+-commutative80.6%
mul-1-neg80.6%
sub-neg80.6%
Simplified80.6%
if -2e15 < z < 9.0000000000000005e29Initial program 88.1%
if 9.0000000000000005e29 < z Initial program 37.4%
Taylor expanded in z around inf 87.4%
Final simplification86.2%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -1.18e-14)
(+ (/ t (- b y)) (/ a (- y b)))
(if (<= z 2e-17)
(+ x (/ (* z (- t (+ a (* x b)))) y))
(/ (- t a) (- b y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.18e-14) {
tmp = (t / (b - y)) + (a / (y - b));
} else if (z <= 2e-17) {
tmp = x + ((z * (t - (a + (x * b)))) / y);
} 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) :: tmp
if (z <= (-1.18d-14)) then
tmp = (t / (b - y)) + (a / (y - b))
else if (z <= 2d-17) then
tmp = x + ((z * (t - (a + (x * b)))) / y)
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 tmp;
if (z <= -1.18e-14) {
tmp = (t / (b - y)) + (a / (y - b));
} else if (z <= 2e-17) {
tmp = x + ((z * (t - (a + (x * b)))) / y);
} else {
tmp = (t - a) / (b - y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.18e-14: tmp = (t / (b - y)) + (a / (y - b)) elif z <= 2e-17: tmp = x + ((z * (t - (a + (x * b)))) / y) else: tmp = (t - a) / (b - y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.18e-14) tmp = Float64(Float64(t / Float64(b - y)) + Float64(a / Float64(y - b))); elseif (z <= 2e-17) tmp = Float64(x + Float64(Float64(z * Float64(t - Float64(a + Float64(x * b)))) / y)); else tmp = Float64(Float64(t - a) / Float64(b - y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -1.18e-14) tmp = (t / (b - y)) + (a / (y - b)); elseif (z <= 2e-17) tmp = x + ((z * (t - (a + (x * b)))) / y); else tmp = (t - a) / (b - y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.18e-14], N[(N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision] + N[(a / N[(y - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2e-17], N[(x + N[(N[(z * N[(t - N[(a + N[(x * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.18 \cdot 10^{-14}:\\
\;\;\;\;\frac{t}{b - y} + \frac{a}{y - b}\\
\mathbf{elif}\;z \leq 2 \cdot 10^{-17}:\\
\;\;\;\;x + \frac{z \cdot \left(t - \left(a + x \cdot b\right)\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b - y}\\
\end{array}
\end{array}
if z < -1.17999999999999993e-14Initial program 45.4%
Taylor expanded in z around inf 77.9%
Taylor expanded in t around 0 77.9%
+-commutative77.9%
mul-1-neg77.9%
sub-neg77.9%
Simplified77.9%
if -1.17999999999999993e-14 < z < 2.00000000000000014e-17Initial program 87.2%
Taylor expanded in z around 0 53.5%
Taylor expanded in y around 0 71.6%
if 2.00000000000000014e-17 < z Initial program 45.1%
Taylor expanded in z around inf 86.1%
Final simplification76.7%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -1.9e-11)
(+ (/ t (- b y)) (/ a (- y b)))
(if (<= z -1.1e-139)
(+ x (* z (/ t y)))
(if (<= z 3.7e-19) (- x (/ (* z a) y)) (/ (- t a) (- b y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.9e-11) {
tmp = (t / (b - y)) + (a / (y - b));
} else if (z <= -1.1e-139) {
tmp = x + (z * (t / y));
} else if (z <= 3.7e-19) {
tmp = x - ((z * a) / y);
} 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) :: tmp
if (z <= (-1.9d-11)) then
tmp = (t / (b - y)) + (a / (y - b))
else if (z <= (-1.1d-139)) then
tmp = x + (z * (t / y))
else if (z <= 3.7d-19) then
tmp = x - ((z * a) / y)
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 tmp;
if (z <= -1.9e-11) {
tmp = (t / (b - y)) + (a / (y - b));
} else if (z <= -1.1e-139) {
tmp = x + (z * (t / y));
} else if (z <= 3.7e-19) {
tmp = x - ((z * a) / y);
} else {
tmp = (t - a) / (b - y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.9e-11: tmp = (t / (b - y)) + (a / (y - b)) elif z <= -1.1e-139: tmp = x + (z * (t / y)) elif z <= 3.7e-19: tmp = x - ((z * a) / y) else: tmp = (t - a) / (b - y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.9e-11) tmp = Float64(Float64(t / Float64(b - y)) + Float64(a / Float64(y - b))); elseif (z <= -1.1e-139) tmp = Float64(x + Float64(z * Float64(t / y))); elseif (z <= 3.7e-19) tmp = Float64(x - Float64(Float64(z * a) / y)); else tmp = Float64(Float64(t - a) / Float64(b - y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -1.9e-11) tmp = (t / (b - y)) + (a / (y - b)); elseif (z <= -1.1e-139) tmp = x + (z * (t / y)); elseif (z <= 3.7e-19) tmp = x - ((z * a) / y); else tmp = (t - a) / (b - y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.9e-11], N[(N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision] + N[(a / N[(y - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.1e-139], N[(x + N[(z * N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.7e-19], N[(x - N[(N[(z * a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{-11}:\\
\;\;\;\;\frac{t}{b - y} + \frac{a}{y - b}\\
\mathbf{elif}\;z \leq -1.1 \cdot 10^{-139}:\\
\;\;\;\;x + z \cdot \frac{t}{y}\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{-19}:\\
\;\;\;\;x - \frac{z \cdot a}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b - y}\\
\end{array}
\end{array}
if z < -1.8999999999999999e-11Initial program 44.6%
Taylor expanded in z around inf 79.0%
Taylor expanded in t around 0 79.0%
+-commutative79.0%
mul-1-neg79.0%
sub-neg79.0%
Simplified79.0%
if -1.8999999999999999e-11 < z < -1.10000000000000005e-139Initial program 81.7%
Taylor expanded in z around 0 48.4%
Taylor expanded in t around inf 65.4%
if -1.10000000000000005e-139 < z < 3.70000000000000005e-19Initial program 89.1%
Taylor expanded in z around 0 54.6%
Taylor expanded in a around inf 62.6%
associate-*r/62.6%
associate-*r*62.6%
mul-1-neg62.6%
Simplified62.6%
if 3.70000000000000005e-19 < z Initial program 45.1%
Taylor expanded in z around inf 86.1%
Final simplification72.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -1.75e-10)
t_1
(if (<= z -4.1e-140)
(+ x (* z (/ t y)))
(if (<= z 1.4e-18) (- x (/ (* z a) y)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -1.75e-10) {
tmp = t_1;
} else if (z <= -4.1e-140) {
tmp = x + (z * (t / y));
} else if (z <= 1.4e-18) {
tmp = x - ((z * a) / y);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (t - a) / (b - y)
if (z <= (-1.75d-10)) then
tmp = t_1
else if (z <= (-4.1d-140)) then
tmp = x + (z * (t / y))
else if (z <= 1.4d-18) then
tmp = x - ((z * a) / y)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / (b - y);
double tmp;
if (z <= -1.75e-10) {
tmp = t_1;
} else if (z <= -4.1e-140) {
tmp = x + (z * (t / y));
} else if (z <= 1.4e-18) {
tmp = x - ((z * a) / y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / (b - y) tmp = 0 if z <= -1.75e-10: tmp = t_1 elif z <= -4.1e-140: tmp = x + (z * (t / y)) elif z <= 1.4e-18: tmp = x - ((z * a) / y) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -1.75e-10) tmp = t_1; elseif (z <= -4.1e-140) tmp = Float64(x + Float64(z * Float64(t / y))); elseif (z <= 1.4e-18) tmp = Float64(x - Float64(Float64(z * a) / y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - a) / (b - y); tmp = 0.0; if (z <= -1.75e-10) tmp = t_1; elseif (z <= -4.1e-140) tmp = x + (z * (t / y)); elseif (z <= 1.4e-18) tmp = x - ((z * a) / y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.75e-10], t$95$1, If[LessEqual[z, -4.1e-140], N[(x + N[(z * N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.4e-18], N[(x - N[(N[(z * a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -1.75 \cdot 10^{-10}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -4.1 \cdot 10^{-140}:\\
\;\;\;\;x + z \cdot \frac{t}{y}\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-18}:\\
\;\;\;\;x - \frac{z \cdot a}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.7499999999999999e-10 or 1.40000000000000006e-18 < z Initial program 44.8%
Taylor expanded in z around inf 82.4%
if -1.7499999999999999e-10 < z < -4.1000000000000001e-140Initial program 81.7%
Taylor expanded in z around 0 48.4%
Taylor expanded in t around inf 65.4%
if -4.1000000000000001e-140 < z < 1.40000000000000006e-18Initial program 89.1%
Taylor expanded in z around 0 54.6%
Taylor expanded in a around inf 62.6%
associate-*r/62.6%
associate-*r*62.6%
mul-1-neg62.6%
Simplified62.6%
Final simplification72.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) b)))
(if (<= z -1.9e-12)
t_1
(if (<= z 6.1e-21)
(+ x (* z (/ t y)))
(if (<= z 1.5e+267) t_1 (/ (- a t) y))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / b;
double tmp;
if (z <= -1.9e-12) {
tmp = t_1;
} else if (z <= 6.1e-21) {
tmp = x + (z * (t / y));
} else if (z <= 1.5e+267) {
tmp = t_1;
} else {
tmp = (a - t) / y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (t - a) / b
if (z <= (-1.9d-12)) then
tmp = t_1
else if (z <= 6.1d-21) then
tmp = x + (z * (t / y))
else if (z <= 1.5d+267) then
tmp = t_1
else
tmp = (a - t) / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - a) / b;
double tmp;
if (z <= -1.9e-12) {
tmp = t_1;
} else if (z <= 6.1e-21) {
tmp = x + (z * (t / y));
} else if (z <= 1.5e+267) {
tmp = t_1;
} else {
tmp = (a - t) / y;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - a) / b tmp = 0 if z <= -1.9e-12: tmp = t_1 elif z <= 6.1e-21: tmp = x + (z * (t / y)) elif z <= 1.5e+267: tmp = t_1 else: tmp = (a - t) / y return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - a) / b) tmp = 0.0 if (z <= -1.9e-12) tmp = t_1; elseif (z <= 6.1e-21) tmp = Float64(x + Float64(z * Float64(t / y))); elseif (z <= 1.5e+267) tmp = t_1; else tmp = Float64(Float64(a - t) / y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - a) / b; tmp = 0.0; if (z <= -1.9e-12) tmp = t_1; elseif (z <= 6.1e-21) tmp = x + (z * (t / y)); elseif (z <= 1.5e+267) tmp = t_1; else tmp = (a - t) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision]}, If[LessEqual[z, -1.9e-12], t$95$1, If[LessEqual[z, 6.1e-21], N[(x + N[(z * N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.5e+267], t$95$1, N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b}\\
\mathbf{if}\;z \leq -1.9 \cdot 10^{-12}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6.1 \cdot 10^{-21}:\\
\;\;\;\;x + z \cdot \frac{t}{y}\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{+267}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{a - t}{y}\\
\end{array}
\end{array}
if z < -1.89999999999999998e-12 or 6.10000000000000013e-21 < z < 1.5e267Initial program 49.3%
Taylor expanded in y around 0 55.5%
if -1.89999999999999998e-12 < z < 6.10000000000000013e-21Initial program 87.2%
Taylor expanded in z around 0 52.7%
Taylor expanded in t around inf 59.6%
if 1.5e267 < z Initial program 9.5%
Taylor expanded in z around inf 93.2%
Taylor expanded in b around 0 63.8%
mul-1-neg63.8%
distribute-neg-frac263.8%
Simplified63.8%
Final simplification57.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -5.5e-9) (not (<= z 1.52e-18))) (/ (- t a) (- b y)) (+ x (* z (/ t y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -5.5e-9) || !(z <= 1.52e-18)) {
tmp = (t - a) / (b - y);
} else {
tmp = x + (z * (t / y));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-5.5d-9)) .or. (.not. (z <= 1.52d-18))) then
tmp = (t - a) / (b - y)
else
tmp = x + (z * (t / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -5.5e-9) || !(z <= 1.52e-18)) {
tmp = (t - a) / (b - y);
} else {
tmp = x + (z * (t / y));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -5.5e-9) or not (z <= 1.52e-18): tmp = (t - a) / (b - y) else: tmp = x + (z * (t / y)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -5.5e-9) || !(z <= 1.52e-18)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(x + Float64(z * Float64(t / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -5.5e-9) || ~((z <= 1.52e-18))) tmp = (t - a) / (b - y); else tmp = x + (z * (t / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -5.5e-9], N[Not[LessEqual[z, 1.52e-18]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{-9} \lor \neg \left(z \leq 1.52 \cdot 10^{-18}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{t}{y}\\
\end{array}
\end{array}
if z < -5.4999999999999996e-9 or 1.52e-18 < z Initial program 44.8%
Taylor expanded in z around inf 82.4%
if -5.4999999999999996e-9 < z < 1.52e-18Initial program 87.3%
Taylor expanded in z around 0 53.1%
Taylor expanded in t around inf 59.1%
Final simplification70.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1e+63) (not (<= y 2.7e+47))) (/ 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 <= -1e+63) || !(y <= 2.7e+47)) {
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 <= (-1d+63)) .or. (.not. (y <= 2.7d+47))) 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 <= -1e+63) || !(y <= 2.7e+47)) {
tmp = x / (1.0 - z);
} else {
tmp = (t - a) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1e+63) or not (y <= 2.7e+47): 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 <= -1e+63) || !(y <= 2.7e+47)) 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 <= -1e+63) || ~((y <= 2.7e+47))) 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, -1e+63], N[Not[LessEqual[y, 2.7e+47]], $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 \cdot 10^{+63} \lor \neg \left(y \leq 2.7 \cdot 10^{+47}\right):\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b}\\
\end{array}
\end{array}
if y < -1.00000000000000006e63 or 2.69999999999999996e47 < y Initial program 46.3%
Taylor expanded in y around inf 56.3%
mul-1-neg56.3%
unsub-neg56.3%
Simplified56.3%
if -1.00000000000000006e63 < y < 2.69999999999999996e47Initial program 79.1%
Taylor expanded in y around 0 54.0%
Final simplification54.9%
(FPCore (x y z t a b) :precision binary64 (if (<= z -7.5e-24) (/ (- a) b) (if (<= z 3.4) (/ x (- 1.0 z)) (/ t (- b y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -7.5e-24) {
tmp = -a / b;
} else if (z <= 3.4) {
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 (z <= (-7.5d-24)) then
tmp = -a / b
else if (z <= 3.4d0) 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 (z <= -7.5e-24) {
tmp = -a / b;
} else if (z <= 3.4) {
tmp = x / (1.0 - z);
} else {
tmp = t / (b - y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -7.5e-24: tmp = -a / b elif z <= 3.4: tmp = x / (1.0 - z) else: tmp = t / (b - y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -7.5e-24) tmp = Float64(Float64(-a) / b); elseif (z <= 3.4) 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 (z <= -7.5e-24) tmp = -a / b; elseif (z <= 3.4) tmp = x / (1.0 - z); else tmp = t / (b - y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -7.5e-24], N[((-a) / b), $MachinePrecision], If[LessEqual[z, 3.4], N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision], N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{-24}:\\
\;\;\;\;\frac{-a}{b}\\
\mathbf{elif}\;z \leq 3.4:\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b - y}\\
\end{array}
\end{array}
if z < -7.50000000000000007e-24Initial program 47.0%
Taylor expanded in y around 0 52.5%
Taylor expanded in t around 0 36.3%
neg-mul-136.3%
Simplified36.3%
if -7.50000000000000007e-24 < z < 3.39999999999999991Initial program 86.5%
Taylor expanded in y around inf 47.6%
mul-1-neg47.6%
unsub-neg47.6%
Simplified47.6%
if 3.39999999999999991 < z Initial program 43.9%
Taylor expanded in t around inf 27.1%
Taylor expanded in z around inf 50.8%
(FPCore (x y z t a b) :precision binary64 (if (<= z -1.8e-26) (/ (- a) b) (if (<= z 0.5) (+ x (* z x)) (/ t (- b y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.8e-26) {
tmp = -a / b;
} else if (z <= 0.5) {
tmp = x + (z * x);
} 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 (z <= (-1.8d-26)) then
tmp = -a / b
else if (z <= 0.5d0) then
tmp = x + (z * x)
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 (z <= -1.8e-26) {
tmp = -a / b;
} else if (z <= 0.5) {
tmp = x + (z * x);
} else {
tmp = t / (b - y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.8e-26: tmp = -a / b elif z <= 0.5: tmp = x + (z * x) else: tmp = t / (b - y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.8e-26) tmp = Float64(Float64(-a) / b); elseif (z <= 0.5) tmp = Float64(x + Float64(z * x)); 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 (z <= -1.8e-26) tmp = -a / b; elseif (z <= 0.5) tmp = x + (z * x); else tmp = t / (b - y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.8e-26], N[((-a) / b), $MachinePrecision], If[LessEqual[z, 0.5], N[(x + N[(z * x), $MachinePrecision]), $MachinePrecision], N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{-26}:\\
\;\;\;\;\frac{-a}{b}\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x + z \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b - y}\\
\end{array}
\end{array}
if z < -1.8000000000000001e-26Initial program 47.0%
Taylor expanded in y around 0 52.5%
Taylor expanded in t around 0 36.3%
neg-mul-136.3%
Simplified36.3%
if -1.8000000000000001e-26 < z < 0.5Initial program 86.5%
Taylor expanded in z around 0 51.6%
Taylor expanded in y around inf 47.6%
*-commutative47.6%
Simplified47.6%
if 0.5 < z Initial program 43.9%
Taylor expanded in t around inf 27.1%
Taylor expanded in z around inf 50.8%
(FPCore (x y z t a b) :precision binary64 (if (<= z -7e-24) (/ (- a) b) (if (<= z 0.5) (+ x (* z x)) (/ t b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -7e-24) {
tmp = -a / b;
} else if (z <= 0.5) {
tmp = x + (z * x);
} else {
tmp = t / 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 <= (-7d-24)) then
tmp = -a / b
else if (z <= 0.5d0) then
tmp = x + (z * x)
else
tmp = t / 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 <= -7e-24) {
tmp = -a / b;
} else if (z <= 0.5) {
tmp = x + (z * x);
} else {
tmp = t / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -7e-24: tmp = -a / b elif z <= 0.5: tmp = x + (z * x) else: tmp = t / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -7e-24) tmp = Float64(Float64(-a) / b); elseif (z <= 0.5) tmp = Float64(x + Float64(z * x)); else tmp = Float64(t / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -7e-24) tmp = -a / b; elseif (z <= 0.5) tmp = x + (z * x); else tmp = t / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -7e-24], N[((-a) / b), $MachinePrecision], If[LessEqual[z, 0.5], N[(x + N[(z * x), $MachinePrecision]), $MachinePrecision], N[(t / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{-24}:\\
\;\;\;\;\frac{-a}{b}\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x + z \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b}\\
\end{array}
\end{array}
if z < -6.9999999999999993e-24Initial program 47.0%
Taylor expanded in y around 0 52.5%
Taylor expanded in t around 0 36.3%
neg-mul-136.3%
Simplified36.3%
if -6.9999999999999993e-24 < z < 0.5Initial program 86.5%
Taylor expanded in z around 0 51.6%
Taylor expanded in y around inf 47.6%
*-commutative47.6%
Simplified47.6%
if 0.5 < z Initial program 43.9%
Taylor expanded in t around inf 27.1%
Taylor expanded in y around 0 38.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -6e-7) (not (<= z 0.5))) (/ t b) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -6e-7) || !(z <= 0.5)) {
tmp = t / b;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-6d-7)) .or. (.not. (z <= 0.5d0))) 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 <= -6e-7) || !(z <= 0.5)) {
tmp = t / b;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -6e-7) or not (z <= 0.5): tmp = t / b else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -6e-7) || !(z <= 0.5)) tmp = Float64(t / b); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -6e-7) || ~((z <= 0.5))) tmp = t / b; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -6e-7], N[Not[LessEqual[z, 0.5]], $MachinePrecision]], N[(t / b), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{-7} \lor \neg \left(z \leq 0.5\right):\\
\;\;\;\;\frac{t}{b}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -5.9999999999999997e-7 or 0.5 < z Initial program 44.3%
Taylor expanded in t around inf 21.5%
Taylor expanded in y around 0 30.2%
if -5.9999999999999997e-7 < z < 0.5Initial program 86.9%
Taylor expanded in z around 0 46.6%
Final simplification38.6%
(FPCore (x y z t a b) :precision binary64 (if (<= z -4e-24) (/ (- a) b) (if (<= z 0.5) x (/ t b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4e-24) {
tmp = -a / b;
} else if (z <= 0.5) {
tmp = x;
} else {
tmp = t / 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 <= (-4d-24)) then
tmp = -a / b
else if (z <= 0.5d0) then
tmp = x
else
tmp = t / 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 <= -4e-24) {
tmp = -a / b;
} else if (z <= 0.5) {
tmp = x;
} else {
tmp = t / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -4e-24: tmp = -a / b elif z <= 0.5: tmp = x else: tmp = t / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -4e-24) tmp = Float64(Float64(-a) / b); elseif (z <= 0.5) tmp = x; else tmp = Float64(t / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -4e-24) tmp = -a / b; elseif (z <= 0.5) tmp = x; else tmp = t / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4e-24], N[((-a) / b), $MachinePrecision], If[LessEqual[z, 0.5], x, N[(t / b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{-24}:\\
\;\;\;\;\frac{-a}{b}\\
\mathbf{elif}\;z \leq 0.5:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b}\\
\end{array}
\end{array}
if z < -3.99999999999999969e-24Initial program 47.0%
Taylor expanded in y around 0 52.5%
Taylor expanded in t around 0 36.3%
neg-mul-136.3%
Simplified36.3%
if -3.99999999999999969e-24 < z < 0.5Initial program 86.5%
Taylor expanded in z around 0 47.5%
if 0.5 < z Initial program 43.9%
Taylor expanded in t around inf 27.1%
Taylor expanded in y around 0 38.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 66.1%
Taylor expanded in z around 0 25.4%
(FPCore (x y z t a b) :precision binary64 (- (/ (+ (* z t) (* y x)) (+ y (* z (- b y)))) (/ a (+ (- b y) (/ y z)))))
double code(double x, double y, double z, double t, double a, double b) {
return (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)));
}
def code(x, y, z, t, a, b): return (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z)))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(z * t) + Float64(y * x)) / Float64(y + Float64(z * Float64(b - y)))) - Float64(a / Float64(Float64(b - y) + Float64(y / z)))) end
function tmp = code(x, y, z, t, a, b) tmp = (((z * t) + (y * x)) / (y + (z * (b - y)))) - (a / ((b - y) + (y / z))); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(z * t), $MachinePrecision] + N[(y * x), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a / N[(N[(b - y), $MachinePrecision] + N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{z \cdot t + y \cdot x}{y + z \cdot \left(b - y\right)} - \frac{a}{\left(b - y\right) + \frac{y}{z}}
\end{array}
herbie shell --seed 2024181
(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)))))