
(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 (* z (- t a)))
(t_2 (+ y (* z (- b y))))
(t_3
(-
(+ (* (/ x z) (/ y (- b y))) (/ (- t a) (- b y)))
(* y (/ (- t a) (* z (pow (- b y) 2.0)))))))
(if (<= z -7e+79)
t_3
(if (<= z -3.8e-74)
(/ (fma x y t_1) (fma z (- b y) y))
(if (<= z 6.8e+42) (* x (+ (/ y t_2) (/ t_1 (* x t_2)))) t_3)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (t - a);
double t_2 = y + (z * (b - y));
double t_3 = (((x / z) * (y / (b - y))) + ((t - a) / (b - y))) - (y * ((t - a) / (z * pow((b - y), 2.0))));
double tmp;
if (z <= -7e+79) {
tmp = t_3;
} else if (z <= -3.8e-74) {
tmp = fma(x, y, t_1) / fma(z, (b - y), y);
} else if (z <= 6.8e+42) {
tmp = x * ((y / t_2) + (t_1 / (x * t_2)));
} else {
tmp = t_3;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(t - a)) t_2 = Float64(y + Float64(z * Float64(b - y))) t_3 = Float64(Float64(Float64(Float64(x / z) * Float64(y / Float64(b - y))) + Float64(Float64(t - a) / Float64(b - y))) - Float64(y * Float64(Float64(t - a) / Float64(z * (Float64(b - y) ^ 2.0))))) tmp = 0.0 if (z <= -7e+79) tmp = t_3; elseif (z <= -3.8e-74) tmp = Float64(fma(x, y, t_1) / fma(z, Float64(b - y), y)); elseif (z <= 6.8e+42) tmp = Float64(x * Float64(Float64(y / t_2) + Float64(t_1 / Float64(x * t_2)))); else tmp = t_3; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(z * N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(x / z), $MachinePrecision] * N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * N[(N[(t - a), $MachinePrecision] / N[(z * N[Power[N[(b - y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7e+79], t$95$3, If[LessEqual[z, -3.8e-74], N[(N[(x * y + t$95$1), $MachinePrecision] / N[(z * N[(b - y), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.8e+42], N[(x * N[(N[(y / t$95$2), $MachinePrecision] + N[(t$95$1 / N[(x * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(t - a\right)\\
t_2 := y + z \cdot \left(b - y\right)\\
t_3 := \left(\frac{x}{z} \cdot \frac{y}{b - y} + \frac{t - a}{b - y}\right) - y \cdot \frac{t - a}{z \cdot {\left(b - y\right)}^{2}}\\
\mathbf{if}\;z \leq -7 \cdot 10^{+79}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;z \leq -3.8 \cdot 10^{-74}:\\
\;\;\;\;\frac{\mathsf{fma}\left(x, y, t\_1\right)}{\mathsf{fma}\left(z, b - y, y\right)}\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{+42}:\\
\;\;\;\;x \cdot \left(\frac{y}{t\_2} + \frac{t\_1}{x \cdot t\_2}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if z < -6.99999999999999961e79 or 6.7999999999999995e42 < z Initial program 44.9%
fma-define44.9%
+-commutative44.9%
fma-define44.9%
Simplified44.9%
Taylor expanded in z around inf 76.1%
associate--r+76.1%
+-commutative76.1%
associate--l+76.1%
times-frac81.8%
div-sub81.8%
associate-/l*95.1%
Simplified95.1%
if -6.99999999999999961e79 < z < -3.7999999999999996e-74Initial program 96.5%
fma-define96.5%
+-commutative96.5%
fma-define96.5%
Simplified96.5%
if -3.7999999999999996e-74 < z < 6.7999999999999995e42Initial program 81.7%
fma-define81.7%
+-commutative81.7%
fma-define81.7%
Simplified81.7%
Taylor expanded in x around inf 94.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (* z (- b y))))
(t_2
(-
(+ (* (/ x z) (/ y (- b y))) (/ (- t a) (- b y)))
(* y (/ (- t a) (* z (pow (- b y) 2.0)))))))
(if (<= z -6e+79)
t_2
(if (<= z -1.4e-69)
(/ (* z (+ t (- (* x (/ y z)) a))) t_1)
(if (<= z 2.55e+44)
(* x (+ (/ y t_1) (/ (* z (- t a)) (* x t_1))))
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 = (((x / z) * (y / (b - y))) + ((t - a) / (b - y))) - (y * ((t - a) / (z * pow((b - y), 2.0))));
double tmp;
if (z <= -6e+79) {
tmp = t_2;
} else if (z <= -1.4e-69) {
tmp = (z * (t + ((x * (y / z)) - a))) / t_1;
} else if (z <= 2.55e+44) {
tmp = x * ((y / t_1) + ((z * (t - a)) / (x * 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 * (b - y))
t_2 = (((x / z) * (y / (b - y))) + ((t - a) / (b - y))) - (y * ((t - a) / (z * ((b - y) ** 2.0d0))))
if (z <= (-6d+79)) then
tmp = t_2
else if (z <= (-1.4d-69)) then
tmp = (z * (t + ((x * (y / z)) - a))) / t_1
else if (z <= 2.55d+44) then
tmp = x * ((y / t_1) + ((z * (t - a)) / (x * 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 * (b - y));
double t_2 = (((x / z) * (y / (b - y))) + ((t - a) / (b - y))) - (y * ((t - a) / (z * Math.pow((b - y), 2.0))));
double tmp;
if (z <= -6e+79) {
tmp = t_2;
} else if (z <= -1.4e-69) {
tmp = (z * (t + ((x * (y / z)) - a))) / t_1;
} else if (z <= 2.55e+44) {
tmp = x * ((y / t_1) + ((z * (t - a)) / (x * t_1)));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (z * (b - y)) t_2 = (((x / z) * (y / (b - y))) + ((t - a) / (b - y))) - (y * ((t - a) / (z * math.pow((b - y), 2.0)))) tmp = 0 if z <= -6e+79: tmp = t_2 elif z <= -1.4e-69: tmp = (z * (t + ((x * (y / z)) - a))) / t_1 elif z <= 2.55e+44: tmp = x * ((y / t_1) + ((z * (t - a)) / (x * t_1))) 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(Float64(Float64(x / z) * Float64(y / Float64(b - y))) + Float64(Float64(t - a) / Float64(b - y))) - Float64(y * Float64(Float64(t - a) / Float64(z * (Float64(b - y) ^ 2.0))))) tmp = 0.0 if (z <= -6e+79) tmp = t_2; elseif (z <= -1.4e-69) tmp = Float64(Float64(z * Float64(t + Float64(Float64(x * Float64(y / z)) - a))) / t_1); elseif (z <= 2.55e+44) tmp = Float64(x * Float64(Float64(y / t_1) + Float64(Float64(z * Float64(t - a)) / Float64(x * t_1)))); 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 = (((x / z) * (y / (b - y))) + ((t - a) / (b - y))) - (y * ((t - a) / (z * ((b - y) ^ 2.0)))); tmp = 0.0; if (z <= -6e+79) tmp = t_2; elseif (z <= -1.4e-69) tmp = (z * (t + ((x * (y / z)) - a))) / t_1; elseif (z <= 2.55e+44) tmp = x * ((y / t_1) + ((z * (t - a)) / (x * 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[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(x / z), $MachinePrecision] * N[(y / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * N[(N[(t - a), $MachinePrecision] / N[(z * N[Power[N[(b - y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6e+79], t$95$2, If[LessEqual[z, -1.4e-69], N[(N[(z * N[(t + N[(N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[z, 2.55e+44], N[(x * N[(N[(y / t$95$1), $MachinePrecision] + N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] / N[(x * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + z \cdot \left(b - y\right)\\
t_2 := \left(\frac{x}{z} \cdot \frac{y}{b - y} + \frac{t - a}{b - y}\right) - y \cdot \frac{t - a}{z \cdot {\left(b - y\right)}^{2}}\\
\mathbf{if}\;z \leq -6 \cdot 10^{+79}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -1.4 \cdot 10^{-69}:\\
\;\;\;\;\frac{z \cdot \left(t + \left(x \cdot \frac{y}{z} - a\right)\right)}{t\_1}\\
\mathbf{elif}\;z \leq 2.55 \cdot 10^{+44}:\\
\;\;\;\;x \cdot \left(\frac{y}{t\_1} + \frac{z \cdot \left(t - a\right)}{x \cdot t\_1}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -5.99999999999999948e79 or 2.55e44 < z Initial program 44.9%
fma-define44.9%
+-commutative44.9%
fma-define44.9%
Simplified44.9%
Taylor expanded in z around inf 76.1%
associate--r+76.1%
+-commutative76.1%
associate--l+76.1%
times-frac81.8%
div-sub81.8%
associate-/l*95.1%
Simplified95.1%
if -5.99999999999999948e79 < z < -1.3999999999999999e-69Initial program 96.2%
fma-define96.2%
Simplified96.2%
Taylor expanded in z around inf 96.1%
associate--l+96.1%
associate-/l*96.3%
Simplified96.3%
if -1.3999999999999999e-69 < z < 2.55e44Initial program 82.0%
fma-define82.0%
+-commutative82.0%
fma-define82.0%
Simplified82.0%
Taylor expanded in x around inf 94.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (* z (- b y)))))
(if (or (<= z -3.05e+128) (not (<= z 1.75e+72)))
(/ (- t a) (- b y))
(* x (+ (/ y t_1) (/ (* z (- t a)) (* x 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 <= -3.05e+128) || !(z <= 1.75e+72)) {
tmp = (t - a) / (b - y);
} else {
tmp = x * ((y / t_1) + ((z * (t - a)) / (x * 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 <= (-3.05d+128)) .or. (.not. (z <= 1.75d+72))) then
tmp = (t - a) / (b - y)
else
tmp = x * ((y / t_1) + ((z * (t - a)) / (x * 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 <= -3.05e+128) || !(z <= 1.75e+72)) {
tmp = (t - a) / (b - y);
} else {
tmp = x * ((y / t_1) + ((z * (t - a)) / (x * t_1)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (z * (b - y)) tmp = 0 if (z <= -3.05e+128) or not (z <= 1.75e+72): tmp = (t - a) / (b - y) else: tmp = x * ((y / t_1) + ((z * (t - a)) / (x * 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 <= -3.05e+128) || !(z <= 1.75e+72)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(x * Float64(Float64(y / t_1) + Float64(Float64(z * Float64(t - a)) / Float64(x * 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 <= -3.05e+128) || ~((z <= 1.75e+72))) tmp = (t - a) / (b - y); else tmp = x * ((y / t_1) + ((z * (t - a)) / (x * 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, -3.05e+128], N[Not[LessEqual[z, 1.75e+72]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y / t$95$1), $MachinePrecision] + N[(N[(z * N[(t - a), $MachinePrecision]), $MachinePrecision] / N[(x * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + z \cdot \left(b - y\right)\\
\mathbf{if}\;z \leq -3.05 \cdot 10^{+128} \lor \neg \left(z \leq 1.75 \cdot 10^{+72}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{y}{t\_1} + \frac{z \cdot \left(t - a\right)}{x \cdot t\_1}\right)\\
\end{array}
\end{array}
if z < -3.0500000000000001e128 or 1.75000000000000005e72 < z Initial program 38.6%
fma-define38.6%
+-commutative38.6%
fma-define38.6%
Simplified38.6%
Taylor expanded in z around inf 89.1%
if -3.0500000000000001e128 < z < 1.75000000000000005e72Initial program 84.8%
fma-define84.8%
+-commutative84.8%
fma-define84.8%
Simplified84.8%
Taylor expanded in x around inf 91.5%
Final simplification90.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (* z (- b y)))))
(if (or (<= z -4.4e+58) (not (<= z 1.9e+114)))
(/ (- 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 <= -4.4e+58) || !(z <= 1.9e+114)) {
tmp = (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 <= (-4.4d+58)) .or. (.not. (z <= 1.9d+114))) then
tmp = (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 <= -4.4e+58) || !(z <= 1.9e+114)) {
tmp = (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 <= -4.4e+58) or not (z <= 1.9e+114): tmp = (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 <= -4.4e+58) || !(z <= 1.9e+114)) tmp = 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 <= -4.4e+58) || ~((z <= 1.9e+114))) tmp = (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, -4.4e+58], N[Not[LessEqual[z, 1.9e+114]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $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 -4.4 \cdot 10^{+58} \lor \neg \left(z \leq 1.9 \cdot 10^{+114}\right):\\
\;\;\;\;\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 < -4.4000000000000001e58 or 1.9e114 < z Initial program 39.8%
fma-define39.8%
+-commutative39.8%
fma-define39.8%
Simplified39.8%
Taylor expanded in z around inf 92.2%
if -4.4000000000000001e58 < z < 1.9e114Initial program 84.1%
fma-define84.1%
+-commutative84.1%
fma-define84.1%
Simplified84.1%
Taylor expanded in x around 0 84.1%
Final simplification87.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.1e+52) (not (<= z 2.5e+112))) (/ (- t a) (- b y)) (/ (- (* x y) (* z (- a t))) (+ y (* z (- b y))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.1e+52) || !(z <= 2.5e+112)) {
tmp = (t - a) / (b - y);
} else {
tmp = ((x * y) - (z * (a - t))) / (y + (z * (b - y)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-1.1d+52)) .or. (.not. (z <= 2.5d+112))) then
tmp = (t - a) / (b - y)
else
tmp = ((x * y) - (z * (a - t))) / (y + (z * (b - y)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.1e+52) || !(z <= 2.5e+112)) {
tmp = (t - a) / (b - y);
} else {
tmp = ((x * y) - (z * (a - t))) / (y + (z * (b - y)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.1e+52) or not (z <= 2.5e+112): tmp = (t - a) / (b - y) else: tmp = ((x * y) - (z * (a - t))) / (y + (z * (b - y))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.1e+52) || !(z <= 2.5e+112)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(Float64(Float64(x * y) - Float64(z * Float64(a - t))) / Float64(y + Float64(z * Float64(b - y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.1e+52) || ~((z <= 2.5e+112))) tmp = (t - a) / (b - y); else tmp = ((x * y) - (z * (a - t))) / (y + (z * (b - y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.1e+52], N[Not[LessEqual[z, 2.5e+112]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], 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]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+52} \lor \neg \left(z \leq 2.5 \cdot 10^{+112}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y - z \cdot \left(a - t\right)}{y + z \cdot \left(b - y\right)}\\
\end{array}
\end{array}
if z < -1.1e52 or 2.5e112 < z Initial program 39.8%
fma-define39.8%
+-commutative39.8%
fma-define39.8%
Simplified39.8%
Taylor expanded in z around inf 92.2%
if -1.1e52 < z < 2.5e112Initial program 84.1%
Final simplification87.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ t (- b y))))
(if (<= z -1e-69)
t_1
(if (<= z 3.7e-86)
x
(if (or (<= z 5.5e+129) (not (<= z 2e+267))) (/ a (- b)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t / (b - y);
double tmp;
if (z <= -1e-69) {
tmp = t_1;
} else if (z <= 3.7e-86) {
tmp = x;
} else if ((z <= 5.5e+129) || !(z <= 2e+267)) {
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 = t / (b - y)
if (z <= (-1d-69)) then
tmp = t_1
else if (z <= 3.7d-86) then
tmp = x
else if ((z <= 5.5d+129) .or. (.not. (z <= 2d+267))) 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 = t / (b - y);
double tmp;
if (z <= -1e-69) {
tmp = t_1;
} else if (z <= 3.7e-86) {
tmp = x;
} else if ((z <= 5.5e+129) || !(z <= 2e+267)) {
tmp = a / -b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t / (b - y) tmp = 0 if z <= -1e-69: tmp = t_1 elif z <= 3.7e-86: tmp = x elif (z <= 5.5e+129) or not (z <= 2e+267): tmp = a / -b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t / Float64(b - y)) tmp = 0.0 if (z <= -1e-69) tmp = t_1; elseif (z <= 3.7e-86) tmp = x; elseif ((z <= 5.5e+129) || !(z <= 2e+267)) tmp = Float64(a / Float64(-b)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t / (b - y); tmp = 0.0; if (z <= -1e-69) tmp = t_1; elseif (z <= 3.7e-86) tmp = x; elseif ((z <= 5.5e+129) || ~((z <= 2e+267))) tmp = a / -b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1e-69], t$95$1, If[LessEqual[z, 3.7e-86], x, If[Or[LessEqual[z, 5.5e+129], N[Not[LessEqual[z, 2e+267]], $MachinePrecision]], N[(a / (-b)), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{b - y}\\
\mathbf{if}\;z \leq -1 \cdot 10^{-69}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{-86}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{+129} \lor \neg \left(z \leq 2 \cdot 10^{+267}\right):\\
\;\;\;\;\frac{a}{-b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -9.9999999999999996e-70 or 5.49999999999999984e129 < z < 1.9999999999999999e267Initial program 55.9%
fma-define55.9%
Simplified55.9%
Taylor expanded in t around inf 42.7%
associate-+r+42.7%
mul-1-neg42.7%
unsub-neg42.7%
associate-/l*38.6%
associate-/l*38.6%
Simplified38.6%
Taylor expanded in z around inf 75.6%
Taylor expanded in t around inf 47.9%
if -9.9999999999999996e-70 < z < 3.6999999999999998e-86Initial program 81.4%
fma-define81.5%
+-commutative81.5%
fma-define81.5%
Simplified81.5%
Taylor expanded in z around 0 59.0%
if 3.6999999999999998e-86 < z < 5.49999999999999984e129 or 1.9999999999999999e267 < z Initial program 67.9%
fma-define67.9%
Simplified67.9%
Taylor expanded in t around inf 55.8%
associate-+r+55.8%
mul-1-neg55.8%
unsub-neg55.8%
associate-/l*52.9%
associate-/l*52.8%
Simplified52.8%
Taylor expanded in a around inf 33.7%
associate-*r*33.7%
neg-mul-133.7%
Simplified33.7%
Taylor expanded in y around 0 43.2%
associate-*r/43.2%
mul-1-neg43.2%
Simplified43.2%
Final simplification50.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1850000.0) (not (<= z 78000.0))) (/ (- t a) (- b y)) (/ (- (* x y) (* z (- a t))) (+ y (* z b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1850000.0) || !(z <= 78000.0)) {
tmp = (t - a) / (b - y);
} else {
tmp = ((x * y) - (z * (a - t))) / (y + (z * 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 <= (-1850000.0d0)) .or. (.not. (z <= 78000.0d0))) then
tmp = (t - a) / (b - y)
else
tmp = ((x * y) - (z * (a - t))) / (y + (z * 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 <= -1850000.0) || !(z <= 78000.0)) {
tmp = (t - a) / (b - y);
} else {
tmp = ((x * y) - (z * (a - t))) / (y + (z * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1850000.0) or not (z <= 78000.0): tmp = (t - a) / (b - y) else: tmp = ((x * y) - (z * (a - t))) / (y + (z * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1850000.0) || !(z <= 78000.0)) tmp = Float64(Float64(t - a) / Float64(b - y)); else tmp = Float64(Float64(Float64(x * y) - Float64(z * Float64(a - t))) / Float64(y + Float64(z * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1850000.0) || ~((z <= 78000.0))) tmp = (t - a) / (b - y); else tmp = ((x * y) - (z * (a - t))) / (y + (z * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1850000.0], N[Not[LessEqual[z, 78000.0]], $MachinePrecision]], N[(N[(t - a), $MachinePrecision] / N[(b - y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] - N[(z * N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(y + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1850000 \lor \neg \left(z \leq 78000\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y - z \cdot \left(a - t\right)}{y + z \cdot b}\\
\end{array}
\end{array}
if z < -1.85e6 or 78000 < z Initial program 52.1%
fma-define52.1%
+-commutative52.1%
fma-define52.1%
Simplified52.1%
Taylor expanded in z around inf 83.6%
if -1.85e6 < z < 78000Initial program 83.8%
Taylor expanded in b around inf 83.8%
*-commutative83.8%
Simplified83.8%
Final simplification83.7%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -4e+14)
(/ a (- y b))
(if (<= z -4.1e-57)
(/ t (- b y))
(if (<= z 7.6e-80) (+ x (/ (* z t) y)) (/ (- t a) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4e+14) {
tmp = a / (y - b);
} else if (z <= -4.1e-57) {
tmp = t / (b - y);
} else if (z <= 7.6e-80) {
tmp = x + ((z * t) / y);
} 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 (z <= (-4d+14)) then
tmp = a / (y - b)
else if (z <= (-4.1d-57)) then
tmp = t / (b - y)
else if (z <= 7.6d-80) then
tmp = x + ((z * t) / y)
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 (z <= -4e+14) {
tmp = a / (y - b);
} else if (z <= -4.1e-57) {
tmp = t / (b - y);
} else if (z <= 7.6e-80) {
tmp = x + ((z * t) / y);
} else {
tmp = (t - a) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -4e+14: tmp = a / (y - b) elif z <= -4.1e-57: tmp = t / (b - y) elif z <= 7.6e-80: tmp = x + ((z * t) / y) else: tmp = (t - a) / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -4e+14) tmp = Float64(a / Float64(y - b)); elseif (z <= -4.1e-57) tmp = Float64(t / Float64(b - y)); elseif (z <= 7.6e-80) tmp = Float64(x + Float64(Float64(z * t) / y)); 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 (z <= -4e+14) tmp = a / (y - b); elseif (z <= -4.1e-57) tmp = t / (b - y); elseif (z <= 7.6e-80) tmp = x + ((z * t) / y); else tmp = (t - a) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4e+14], N[(a / N[(y - b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -4.1e-57], N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.6e-80], N[(x + N[(N[(z * t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+14}:\\
\;\;\;\;\frac{a}{y - b}\\
\mathbf{elif}\;z \leq -4.1 \cdot 10^{-57}:\\
\;\;\;\;\frac{t}{b - y}\\
\mathbf{elif}\;z \leq 7.6 \cdot 10^{-80}:\\
\;\;\;\;x + \frac{z \cdot t}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b}\\
\end{array}
\end{array}
if z < -4e14Initial program 53.1%
fma-define53.1%
Simplified53.1%
Taylor expanded in t around inf 35.5%
associate-+r+35.5%
mul-1-neg35.5%
unsub-neg35.5%
associate-/l*31.8%
associate-/l*31.9%
Simplified31.9%
Taylor expanded in z around inf 76.2%
Taylor expanded in t around 0 53.6%
associate-*r/53.6%
mul-1-neg53.6%
Simplified53.6%
if -4e14 < z < -4.1000000000000001e-57Initial program 99.7%
fma-define99.7%
Simplified99.7%
Taylor expanded in t around inf 82.2%
associate-+r+82.2%
mul-1-neg82.2%
unsub-neg82.2%
associate-/l*82.2%
associate-/l*82.2%
Simplified82.2%
Taylor expanded in z around inf 63.2%
Taylor expanded in t around inf 63.0%
if -4.1000000000000001e-57 < z < 7.59999999999999933e-80Initial program 83.1%
fma-define83.1%
+-commutative83.1%
fma-define83.1%
Simplified83.1%
Taylor expanded in z around 0 52.4%
Taylor expanded in t around inf 71.5%
*-commutative71.5%
Simplified71.5%
if 7.59999999999999933e-80 < z Initial program 56.8%
fma-define56.8%
+-commutative56.8%
fma-define56.8%
Simplified56.8%
Taylor expanded in y around 0 55.2%
Final simplification61.6%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -1.25e+14)
(/ a (- y b))
(if (<= z -1.55e-56)
(/ t (- b y))
(if (<= z 7.5e-80) (+ x (* z (/ t y))) (/ (- t a) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.25e+14) {
tmp = a / (y - b);
} else if (z <= -1.55e-56) {
tmp = t / (b - y);
} else if (z <= 7.5e-80) {
tmp = x + (z * (t / y));
} 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 (z <= (-1.25d+14)) then
tmp = a / (y - b)
else if (z <= (-1.55d-56)) then
tmp = t / (b - y)
else if (z <= 7.5d-80) then
tmp = x + (z * (t / y))
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 (z <= -1.25e+14) {
tmp = a / (y - b);
} else if (z <= -1.55e-56) {
tmp = t / (b - y);
} else if (z <= 7.5e-80) {
tmp = x + (z * (t / y));
} else {
tmp = (t - a) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.25e+14: tmp = a / (y - b) elif z <= -1.55e-56: tmp = t / (b - y) elif z <= 7.5e-80: tmp = x + (z * (t / y)) else: tmp = (t - a) / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.25e+14) tmp = Float64(a / Float64(y - b)); elseif (z <= -1.55e-56) tmp = Float64(t / Float64(b - y)); elseif (z <= 7.5e-80) tmp = Float64(x + Float64(z * Float64(t / y))); 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 (z <= -1.25e+14) tmp = a / (y - b); elseif (z <= -1.55e-56) tmp = t / (b - y); elseif (z <= 7.5e-80) tmp = x + (z * (t / y)); else tmp = (t - a) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.25e+14], N[(a / N[(y - b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.55e-56], N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.5e-80], N[(x + N[(z * N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t - a), $MachinePrecision] / b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.25 \cdot 10^{+14}:\\
\;\;\;\;\frac{a}{y - b}\\
\mathbf{elif}\;z \leq -1.55 \cdot 10^{-56}:\\
\;\;\;\;\frac{t}{b - y}\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-80}:\\
\;\;\;\;x + z \cdot \frac{t}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b}\\
\end{array}
\end{array}
if z < -1.25e14Initial program 53.1%
fma-define53.1%
Simplified53.1%
Taylor expanded in t around inf 35.5%
associate-+r+35.5%
mul-1-neg35.5%
unsub-neg35.5%
associate-/l*31.8%
associate-/l*31.9%
Simplified31.9%
Taylor expanded in z around inf 76.2%
Taylor expanded in t around 0 53.6%
associate-*r/53.6%
mul-1-neg53.6%
Simplified53.6%
if -1.25e14 < z < -1.54999999999999994e-56Initial program 99.7%
fma-define99.7%
Simplified99.7%
Taylor expanded in t around inf 82.2%
associate-+r+82.2%
mul-1-neg82.2%
unsub-neg82.2%
associate-/l*82.2%
associate-/l*82.2%
Simplified82.2%
Taylor expanded in z around inf 63.2%
Taylor expanded in t around inf 63.0%
if -1.54999999999999994e-56 < z < 7.49999999999999999e-80Initial program 83.1%
fma-define83.1%
+-commutative83.1%
fma-define83.1%
Simplified83.1%
Taylor expanded in z around 0 52.4%
Taylor expanded in t around inf 65.6%
if 7.49999999999999999e-80 < z Initial program 56.8%
fma-define56.8%
+-commutative56.8%
fma-define56.8%
Simplified56.8%
Taylor expanded in y around 0 55.2%
Final simplification59.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ t (- b y))))
(if (<= z -4.2e-70)
t_1
(if (<= z 6e+41) (/ x (- 1.0 z)) (if (<= z 1.02e+267) t_1 (/ a (- b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t / (b - y);
double tmp;
if (z <= -4.2e-70) {
tmp = t_1;
} else if (z <= 6e+41) {
tmp = x / (1.0 - z);
} else if (z <= 1.02e+267) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = t / (b - y)
if (z <= (-4.2d-70)) then
tmp = t_1
else if (z <= 6d+41) then
tmp = x / (1.0d0 - z)
else if (z <= 1.02d+267) then
tmp = t_1
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 t_1 = t / (b - y);
double tmp;
if (z <= -4.2e-70) {
tmp = t_1;
} else if (z <= 6e+41) {
tmp = x / (1.0 - z);
} else if (z <= 1.02e+267) {
tmp = t_1;
} else {
tmp = a / -b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t / (b - y) tmp = 0 if z <= -4.2e-70: tmp = t_1 elif z <= 6e+41: tmp = x / (1.0 - z) elif z <= 1.02e+267: tmp = t_1 else: tmp = a / -b return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t / Float64(b - y)) tmp = 0.0 if (z <= -4.2e-70) tmp = t_1; elseif (z <= 6e+41) tmp = Float64(x / Float64(1.0 - z)); elseif (z <= 1.02e+267) tmp = t_1; else tmp = Float64(a / Float64(-b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t / (b - y); tmp = 0.0; if (z <= -4.2e-70) tmp = t_1; elseif (z <= 6e+41) tmp = x / (1.0 - z); elseif (z <= 1.02e+267) tmp = t_1; else tmp = a / -b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t / N[(b - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.2e-70], t$95$1, If[LessEqual[z, 6e+41], N[(x / N[(1.0 - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.02e+267], t$95$1, N[(a / (-b)), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{b - y}\\
\mathbf{if}\;z \leq -4.2 \cdot 10^{-70}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6 \cdot 10^{+41}:\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{elif}\;z \leq 1.02 \cdot 10^{+267}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{-b}\\
\end{array}
\end{array}
if z < -4.2000000000000002e-70 or 5.9999999999999997e41 < z < 1.02000000000000001e267Initial program 60.7%
fma-define60.7%
Simplified60.7%
Taylor expanded in t around inf 48.3%
associate-+r+48.3%
mul-1-neg48.3%
unsub-neg48.3%
associate-/l*43.2%
associate-/l*43.3%
Simplified43.3%
Taylor expanded in z around inf 72.9%
Taylor expanded in t around inf 44.0%
if -4.2000000000000002e-70 < z < 5.9999999999999997e41Initial program 81.9%
fma-define81.9%
+-commutative81.9%
fma-define81.9%
Simplified81.9%
Taylor expanded in y around inf 52.9%
mul-1-neg52.9%
unsub-neg52.9%
Simplified52.9%
if 1.02000000000000001e267 < z Initial program 20.9%
fma-define20.9%
Simplified20.9%
Taylor expanded in t around inf 13.9%
associate-+r+13.9%
mul-1-neg13.9%
unsub-neg13.9%
associate-/l*13.9%
associate-/l*13.9%
Simplified13.9%
Taylor expanded in a around inf 14.9%
associate-*r*14.9%
neg-mul-114.9%
Simplified14.9%
Taylor expanded in y around 0 64.1%
associate-*r/64.1%
mul-1-neg64.1%
Simplified64.1%
Final simplification49.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -5.1e-52) (not (<= z 7.6e-80))) (/ (- 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 <= -5.1e-52) || !(z <= 7.6e-80)) {
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 <= (-5.1d-52)) .or. (.not. (z <= 7.6d-80))) 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 <= -5.1e-52) || !(z <= 7.6e-80)) {
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 <= -5.1e-52) or not (z <= 7.6e-80): 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 <= -5.1e-52) || !(z <= 7.6e-80)) 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 <= -5.1e-52) || ~((z <= 7.6e-80))) 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, -5.1e-52], N[Not[LessEqual[z, 7.6e-80]], $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 -5.1 \cdot 10^{-52} \lor \neg \left(z \leq 7.6 \cdot 10^{-80}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{t - a}{y}\\
\end{array}
\end{array}
if z < -5.09999999999999989e-52 or 7.59999999999999933e-80 < z Initial program 58.2%
fma-define58.2%
+-commutative58.2%
fma-define58.2%
Simplified58.2%
Taylor expanded in z around inf 77.9%
if -5.09999999999999989e-52 < z < 7.59999999999999933e-80Initial program 83.2%
fma-define83.3%
+-commutative83.3%
fma-define83.3%
Simplified83.3%
Taylor expanded in z around 0 52.8%
Taylor expanded in x around 0 72.3%
div-sub74.4%
Simplified74.4%
Final simplification76.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -7.8e-57) (not (<= z 8.4e-81))) (/ (- 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 <= -7.8e-57) || !(z <= 8.4e-81)) {
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 <= (-7.8d-57)) .or. (.not. (z <= 8.4d-81))) 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 <= -7.8e-57) || !(z <= 8.4e-81)) {
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 <= -7.8e-57) or not (z <= 8.4e-81): 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 <= -7.8e-57) || !(z <= 8.4e-81)) 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 <= -7.8e-57) || ~((z <= 8.4e-81))) 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, -7.8e-57], N[Not[LessEqual[z, 8.4e-81]], $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 -7.8 \cdot 10^{-57} \lor \neg \left(z \leq 8.4 \cdot 10^{-81}\right):\\
\;\;\;\;\frac{t - a}{b - y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z \cdot t}{y}\\
\end{array}
\end{array}
if z < -7.80000000000000013e-57 or 8.3999999999999997e-81 < z Initial program 58.5%
fma-define58.5%
+-commutative58.5%
fma-define58.5%
Simplified58.5%
Taylor expanded in z around inf 77.4%
if -7.80000000000000013e-57 < z < 8.3999999999999997e-81Initial program 83.1%
fma-define83.1%
+-commutative83.1%
fma-define83.1%
Simplified83.1%
Taylor expanded in z around 0 52.4%
Taylor expanded in t around inf 71.5%
*-commutative71.5%
Simplified71.5%
Final simplification75.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.5e-27) (not (<= y 9e+40))) (/ x (- 1.0 z)) (/ (- t a) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.5e-27) || !(y <= 9e+40)) {
tmp = x / (1.0 - z);
} else {
tmp = (t - a) / b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-1.5d-27)) .or. (.not. (y <= 9d+40))) then
tmp = x / (1.0d0 - z)
else
tmp = (t - a) / b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.5e-27) || !(y <= 9e+40)) {
tmp = x / (1.0 - z);
} else {
tmp = (t - a) / b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.5e-27) or not (y <= 9e+40): tmp = x / (1.0 - z) else: tmp = (t - a) / b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.5e-27) || !(y <= 9e+40)) tmp = Float64(x / Float64(1.0 - z)); else tmp = Float64(Float64(t - a) / b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.5e-27) || ~((y <= 9e+40))) tmp = x / (1.0 - z); else tmp = (t - a) / b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.5e-27], N[Not[LessEqual[y, 9e+40]], $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.5 \cdot 10^{-27} \lor \neg \left(y \leq 9 \cdot 10^{+40}\right):\\
\;\;\;\;\frac{x}{1 - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t - a}{b}\\
\end{array}
\end{array}
if y < -1.5000000000000001e-27 or 9.00000000000000064e40 < y Initial program 55.6%
fma-define55.6%
+-commutative55.6%
fma-define55.6%
Simplified55.6%
Taylor expanded in y around inf 55.0%
mul-1-neg55.0%
unsub-neg55.0%
Simplified55.0%
if -1.5000000000000001e-27 < y < 9.00000000000000064e40Initial program 78.5%
fma-define78.5%
+-commutative78.5%
fma-define78.5%
Simplified78.5%
Taylor expanded in y around 0 55.8%
Final simplification55.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.05e-69) (not (<= z 1.05e-86))) (/ a (- b)) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.05e-69) || !(z <= 1.05e-86)) {
tmp = a / -b;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-1.05d-69)) .or. (.not. (z <= 1.05d-86))) then
tmp = a / -b
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.05e-69) || !(z <= 1.05e-86)) {
tmp = a / -b;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.05e-69) or not (z <= 1.05e-86): tmp = a / -b else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.05e-69) || !(z <= 1.05e-86)) tmp = Float64(a / Float64(-b)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.05e-69) || ~((z <= 1.05e-86))) tmp = a / -b; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.05e-69], N[Not[LessEqual[z, 1.05e-86]], $MachinePrecision]], N[(a / (-b)), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{-69} \lor \neg \left(z \leq 1.05 \cdot 10^{-86}\right):\\
\;\;\;\;\frac{a}{-b}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.05e-69 or 1.05e-86 < z Initial program 60.8%
fma-define60.8%
Simplified60.8%
Taylor expanded in t around inf 48.1%
associate-+r+48.1%
mul-1-neg48.1%
unsub-neg48.1%
associate-/l*44.5%
associate-/l*44.4%
Simplified44.4%
Taylor expanded in a around inf 30.0%
associate-*r*30.0%
neg-mul-130.0%
Simplified30.0%
Taylor expanded in y around 0 31.4%
associate-*r/31.4%
mul-1-neg31.4%
Simplified31.4%
if -1.05e-69 < z < 1.05e-86Initial program 81.4%
fma-define81.5%
+-commutative81.5%
fma-define81.5%
Simplified81.5%
Taylor expanded in z around 0 59.0%
Final simplification41.3%
(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 68.2%
fma-define68.2%
+-commutative68.2%
fma-define68.2%
Simplified68.2%
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 2024139
(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)))))