
(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 16 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
(if (or (<= z -8.2e+28) (not (<= z 3.3e-15)))
(+
(+ (* (/ y z) (/ x (- b y))) (/ (- t a) (- b y)))
(* y (/ (- a t) (* z (pow (- b y) 2.0)))))
(/ (+ (* y x) (* z (- t a))) (+ y (- (* z b) (* z y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -8.2e+28) || !(z <= 3.3e-15)) {
tmp = (((y / z) * (x / (b - y))) + ((t - a) / (b - y))) + (y * ((a - t) / (z * pow((b - y), 2.0))));
} else {
tmp = ((y * x) + (z * (t - a))) / (y + ((z * b) - (z * y)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-8.2d+28)) .or. (.not. (z <= 3.3d-15))) then
tmp = (((y / z) * (x / (b - y))) + ((t - a) / (b - y))) + (y * ((a - t) / (z * ((b - y) ** 2.0d0))))
else
tmp = ((y * x) + (z * (t - a))) / (y + ((z * b) - (z * y)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -8.2e+28) || !(z <= 3.3e-15)) {
tmp = (((y / z) * (x / (b - y))) + ((t - a) / (b - y))) + (y * ((a - t) / (z * Math.pow((b - y), 2.0))));
} else {
tmp = ((y * x) + (z * (t - a))) / (y + ((z * b) - (z * y)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -8.2e+28) or not (z <= 3.3e-15): tmp = (((y / z) * (x / (b - y))) + ((t - a) / (b - y))) + (y * ((a - t) / (z * math.pow((b - y), 2.0)))) else: tmp = ((y * x) + (z * (t - a))) / (y + ((z * b) - (z * y))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -8.2e+28) || !(z <= 3.3e-15)) tmp = Float64(Float64(Float64(Float64(y / z) * Float64(x / Float64(b - y))) + Float64(Float64(t - a) / Float64(b - y))) + Float64(y * Float64(Float64(a - t) / Float64(z * (Float64(b - y) ^ 2.0))))); else tmp = Float64(Float64(Float64(y * x) + Float64(z * Float64(t - a))) / Float64(y + Float64(Float64(z * b) - Float64(z * y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -8.2e+28) || ~((z <= 3.3e-15))) tmp = (((y / z) * (x / (b - y))) + ((t - a) / (b - y))) + (y * ((a - t) / (z * ((b - y) ^ 2.0)))); else tmp = ((y * x) + (z * (t - a))) / (y + ((z * b) - (z * y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -8.2e+28], N[Not[LessEqual[z, 3.3e-15]], $MachinePrecision]], N[(N[(N[(N[(y / z), $MachinePrecision] * N[(x / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * N[(N[(a - t), $MachinePrecision] / N[(z * N[Power[N[(b - y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * x), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(N[(z * b), $MachinePrecision] - N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.2 \cdot 10^{+28} \lor \neg \left(z \leq 3.3 \cdot 10^{-15}\right):\\
\;\;\;\;\left(\frac{y}{z} \cdot \frac{x}{b - y} + \frac{t - a}{b - y}\right) + y \cdot \frac{a - t}{z \cdot {\left(b - y\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x + z \cdot \left(t - a\right)}{y + \left(z \cdot b - z \cdot y\right)}\\
\end{array}
\end{array}
if z < -8.19999999999999961e28 or 3.3e-15 < z Initial program 43.7%
fma-define43.7%
+-commutative43.7%
fma-define43.7%
Simplified43.7%
Taylor expanded in z around inf 72.0%
associate--r+72.0%
+-commutative72.0%
associate--l+72.0%
*-commutative72.0%
times-frac79.0%
div-sub79.0%
associate-/l*93.6%
Simplified93.6%
if -8.19999999999999961e28 < z < 3.3e-15Initial program 89.9%
sub-neg89.9%
distribute-lft-in89.9%
Applied egg-rr89.9%
Final simplification91.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (* z (- b y)))))
(if (or (<= z -8.2e+99) (not (<= z 1.15e+74)))
(/ (- t a) (- b y))
(+ (/ (* y x) t_1) (/ (* z (- t a)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (z * (b - y));
double tmp;
if ((z <= -8.2e+99) || !(z <= 1.15e+74)) {
tmp = (t - a) / (b - y);
} else {
tmp = ((y * x) / t_1) + ((z * (t - a)) / t_1);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = y + (z * (b - y))
if ((z <= (-8.2d+99)) .or. (.not. (z <= 1.15d+74))) then
tmp = (t - a) / (b - y)
else
tmp = ((y * x) / t_1) + ((z * (t - a)) / t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (z * (b - y));
double tmp;
if ((z <= -8.2e+99) || !(z <= 1.15e+74)) {
tmp = (t - a) / (b - y);
} else {
tmp = ((y * x) / t_1) + ((z * (t - a)) / t_1);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (z * (b - y)) tmp = 0 if (z <= -8.2e+99) or not (z <= 1.15e+74): tmp = (t - a) / (b - y) else: tmp = ((y * x) / t_1) + ((z * (t - a)) / t_1) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(z * Float64(b - y))) tmp = 0.0 if ((z <= -8.2e+99) || !(z <= 1.15e+74)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(Float64(Float64(y * x) / t_1) + Float64(Float64(z * Float64(t - a)) / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (z * (b - y)); tmp = 0.0; if ((z <= -8.2e+99) || ~((z <= 1.15e+74))) tmp = (t - a) / (b - y); else tmp = ((y * x) / t_1) + ((z * (t - a)) / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[z, -8.2e+99], N[Not[LessEqual[z, 1.15e+74]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * x), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + z \cdot \left(b - y\right)\\
\mathbf{if}\;z \leq -8.2 \cdot 10^{+99} \lor \neg \left(z \leq 1.15 \cdot 10^{+74}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x}{t\_1} + \frac{z \cdot \left(t - a\right)}{t\_1}\\
\end{array}
\end{array}
if z < -8.19999999999999959e99 or 1.1499999999999999e74 < z Initial program 35.3%
fma-define35.3%
+-commutative35.3%
fma-define35.3%
Simplified35.3%
Taylor expanded in z around inf 88.4%
if -8.19999999999999959e99 < z < 1.1499999999999999e74Initial program 85.7%
fma-define85.7%
+-commutative85.7%
fma-define85.7%
Simplified85.7%
Taylor expanded in x around 0 85.7%
Final simplification86.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (* z (- b y)))) (t_2 (/ (- t a) (- b y))))
(if (<= z -6800000000000.0)
t_2
(if (<= z 2.1e-84)
(/ (+ (* y x) (* z t)) t_1)
(if (<= z 170000000000.0)
(/ (* z (- t a)) t_1)
(if (<= z 1.5e+49) (* (/ y z) (/ x (- b y))) t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (z * (b - y));
double t_2 = (t - a) / (b - y);
double tmp;
if (z <= -6800000000000.0) {
tmp = t_2;
} else if (z <= 2.1e-84) {
tmp = ((y * x) + (z * t)) / t_1;
} else if (z <= 170000000000.0) {
tmp = (z * (t - a)) / t_1;
} else if (z <= 1.5e+49) {
tmp = (y / z) * (x / (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 = y + (z * (b - y))
t_2 = (t - a) / (b - y)
if (z <= (-6800000000000.0d0)) then
tmp = t_2
else if (z <= 2.1d-84) then
tmp = ((y * x) + (z * t)) / t_1
else if (z <= 170000000000.0d0) then
tmp = (z * (t - a)) / t_1
else if (z <= 1.5d+49) then
tmp = (y / z) * (x / (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 = y + (z * (b - y));
double t_2 = (t - a) / (b - y);
double tmp;
if (z <= -6800000000000.0) {
tmp = t_2;
} else if (z <= 2.1e-84) {
tmp = ((y * x) + (z * t)) / t_1;
} else if (z <= 170000000000.0) {
tmp = (z * (t - a)) / t_1;
} else if (z <= 1.5e+49) {
tmp = (y / z) * (x / (b - y));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (z * (b - y)) t_2 = (t - a) / (b - y) tmp = 0 if z <= -6800000000000.0: tmp = t_2 elif z <= 2.1e-84: tmp = ((y * x) + (z * t)) / t_1 elif z <= 170000000000.0: tmp = (z * (t - a)) / t_1 elif z <= 1.5e+49: tmp = (y / z) * (x / (b - y)) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(z * Float64(b - y))) t_2 = Float64(Float64(t - a) / Float64(b - y)) tmp = 0.0 if (z <= -6800000000000.0) tmp = t_2; elseif (z <= 2.1e-84) tmp = Float64(Float64(Float64(y * x) + Float64(z * t)) / t_1); elseif (z <= 170000000000.0) tmp = Float64(Float64(z * Float64(t - a)) / t_1); elseif (z <= 1.5e+49) tmp = Float64(Float64(y / z) * Float64(x / Float64(b - y))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (z * (b - y)); t_2 = (t - a) / (b - y); tmp = 0.0; if (z <= -6800000000000.0) tmp = t_2; elseif (z <= 2.1e-84) tmp = ((y * x) + (z * t)) / t_1; elseif (z <= 170000000000.0) tmp = (z * (t - a)) / t_1; elseif (z <= 1.5e+49) tmp = (y / z) * (x / (b - y)); 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[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6800000000000.0], t$95$2, If[LessEqual[z, 2.1e-84], N[(N[(N[(y * x), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[z, 170000000000.0], N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[z, 1.5e+49], N[(N[(y / z), $MachinePrecision] * N[(x / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + z \cdot \left(b - y\right)\\
t_2 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -6800000000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 2.1 \cdot 10^{-84}:\\
\;\;\;\;\frac{y \cdot x + z \cdot t}{t\_1}\\
\mathbf{elif}\;z \leq 170000000000:\\
\;\;\;\;\frac{z \cdot \left(t - a\right)}{t\_1}\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{+49}:\\
\;\;\;\;\frac{y}{z} \cdot \frac{x}{b - y}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -6.8e12 or 1.5000000000000001e49 < z Initial program 43.2%
fma-define43.2%
+-commutative43.2%
fma-define43.2%
Simplified43.2%
Taylor expanded in z around inf 82.9%
if -6.8e12 < z < 2.09999999999999998e-84Initial program 91.1%
Taylor expanded in t around inf 72.1%
*-commutative72.1%
Simplified72.1%
if 2.09999999999999998e-84 < z < 1.7e11Initial program 83.9%
fma-define83.9%
+-commutative83.9%
fma-define83.9%
Simplified83.9%
Taylor expanded in x around 0 78.1%
if 1.7e11 < z < 1.5000000000000001e49Initial program 44.6%
fma-define44.6%
Simplified44.6%
Taylor expanded in x around inf 30.9%
*-commutative30.9%
Simplified30.9%
Taylor expanded in z around inf 30.9%
times-frac86.2%
Applied egg-rr86.2%
Final simplification78.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -2.7e+86) (not (<= z 1.9e+70))) (/ (- t a) (- b y)) (/ (+ (* y x) (* z (- t a))) (+ y (- (* z b) (* z y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.7e+86) || !(z <= 1.9e+70)) {
tmp = (t - a) / (b - y);
} else {
tmp = ((y * x) + (z * (t - a))) / (y + ((z * b) - (z * y)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-2.7d+86)) .or. (.not. (z <= 1.9d+70))) then
tmp = (t - a) / (b - y)
else
tmp = ((y * x) + (z * (t - a))) / (y + ((z * b) - (z * y)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.7e+86) || !(z <= 1.9e+70)) {
tmp = (t - a) / (b - y);
} else {
tmp = ((y * x) + (z * (t - a))) / (y + ((z * b) - (z * y)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -2.7e+86) or not (z <= 1.9e+70): tmp = (t - a) / (b - y) else: tmp = ((y * x) + (z * (t - a))) / (y + ((z * b) - (z * y))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -2.7e+86) || !(z <= 1.9e+70)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(Float64(Float64(y * x) + Float64(z * Float64(t - a))) / Float64(y + Float64(Float64(z * b) - Float64(z * y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -2.7e+86) || ~((z <= 1.9e+70))) tmp = (t - a) / (b - y); else tmp = ((y * x) + (z * (t - a))) / (y + ((z * b) - (z * y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2.7e+86], N[Not[LessEqual[z, 1.9e+70]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * x), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(N[(z * b), $MachinePrecision] - N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{+86} \lor \neg \left(z \leq 1.9 \cdot 10^{+70}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x + z \cdot \left(t - a\right)}{y + \left(z \cdot b - z \cdot y\right)}\\
\end{array}
\end{array}
if z < -2.70000000000000018e86 or 1.8999999999999999e70 < z Initial program 37.6%
fma-define37.6%
+-commutative37.6%
fma-define37.6%
Simplified37.6%
Taylor expanded in z around inf 87.4%
if -2.70000000000000018e86 < z < 1.8999999999999999e70Initial program 86.3%
sub-neg86.3%
distribute-lft-in86.3%
Applied egg-rr86.3%
Final simplification86.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -2.7e+86) (not (<= z 5e+74))) (/ (- t a) (- b y)) (/ (+ (* y x) (* z (- t a))) (+ y (* z (- b y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.7e+86) || !(z <= 5e+74)) {
tmp = (t - a) / (b - y);
} else {
tmp = ((y * x) + (z * (t - a))) / (y + (z * (b - y)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-2.7d+86)) .or. (.not. (z <= 5d+74))) then
tmp = (t - a) / (b - y)
else
tmp = ((y * x) + (z * (t - a))) / (y + (z * (b - y)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.7e+86) || !(z <= 5e+74)) {
tmp = (t - a) / (b - y);
} else {
tmp = ((y * x) + (z * (t - a))) / (y + (z * (b - y)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -2.7e+86) or not (z <= 5e+74): tmp = (t - a) / (b - y) else: tmp = ((y * x) + (z * (t - a))) / (y + (z * (b - y))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -2.7e+86) || !(z <= 5e+74)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(Float64(Float64(y * x) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * Float64(b - y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -2.7e+86) || ~((z <= 5e+74))) tmp = (t - a) / (b - y); else tmp = ((y * x) + (z * (t - a))) / (y + (z * (b - y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2.7e+86], N[Not[LessEqual[z, 5e+74]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * x), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{+86} \lor \neg \left(z \leq 5 \cdot 10^{+74}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot x + z \cdot \left(t - a\right)}{y + z \cdot \left(b - y\right)}\\
\end{array}
\end{array}
if z < -2.70000000000000018e86 or 4.99999999999999963e74 < z Initial program 37.6%
fma-define37.6%
+-commutative37.6%
fma-define37.6%
Simplified37.6%
Taylor expanded in z around inf 87.4%
if -2.70000000000000018e86 < z < 4.99999999999999963e74Initial program 86.3%
Final simplification86.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- t a) (- b y))))
(if (<= z -6000.0)
t_1
(if (<= z 62000000000000.0)
(/ (+ (* y x) (* z (- t a))) (+ y (* z b)))
(if (<= z 1.5e+49) (* (/ y z) (/ x (- b 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 <= -6000.0) {
tmp = t_1;
} else if (z <= 62000000000000.0) {
tmp = ((y * x) + (z * (t - a))) / (y + (z * b));
} else if (z <= 1.5e+49) {
tmp = (y / z) * (x / (b - 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 <= (-6000.0d0)) then
tmp = t_1
else if (z <= 62000000000000.0d0) then
tmp = ((y * x) + (z * (t - a))) / (y + (z * b))
else if (z <= 1.5d+49) then
tmp = (y / z) * (x / (b - 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 <= -6000.0) {
tmp = t_1;
} else if (z <= 62000000000000.0) {
tmp = ((y * x) + (z * (t - a))) / (y + (z * b));
} else if (z <= 1.5e+49) {
tmp = (y / z) * (x / (b - 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 <= -6000.0: tmp = t_1 elif z <= 62000000000000.0: tmp = ((y * x) + (z * (t - a))) / (y + (z * b)) elif z <= 1.5e+49: tmp = (y / z) * (x / (b - 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 <= -6000.0) tmp = t_1; elseif (z <= 62000000000000.0) tmp = Float64(Float64(Float64(y * x) + Float64(z * Float64(t - a))) / Float64(y + Float64(z * b))); elseif (z <= 1.5e+49) tmp = Float64(Float64(y / z) * Float64(x / Float64(b - 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 <= -6000.0) tmp = t_1; elseif (z <= 62000000000000.0) tmp = ((y * x) + (z * (t - a))) / (y + (z * b)); elseif (z <= 1.5e+49) tmp = (y / z) * (x / (b - 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, -6000.0], t$95$1, If[LessEqual[z, 62000000000000.0], N[(N[(N[(y * x), $MachinePrecision] + N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.5e+49], N[(N[(y / z), $MachinePrecision] * N[(x / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - a}{b - y}\\
\mathbf{if}\;z \leq -6000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 62000000000000:\\
\;\;\;\;\frac{y \cdot x + z \cdot \left(t - a\right)}{y + z \cdot b}\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{+49}:\\
\;\;\;\;\frac{y}{z} \cdot \frac{x}{b - y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6e3 or 1.5000000000000001e49 < z Initial program 44.9%
fma-define44.9%
+-commutative44.9%
fma-define44.9%
Simplified44.9%
Taylor expanded in z around inf 81.8%
if -6e3 < z < 6.2e13Initial program 89.7%
Taylor expanded in b around inf 89.1%
*-commutative89.1%
Simplified89.1%
if 6.2e13 < z < 1.5000000000000001e49Initial program 44.6%
fma-define44.6%
Simplified44.6%
Taylor expanded in x around inf 30.9%
*-commutative30.9%
Simplified30.9%
Taylor expanded in z around inf 30.9%
times-frac86.2%
Applied egg-rr86.2%
Final simplification85.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -6.3e-34) (not (<= z 3.3e-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 <= -6.3e-34) || !(z <= 3.3e-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 <= (-6.3d-34)) .or. (.not. (z <= 3.3d-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 <= -6.3e-34) || !(z <= 3.3e-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 <= -6.3e-34) or not (z <= 3.3e-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 <= -6.3e-34) || !(z <= 3.3e-15)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(x + Float64(Float64(z * Float64(t - a)) / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -6.3e-34) || ~((z <= 3.3e-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, -6.3e-34], N[Not[LessEqual[z, 3.3e-15]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.3 \cdot 10^{-34} \lor \neg \left(z \leq 3.3 \cdot 10^{-15}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z \cdot \left(t - a\right)}{y}\\
\end{array}
\end{array}
if z < -6.30000000000000025e-34 or 3.3e-15 < z Initial program 48.5%
fma-define48.5%
+-commutative48.5%
fma-define48.5%
Simplified48.5%
Taylor expanded in z around inf 78.1%
if -6.30000000000000025e-34 < z < 3.3e-15Initial program 88.8%
Taylor expanded in b around 0 59.2%
neg-mul-159.2%
Simplified59.2%
Taylor expanded in z around 0 60.4%
mul-1-neg60.4%
+-commutative60.4%
unsub-neg60.4%
Simplified60.4%
Taylor expanded in y around 0 69.7%
Final simplification74.7%
(FPCore (x y z t a b) :precision binary64 (if (<= z -6e-34) (/ t b) (if (<= z 1.0) (+ x (* z x)) (if (<= z 1.55e+79) (/ x (- z)) (/ t b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -6e-34) {
tmp = t / b;
} else if (z <= 1.0) {
tmp = x + (z * x);
} else if (z <= 1.55e+79) {
tmp = x / -z;
} 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 <= (-6d-34)) then
tmp = t / b
else if (z <= 1.0d0) then
tmp = x + (z * x)
else if (z <= 1.55d+79) then
tmp = x / -z
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 <= -6e-34) {
tmp = t / b;
} else if (z <= 1.0) {
tmp = x + (z * x);
} else if (z <= 1.55e+79) {
tmp = x / -z;
} else {
tmp = t / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -6e-34: tmp = t / b elif z <= 1.0: tmp = x + (z * x) elif z <= 1.55e+79: tmp = x / -z else: tmp = t / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -6e-34) tmp = Float64(t / b); elseif (z <= 1.0) tmp = Float64(x + Float64(z * x)); elseif (z <= 1.55e+79) tmp = Float64(x / Float64(-z)); else tmp = Float64(t / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -6e-34) tmp = t / b; elseif (z <= 1.0) tmp = x + (z * x); elseif (z <= 1.55e+79) tmp = x / -z; else tmp = t / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -6e-34], N[(t / b), $MachinePrecision], If[LessEqual[z, 1.0], N[(x + N[(z * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.55e+79], N[(x / (-z)), $MachinePrecision], N[(t / b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{-34}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;x + z \cdot x\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{+79}:\\
\;\;\;\;\frac{x}{-z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b}\\
\end{array}
\end{array}
if z < -6e-34 or 1.5499999999999999e79 < z Initial program 46.0%
sub-neg46.0%
distribute-lft-in45.1%
Applied egg-rr45.1%
Taylor expanded in t around inf 28.3%
Taylor expanded in y around 0 31.0%
if -6e-34 < z < 1Initial program 89.0%
Taylor expanded in b around 0 57.6%
neg-mul-157.6%
Simplified57.6%
Taylor expanded in z around 0 58.8%
mul-1-neg58.8%
+-commutative58.8%
unsub-neg58.8%
Simplified58.8%
Taylor expanded in y around inf 48.2%
*-commutative48.2%
Simplified48.2%
if 1 < z < 1.5499999999999999e79Initial program 62.2%
fma-define62.3%
+-commutative62.3%
fma-define62.3%
Simplified62.3%
Taylor expanded in y around inf 41.9%
mul-1-neg41.9%
unsub-neg41.9%
Simplified41.9%
Taylor expanded in z around inf 41.9%
associate-*r/41.9%
neg-mul-141.9%
Simplified41.9%
Final simplification38.8%
(FPCore (x y z t a b) :precision binary64 (if (<= z -7.4e-39) (/ t b) (if (<= z 1.0) x (if (<= z 3.6e+79) (/ x (- z)) (/ t b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -7.4e-39) {
tmp = t / b;
} else if (z <= 1.0) {
tmp = x;
} else if (z <= 3.6e+79) {
tmp = x / -z;
} 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 <= (-7.4d-39)) then
tmp = t / b
else if (z <= 1.0d0) then
tmp = x
else if (z <= 3.6d+79) then
tmp = x / -z
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 <= -7.4e-39) {
tmp = t / b;
} else if (z <= 1.0) {
tmp = x;
} else if (z <= 3.6e+79) {
tmp = x / -z;
} else {
tmp = t / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -7.4e-39: tmp = t / b elif z <= 1.0: tmp = x elif z <= 3.6e+79: tmp = x / -z else: tmp = t / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -7.4e-39) tmp = Float64(t / b); elseif (z <= 1.0) tmp = x; elseif (z <= 3.6e+79) tmp = Float64(x / Float64(-z)); else tmp = Float64(t / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -7.4e-39) tmp = t / b; elseif (z <= 1.0) tmp = x; elseif (z <= 3.6e+79) tmp = x / -z; else tmp = t / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -7.4e-39], N[(t / b), $MachinePrecision], If[LessEqual[z, 1.0], x, If[LessEqual[z, 3.6e+79], N[(x / (-z)), $MachinePrecision], N[(t / b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.4 \cdot 10^{-39}:\\
\;\;\;\;\frac{t}{b}\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{+79}:\\
\;\;\;\;\frac{x}{-z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{b}\\
\end{array}
\end{array}
if z < -7.40000000000000029e-39 or 3.5999999999999999e79 < z Initial program 46.0%
sub-neg46.0%
distribute-lft-in45.1%
Applied egg-rr45.1%
Taylor expanded in t around inf 28.3%
Taylor expanded in y around 0 31.0%
if -7.40000000000000029e-39 < z < 1Initial program 89.0%
fma-define89.0%
+-commutative89.0%
fma-define89.0%
Simplified89.0%
Taylor expanded in z around 0 48.2%
if 1 < z < 3.5999999999999999e79Initial program 62.2%
fma-define62.3%
+-commutative62.3%
fma-define62.3%
Simplified62.3%
Taylor expanded in y around inf 41.9%
mul-1-neg41.9%
unsub-neg41.9%
Simplified41.9%
Taylor expanded in z around inf 41.9%
associate-*r/41.9%
neg-mul-141.9%
Simplified41.9%
Final simplification38.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.82e-37) (not (<= z 1.35e-15))) (/ (- 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 <= -1.82e-37) || !(z <= 1.35e-15)) {
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 <= (-1.82d-37)) .or. (.not. (z <= 1.35d-15))) 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 <= -1.82e-37) || !(z <= 1.35e-15)) {
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 <= -1.82e-37) or not (z <= 1.35e-15): 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 <= -1.82e-37) || !(z <= 1.35e-15)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(x + Float64(Float64(z * t) / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.82e-37) || ~((z <= 1.35e-15))) 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, -1.82e-37], N[Not[LessEqual[z, 1.35e-15]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.82 \cdot 10^{-37} \lor \neg \left(z \leq 1.35 \cdot 10^{-15}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z \cdot t}{y}\\
\end{array}
\end{array}
if z < -1.82000000000000002e-37 or 1.35000000000000005e-15 < z Initial program 48.5%
fma-define48.5%
+-commutative48.5%
fma-define48.5%
Simplified48.5%
Taylor expanded in z around inf 78.1%
if -1.82000000000000002e-37 < z < 1.35000000000000005e-15Initial program 88.8%
Taylor expanded in b around 0 59.2%
neg-mul-159.2%
Simplified59.2%
Taylor expanded in z around 0 60.4%
mul-1-neg60.4%
+-commutative60.4%
unsub-neg60.4%
Simplified60.4%
Taylor expanded in t around inf 60.5%
Final simplification70.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -4.7e-38) (not (<= z 4.5e-11))) (/ t (- b y)) (+ x (/ (* z t) y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -4.7e-38) || !(z <= 4.5e-11)) {
tmp = t / (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 <= (-4.7d-38)) .or. (.not. (z <= 4.5d-11))) then
tmp = t / (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 <= -4.7e-38) || !(z <= 4.5e-11)) {
tmp = t / (b - y);
} else {
tmp = x + ((z * t) / y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -4.7e-38) or not (z <= 4.5e-11): tmp = t / (b - y) else: tmp = x + ((z * t) / y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -4.7e-38) || !(z <= 4.5e-11)) tmp = Float64(t / Float64(b - y)); else tmp = Float64(x + Float64(Float64(z * t) / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -4.7e-38) || ~((z <= 4.5e-11))) tmp = t / (b - y); else tmp = x + ((z * t) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -4.7e-38], N[Not[LessEqual[z, 4.5e-11]], $MachinePrecision]], N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.7 \cdot 10^{-38} \lor \neg \left(z \leq 4.5 \cdot 10^{-11}\right):\\
\;\;\;\;\frac{t}{b - y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z \cdot t}{y}\\
\end{array}
\end{array}
if z < -4.69999999999999998e-38 or 4.5e-11 < z Initial program 48.1%
fma-define48.2%
+-commutative48.2%
fma-define48.2%
Simplified48.2%
Taylor expanded in z around inf 78.0%
Taylor expanded in t around inf 51.2%
if -4.69999999999999998e-38 < z < 4.5e-11Initial program 88.9%
Taylor expanded in b around 0 58.7%
neg-mul-158.7%
Simplified58.7%
Taylor expanded in z around 0 59.9%
mul-1-neg59.9%
+-commutative59.9%
unsub-neg59.9%
Simplified59.9%
Taylor expanded in t around inf 59.9%
Final simplification54.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -3e+21) (not (<= y 5.7e+57))) (/ 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 <= -3e+21) || !(y <= 5.7e+57)) {
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 <= (-3d+21)) .or. (.not. (y <= 5.7d+57))) 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 <= -3e+21) || !(y <= 5.7e+57)) {
tmp = x / (1.0 - z);
} else {
tmp = (t - a) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -3e+21) or not (y <= 5.7e+57): 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 <= -3e+21) || !(y <= 5.7e+57)) 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 <= -3e+21) || ~((y <= 5.7e+57))) 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, -3e+21], N[Not[LessEqual[y, 5.7e+57]], $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 -3 \cdot 10^{+21} \lor \neg \left(y \leq 5.7 \cdot 10^{+57}\right):\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b}\\
\end{array}
\end{array}
if y < -3e21 or 5.6999999999999998e57 < y Initial program 48.9%
fma-define48.9%
+-commutative48.9%
fma-define48.9%
Simplified48.9%
Taylor expanded in y around inf 55.2%
mul-1-neg55.2%
unsub-neg55.2%
Simplified55.2%
if -3e21 < y < 5.6999999999999998e57Initial program 79.2%
fma-define79.2%
+-commutative79.2%
fma-define79.2%
Simplified79.2%
Taylor expanded in y around 0 54.5%
Final simplification54.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -4.8e+44) (not (<= z 4.8e+69))) (/ t (- b y)) (/ x (- 1.0 z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -4.8e+44) || !(z <= 4.8e+69)) {
tmp = t / (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 <= (-4.8d+44)) .or. (.not. (z <= 4.8d+69))) then
tmp = t / (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 <= -4.8e+44) || !(z <= 4.8e+69)) {
tmp = t / (b - y);
} else {
tmp = x / (1.0 - z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -4.8e+44) or not (z <= 4.8e+69): tmp = t / (b - y) else: tmp = x / (1.0 - z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -4.8e+44) || !(z <= 4.8e+69)) tmp = Float64(t / 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 <= -4.8e+44) || ~((z <= 4.8e+69))) tmp = t / (b - y); else tmp = x / (1.0 - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -4.8e+44], N[Not[LessEqual[z, 4.8e+69]], $MachinePrecision]], N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{+44} \lor \neg \left(z \leq 4.8 \cdot 10^{+69}\right):\\
\;\;\;\;\frac{t}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{1 - z}\\
\end{array}
\end{array}
if z < -4.80000000000000026e44 or 4.8000000000000003e69 < z Initial program 41.3%
fma-define41.3%
+-commutative41.3%
fma-define41.3%
Simplified41.3%
Taylor expanded in z around inf 85.7%
Taylor expanded in t around inf 58.2%
if -4.80000000000000026e44 < z < 4.8000000000000003e69Initial program 85.6%
fma-define85.6%
+-commutative85.6%
fma-define85.6%
Simplified85.6%
Taylor expanded in y around inf 45.2%
mul-1-neg45.2%
unsub-neg45.2%
Simplified45.2%
Final simplification51.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.3e-35) (not (<= z 3.3e-15))) (/ t (- b y)) (+ x (* z x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.3e-35) || !(z <= 3.3e-15)) {
tmp = t / (b - y);
} else {
tmp = x + (z * x);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-1.3d-35)) .or. (.not. (z <= 3.3d-15))) then
tmp = t / (b - y)
else
tmp = x + (z * x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.3e-35) || !(z <= 3.3e-15)) {
tmp = t / (b - y);
} else {
tmp = x + (z * x);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.3e-35) or not (z <= 3.3e-15): tmp = t / (b - y) else: tmp = x + (z * x) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.3e-35) || !(z <= 3.3e-15)) tmp = Float64(t / Float64(b - y)); else tmp = Float64(x + Float64(z * x)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.3e-35) || ~((z <= 3.3e-15))) tmp = t / (b - y); else tmp = x + (z * x); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.3e-35], N[Not[LessEqual[z, 3.3e-15]], $MachinePrecision]], N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{-35} \lor \neg \left(z \leq 3.3 \cdot 10^{-15}\right):\\
\;\;\;\;\frac{t}{b - y}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot x\\
\end{array}
\end{array}
if z < -1.30000000000000002e-35 or 3.3e-15 < z Initial program 48.5%
fma-define48.5%
+-commutative48.5%
fma-define48.5%
Simplified48.5%
Taylor expanded in z around inf 78.1%
Taylor expanded in t around inf 50.9%
if -1.30000000000000002e-35 < z < 3.3e-15Initial program 88.8%
Taylor expanded in b around 0 59.2%
neg-mul-159.2%
Simplified59.2%
Taylor expanded in z around 0 60.4%
mul-1-neg60.4%
+-commutative60.4%
unsub-neg60.4%
Simplified60.4%
Taylor expanded in y around inf 49.5%
*-commutative49.5%
Simplified49.5%
Final simplification50.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -2.9e-37) (not (<= z 1.42e-15))) (/ t b) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.9e-37) || !(z <= 1.42e-15)) {
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 <= (-2.9d-37)) .or. (.not. (z <= 1.42d-15))) 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 <= -2.9e-37) || !(z <= 1.42e-15)) {
tmp = t / b;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -2.9e-37) or not (z <= 1.42e-15): tmp = t / b else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -2.9e-37) || !(z <= 1.42e-15)) 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 <= -2.9e-37) || ~((z <= 1.42e-15))) tmp = t / b; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2.9e-37], N[Not[LessEqual[z, 1.42e-15]], $MachinePrecision]], N[(t / b), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{-37} \lor \neg \left(z \leq 1.42 \cdot 10^{-15}\right):\\
\;\;\;\;\frac{t}{b}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.90000000000000005e-37 or 1.42e-15 < z Initial program 48.5%
sub-neg48.5%
distribute-lft-in47.6%
Applied egg-rr47.6%
Taylor expanded in t around inf 27.5%
Taylor expanded in y around 0 28.7%
if -2.90000000000000005e-37 < z < 1.42e-15Initial program 88.8%
fma-define88.8%
+-commutative88.8%
fma-define88.8%
Simplified88.8%
Taylor expanded in z around 0 49.5%
Final simplification37.2%
(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 65.0%
fma-define65.0%
+-commutative65.0%
fma-define65.0%
Simplified65.0%
Taylor expanded in z around 0 22.6%
(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 2024150
(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)))))