
(FPCore (x y z t a) :precision binary64 (/ (- (* x y) (* (* z 9.0) t)) (* a 2.0)))
double code(double x, double y, double z, double t, double a) {
return ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
}
real(8) function code(x, y, z, t, a)
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
code = ((x * y) - ((z * 9.0d0) * t)) / (a * 2.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
}
def code(x, y, z, t, a): return ((x * y) - ((z * 9.0) * t)) / (a * 2.0)
function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) - Float64(Float64(z * 9.0) * t)) / Float64(a * 2.0)) end
function tmp = code(x, y, z, t, a) tmp = ((x * y) - ((z * 9.0) * t)) / (a * 2.0); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] - N[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (/ (- (* x y) (* (* z 9.0) t)) (* a 2.0)))
double code(double x, double y, double z, double t, double a) {
return ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
}
real(8) function code(x, y, z, t, a)
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
code = ((x * y) - ((z * 9.0d0) * t)) / (a * 2.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return ((x * y) - ((z * 9.0) * t)) / (a * 2.0);
}
def code(x, y, z, t, a): return ((x * y) - ((z * 9.0) * t)) / (a * 2.0)
function code(x, y, z, t, a) return Float64(Float64(Float64(x * y) - Float64(Float64(z * 9.0) * t)) / Float64(a * 2.0)) end
function tmp = code(x, y, z, t, a) tmp = ((x * y) - ((z * 9.0) * t)) / (a * 2.0); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(x * y), $MachinePrecision] - N[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot y - \left(z \cdot 9\right) \cdot t}{a \cdot 2}
\end{array}
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= (* x y) -2e+253) (* y (/ (* x 0.5) a)) (/ (- (* x y) (* (* t z) 9.0)) (* a 2.0))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -2e+253) {
tmp = y * ((x * 0.5) / a);
} else {
tmp = ((x * y) - ((t * z) * 9.0)) / (a * 2.0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
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) :: tmp
if ((x * y) <= (-2d+253)) then
tmp = y * ((x * 0.5d0) / a)
else
tmp = ((x * y) - ((t * z) * 9.0d0)) / (a * 2.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -2e+253) {
tmp = y * ((x * 0.5) / a);
} else {
tmp = ((x * y) - ((t * z) * 9.0)) / (a * 2.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if (x * y) <= -2e+253: tmp = y * ((x * 0.5) / a) else: tmp = ((x * y) - ((t * z) * 9.0)) / (a * 2.0) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (Float64(x * y) <= -2e+253) tmp = Float64(y * Float64(Float64(x * 0.5) / a)); else tmp = Float64(Float64(Float64(x * y) - Float64(Float64(t * z) * 9.0)) / Float64(a * 2.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((x * y) <= -2e+253)
tmp = y * ((x * 0.5) / a);
else
tmp = ((x * y) - ((t * z) * 9.0)) / (a * 2.0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x * y), $MachinePrecision], -2e+253], N[(y * N[(N[(x * 0.5), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] - N[(N[(t * z), $MachinePrecision] * 9.0), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+253}:\\
\;\;\;\;y \cdot \frac{x \cdot 0.5}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y - \left(t \cdot z\right) \cdot 9}{a \cdot 2}\\
\end{array}
\end{array}
if (*.f64 x y) < -1.9999999999999999e253Initial program 52.5%
sub-neg52.5%
+-commutative52.5%
neg-sub052.5%
associate-+l-52.5%
sub0-neg52.5%
neg-mul-152.5%
associate-/l*52.5%
associate-/r/52.5%
*-commutative52.5%
sub-neg52.5%
+-commutative52.5%
neg-sub052.5%
associate-+l-52.5%
sub0-neg52.5%
distribute-lft-neg-out52.5%
distribute-rgt-neg-in52.5%
Simplified58.8%
Taylor expanded in x around inf 47.6%
associate-*r/52.5%
*-commutative52.5%
associate-*l/52.5%
associate-*r*93.8%
*-commutative93.8%
associate-*l/93.7%
Simplified93.7%
if -1.9999999999999999e253 < (*.f64 x y) Initial program 94.6%
associate-*l*94.6%
Simplified94.6%
Taylor expanded in z around 0 94.6%
*-commutative94.6%
Simplified94.6%
Final simplification94.6%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(if (<= (* x y) -2e+253)
(* y (/ (* x 0.5) a))
(if (or (<= (* x y) -5e-44) (not (<= (* x y) 5e-56)))
(/ (* (* x y) 0.5) a)
(* -4.5 (/ (* t z) a)))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -2e+253) {
tmp = y * ((x * 0.5) / a);
} else if (((x * y) <= -5e-44) || !((x * y) <= 5e-56)) {
tmp = ((x * y) * 0.5) / a;
} else {
tmp = -4.5 * ((t * z) / a);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
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) :: tmp
if ((x * y) <= (-2d+253)) then
tmp = y * ((x * 0.5d0) / a)
else if (((x * y) <= (-5d-44)) .or. (.not. ((x * y) <= 5d-56))) then
tmp = ((x * y) * 0.5d0) / a
else
tmp = (-4.5d0) * ((t * z) / a)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -2e+253) {
tmp = y * ((x * 0.5) / a);
} else if (((x * y) <= -5e-44) || !((x * y) <= 5e-56)) {
tmp = ((x * y) * 0.5) / a;
} else {
tmp = -4.5 * ((t * z) / a);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if (x * y) <= -2e+253: tmp = y * ((x * 0.5) / a) elif ((x * y) <= -5e-44) or not ((x * y) <= 5e-56): tmp = ((x * y) * 0.5) / a else: tmp = -4.5 * ((t * z) / a) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (Float64(x * y) <= -2e+253) tmp = Float64(y * Float64(Float64(x * 0.5) / a)); elseif ((Float64(x * y) <= -5e-44) || !(Float64(x * y) <= 5e-56)) tmp = Float64(Float64(Float64(x * y) * 0.5) / a); else tmp = Float64(-4.5 * Float64(Float64(t * z) / a)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((x * y) <= -2e+253)
tmp = y * ((x * 0.5) / a);
elseif (((x * y) <= -5e-44) || ~(((x * y) <= 5e-56)))
tmp = ((x * y) * 0.5) / a;
else
tmp = -4.5 * ((t * z) / a);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x * y), $MachinePrecision], -2e+253], N[(y * N[(N[(x * 0.5), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(x * y), $MachinePrecision], -5e-44], N[Not[LessEqual[N[(x * y), $MachinePrecision], 5e-56]], $MachinePrecision]], N[(N[(N[(x * y), $MachinePrecision] * 0.5), $MachinePrecision] / a), $MachinePrecision], N[(-4.5 * N[(N[(t * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+253}:\\
\;\;\;\;y \cdot \frac{x \cdot 0.5}{a}\\
\mathbf{elif}\;x \cdot y \leq -5 \cdot 10^{-44} \lor \neg \left(x \cdot y \leq 5 \cdot 10^{-56}\right):\\
\;\;\;\;\frac{\left(x \cdot y\right) \cdot 0.5}{a}\\
\mathbf{else}:\\
\;\;\;\;-4.5 \cdot \frac{t \cdot z}{a}\\
\end{array}
\end{array}
if (*.f64 x y) < -1.9999999999999999e253Initial program 52.5%
sub-neg52.5%
+-commutative52.5%
neg-sub052.5%
associate-+l-52.5%
sub0-neg52.5%
neg-mul-152.5%
associate-/l*52.5%
associate-/r/52.5%
*-commutative52.5%
sub-neg52.5%
+-commutative52.5%
neg-sub052.5%
associate-+l-52.5%
sub0-neg52.5%
distribute-lft-neg-out52.5%
distribute-rgt-neg-in52.5%
Simplified58.8%
Taylor expanded in x around inf 47.6%
associate-*r/52.5%
*-commutative52.5%
associate-*l/52.5%
associate-*r*93.8%
*-commutative93.8%
associate-*l/93.7%
Simplified93.7%
if -1.9999999999999999e253 < (*.f64 x y) < -5.00000000000000039e-44 or 4.99999999999999997e-56 < (*.f64 x y) Initial program 94.2%
sub-neg94.2%
+-commutative94.2%
neg-sub094.2%
associate-+l-94.2%
sub0-neg94.2%
neg-mul-194.2%
associate-/l*94.2%
associate-/r/94.1%
*-commutative94.1%
sub-neg94.1%
+-commutative94.1%
neg-sub094.1%
associate-+l-94.1%
sub0-neg94.1%
distribute-lft-neg-out94.1%
distribute-rgt-neg-in94.1%
Simplified94.1%
Taylor expanded in x around inf 76.6%
associate-*r/76.6%
Simplified76.6%
if -5.00000000000000039e-44 < (*.f64 x y) < 4.99999999999999997e-56Initial program 95.0%
sub-neg95.0%
+-commutative95.0%
neg-sub095.0%
associate-+l-95.0%
sub0-neg95.0%
neg-mul-195.0%
associate-/l*94.4%
associate-/r/94.9%
*-commutative94.9%
sub-neg94.9%
+-commutative94.9%
neg-sub094.9%
associate-+l-94.9%
sub0-neg94.9%
distribute-lft-neg-out94.9%
distribute-rgt-neg-in94.9%
Simplified94.8%
Taylor expanded in x around 0 82.1%
Final simplification80.3%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (* x y) 0.5)))
(if (<= (* x y) -1e+136)
(* y (/ (* x 0.5) a))
(if (<= (* x y) -5e-44)
(/ 1.0 (/ a t_1))
(if (<= (* x y) 5e-56) (* -4.5 (/ (* t z) a)) (/ t_1 a))))))assert(x < y);
double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) * 0.5;
double tmp;
if ((x * y) <= -1e+136) {
tmp = y * ((x * 0.5) / a);
} else if ((x * y) <= -5e-44) {
tmp = 1.0 / (a / t_1);
} else if ((x * y) <= 5e-56) {
tmp = -4.5 * ((t * z) / a);
} else {
tmp = t_1 / a;
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
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) :: t_1
real(8) :: tmp
t_1 = (x * y) * 0.5d0
if ((x * y) <= (-1d+136)) then
tmp = y * ((x * 0.5d0) / a)
else if ((x * y) <= (-5d-44)) then
tmp = 1.0d0 / (a / t_1)
else if ((x * y) <= 5d-56) then
tmp = (-4.5d0) * ((t * z) / a)
else
tmp = t_1 / a
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (x * y) * 0.5;
double tmp;
if ((x * y) <= -1e+136) {
tmp = y * ((x * 0.5) / a);
} else if ((x * y) <= -5e-44) {
tmp = 1.0 / (a / t_1);
} else if ((x * y) <= 5e-56) {
tmp = -4.5 * ((t * z) / a);
} else {
tmp = t_1 / a;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): t_1 = (x * y) * 0.5 tmp = 0 if (x * y) <= -1e+136: tmp = y * ((x * 0.5) / a) elif (x * y) <= -5e-44: tmp = 1.0 / (a / t_1) elif (x * y) <= 5e-56: tmp = -4.5 * ((t * z) / a) else: tmp = t_1 / a return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) t_1 = Float64(Float64(x * y) * 0.5) tmp = 0.0 if (Float64(x * y) <= -1e+136) tmp = Float64(y * Float64(Float64(x * 0.5) / a)); elseif (Float64(x * y) <= -5e-44) tmp = Float64(1.0 / Float64(a / t_1)); elseif (Float64(x * y) <= 5e-56) tmp = Float64(-4.5 * Float64(Float64(t * z) / a)); else tmp = Float64(t_1 / a); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = (x * y) * 0.5;
tmp = 0.0;
if ((x * y) <= -1e+136)
tmp = y * ((x * 0.5) / a);
elseif ((x * y) <= -5e-44)
tmp = 1.0 / (a / t_1);
elseif ((x * y) <= 5e-56)
tmp = -4.5 * ((t * z) / a);
else
tmp = t_1 / a;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] * 0.5), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1e+136], N[(y * N[(N[(x * 0.5), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -5e-44], N[(1.0 / N[(a / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 5e-56], N[(-4.5 * N[(N[(t * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(t$95$1 / a), $MachinePrecision]]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := \left(x \cdot y\right) \cdot 0.5\\
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+136}:\\
\;\;\;\;y \cdot \frac{x \cdot 0.5}{a}\\
\mathbf{elif}\;x \cdot y \leq -5 \cdot 10^{-44}:\\
\;\;\;\;\frac{1}{\frac{a}{t_1}}\\
\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-56}:\\
\;\;\;\;-4.5 \cdot \frac{t \cdot z}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_1}{a}\\
\end{array}
\end{array}
if (*.f64 x y) < -1.00000000000000006e136Initial program 76.9%
sub-neg76.9%
+-commutative76.9%
neg-sub076.9%
associate-+l-76.9%
sub0-neg76.9%
neg-mul-176.9%
associate-/l*76.8%
associate-/r/76.7%
*-commutative76.7%
sub-neg76.7%
+-commutative76.7%
neg-sub076.7%
associate-+l-76.7%
sub0-neg76.7%
distribute-lft-neg-out76.7%
distribute-rgt-neg-in76.7%
Simplified79.7%
Taylor expanded in x around inf 74.5%
associate-*r/76.9%
*-commutative76.9%
associate-*l/76.7%
associate-*r*93.7%
*-commutative93.7%
associate-*l/93.8%
Simplified93.8%
if -1.00000000000000006e136 < (*.f64 x y) < -5.00000000000000039e-44Initial program 94.3%
sub-neg94.3%
+-commutative94.3%
neg-sub094.3%
associate-+l-94.3%
sub0-neg94.3%
neg-mul-194.3%
associate-/l*94.5%
associate-/r/94.1%
*-commutative94.1%
sub-neg94.1%
+-commutative94.1%
neg-sub094.1%
associate-+l-94.1%
sub0-neg94.1%
distribute-lft-neg-out94.1%
distribute-rgt-neg-in94.1%
Simplified94.1%
associate-*r/94.3%
clear-num94.5%
*-commutative94.5%
Applied egg-rr94.5%
Taylor expanded in x around inf 70.1%
if -5.00000000000000039e-44 < (*.f64 x y) < 4.99999999999999997e-56Initial program 95.0%
sub-neg95.0%
+-commutative95.0%
neg-sub095.0%
associate-+l-95.0%
sub0-neg95.0%
neg-mul-195.0%
associate-/l*94.4%
associate-/r/94.9%
*-commutative94.9%
sub-neg94.9%
+-commutative94.9%
neg-sub094.9%
associate-+l-94.9%
sub0-neg94.9%
distribute-lft-neg-out94.9%
distribute-rgt-neg-in94.9%
Simplified94.8%
Taylor expanded in x around 0 82.1%
if 4.99999999999999997e-56 < (*.f64 x y) Initial program 92.7%
sub-neg92.7%
+-commutative92.7%
neg-sub092.7%
associate-+l-92.7%
sub0-neg92.7%
neg-mul-192.7%
associate-/l*92.6%
associate-/r/92.7%
*-commutative92.7%
sub-neg92.7%
+-commutative92.7%
neg-sub092.7%
associate-+l-92.7%
sub0-neg92.7%
distribute-lft-neg-out92.7%
distribute-rgt-neg-in92.7%
Simplified92.7%
Taylor expanded in x around inf 74.1%
associate-*r/74.1%
Simplified74.1%
Final simplification79.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= (* x y) -4e+190) (* y (/ (* x 0.5) a)) (* (+ (* x y) (* z (* t -9.0))) (/ 0.5 a))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -4e+190) {
tmp = y * ((x * 0.5) / a);
} else {
tmp = ((x * y) + (z * (t * -9.0))) * (0.5 / a);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
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) :: tmp
if ((x * y) <= (-4d+190)) then
tmp = y * ((x * 0.5d0) / a)
else
tmp = ((x * y) + (z * (t * (-9.0d0)))) * (0.5d0 / a)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -4e+190) {
tmp = y * ((x * 0.5) / a);
} else {
tmp = ((x * y) + (z * (t * -9.0))) * (0.5 / a);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if (x * y) <= -4e+190: tmp = y * ((x * 0.5) / a) else: tmp = ((x * y) + (z * (t * -9.0))) * (0.5 / a) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (Float64(x * y) <= -4e+190) tmp = Float64(y * Float64(Float64(x * 0.5) / a)); else tmp = Float64(Float64(Float64(x * y) + Float64(z * Float64(t * -9.0))) * Float64(0.5 / a)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((x * y) <= -4e+190)
tmp = y * ((x * 0.5) / a);
else
tmp = ((x * y) + (z * (t * -9.0))) * (0.5 / a);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x * y), $MachinePrecision], -4e+190], N[(y * N[(N[(x * 0.5), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] + N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.5 / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -4 \cdot 10^{+190}:\\
\;\;\;\;y \cdot \frac{x \cdot 0.5}{a}\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y + z \cdot \left(t \cdot -9\right)\right) \cdot \frac{0.5}{a}\\
\end{array}
\end{array}
if (*.f64 x y) < -4.0000000000000003e190Initial program 69.6%
sub-neg69.6%
+-commutative69.6%
neg-sub069.6%
associate-+l-69.6%
sub0-neg69.6%
neg-mul-169.6%
associate-/l*69.5%
associate-/r/69.2%
*-commutative69.2%
sub-neg69.2%
+-commutative69.2%
neg-sub069.2%
associate-+l-69.2%
sub0-neg69.2%
distribute-lft-neg-out69.2%
distribute-rgt-neg-in69.2%
Simplified73.2%
Taylor expanded in x around inf 66.4%
associate-*r/69.6%
*-commutative69.6%
associate-*l/69.2%
associate-*r*91.8%
*-commutative91.8%
associate-*l/91.8%
Simplified91.8%
if -4.0000000000000003e190 < (*.f64 x y) Initial program 94.4%
sub-neg94.4%
+-commutative94.4%
neg-sub094.4%
associate-+l-94.4%
sub0-neg94.4%
neg-mul-194.4%
associate-/l*94.1%
associate-/r/94.3%
*-commutative94.3%
sub-neg94.3%
+-commutative94.3%
neg-sub094.3%
associate-+l-94.3%
sub0-neg94.3%
distribute-lft-neg-out94.3%
distribute-rgt-neg-in94.3%
Simplified94.3%
fma-udef94.3%
*-commutative94.3%
metadata-eval94.3%
distribute-lft-neg-in94.3%
distribute-rgt-neg-in94.3%
+-commutative94.3%
distribute-rgt-neg-in94.3%
distribute-lft-neg-in94.3%
metadata-eval94.3%
*-commutative94.3%
Applied egg-rr94.3%
Final simplification94.0%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= (* x y) -2e+253) (* y (/ (* x 0.5) a)) (/ (- (* x y) (* z (* t 9.0))) (* a 2.0))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -2e+253) {
tmp = y * ((x * 0.5) / a);
} else {
tmp = ((x * y) - (z * (t * 9.0))) / (a * 2.0);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
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) :: tmp
if ((x * y) <= (-2d+253)) then
tmp = y * ((x * 0.5d0) / a)
else
tmp = ((x * y) - (z * (t * 9.0d0))) / (a * 2.0d0)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((x * y) <= -2e+253) {
tmp = y * ((x * 0.5) / a);
} else {
tmp = ((x * y) - (z * (t * 9.0))) / (a * 2.0);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if (x * y) <= -2e+253: tmp = y * ((x * 0.5) / a) else: tmp = ((x * y) - (z * (t * 9.0))) / (a * 2.0) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (Float64(x * y) <= -2e+253) tmp = Float64(y * Float64(Float64(x * 0.5) / a)); else tmp = Float64(Float64(Float64(x * y) - Float64(z * Float64(t * 9.0))) / Float64(a * 2.0)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((x * y) <= -2e+253)
tmp = y * ((x * 0.5) / a);
else
tmp = ((x * y) - (z * (t * 9.0))) / (a * 2.0);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[N[(x * y), $MachinePrecision], -2e+253], N[(y * N[(N[(x * 0.5), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] - N[(z * N[(t * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+253}:\\
\;\;\;\;y \cdot \frac{x \cdot 0.5}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y - z \cdot \left(t \cdot 9\right)}{a \cdot 2}\\
\end{array}
\end{array}
if (*.f64 x y) < -1.9999999999999999e253Initial program 52.5%
sub-neg52.5%
+-commutative52.5%
neg-sub052.5%
associate-+l-52.5%
sub0-neg52.5%
neg-mul-152.5%
associate-/l*52.5%
associate-/r/52.5%
*-commutative52.5%
sub-neg52.5%
+-commutative52.5%
neg-sub052.5%
associate-+l-52.5%
sub0-neg52.5%
distribute-lft-neg-out52.5%
distribute-rgt-neg-in52.5%
Simplified58.8%
Taylor expanded in x around inf 47.6%
associate-*r/52.5%
*-commutative52.5%
associate-*l/52.5%
associate-*r*93.8%
*-commutative93.8%
associate-*l/93.7%
Simplified93.7%
if -1.9999999999999999e253 < (*.f64 x y) Initial program 94.6%
associate-*l*94.6%
Simplified94.6%
Final simplification94.5%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (or (<= t -7.8e-141) (not (<= t 8.5e+83))) (* -4.5 (/ t (/ a z))) (* 0.5 (/ y (/ a x)))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -7.8e-141) || !(t <= 8.5e+83)) {
tmp = -4.5 * (t / (a / z));
} else {
tmp = 0.5 * (y / (a / x));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
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) :: tmp
if ((t <= (-7.8d-141)) .or. (.not. (t <= 8.5d+83))) then
tmp = (-4.5d0) * (t / (a / z))
else
tmp = 0.5d0 * (y / (a / x))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -7.8e-141) || !(t <= 8.5e+83)) {
tmp = -4.5 * (t / (a / z));
} else {
tmp = 0.5 * (y / (a / x));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if (t <= -7.8e-141) or not (t <= 8.5e+83): tmp = -4.5 * (t / (a / z)) else: tmp = 0.5 * (y / (a / x)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if ((t <= -7.8e-141) || !(t <= 8.5e+83)) tmp = Float64(-4.5 * Float64(t / Float64(a / z))); else tmp = Float64(0.5 * Float64(y / Float64(a / x))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((t <= -7.8e-141) || ~((t <= 8.5e+83)))
tmp = -4.5 * (t / (a / z));
else
tmp = 0.5 * (y / (a / x));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -7.8e-141], N[Not[LessEqual[t, 8.5e+83]], $MachinePrecision]], N[(-4.5 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(y / N[(a / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.8 \cdot 10^{-141} \lor \neg \left(t \leq 8.5 \cdot 10^{+83}\right):\\
\;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \frac{y}{\frac{a}{x}}\\
\end{array}
\end{array}
if t < -7.7999999999999994e-141 or 8.4999999999999995e83 < t Initial program 90.1%
sub-neg90.1%
+-commutative90.1%
neg-sub090.1%
associate-+l-90.1%
sub0-neg90.1%
neg-mul-190.1%
associate-/l*90.0%
associate-/r/90.0%
*-commutative90.0%
sub-neg90.0%
+-commutative90.0%
neg-sub090.0%
associate-+l-90.0%
sub0-neg90.0%
distribute-lft-neg-out90.0%
distribute-rgt-neg-in90.0%
Simplified90.7%
Taylor expanded in x around 0 61.9%
associate-/l*64.7%
Simplified64.7%
if -7.7999999999999994e-141 < t < 8.4999999999999995e83Initial program 94.1%
sub-neg94.1%
+-commutative94.1%
neg-sub094.1%
associate-+l-94.1%
sub0-neg94.1%
neg-mul-194.1%
associate-/l*93.7%
associate-/r/94.0%
*-commutative94.0%
sub-neg94.0%
+-commutative94.0%
neg-sub094.0%
associate-+l-94.0%
sub0-neg94.0%
distribute-lft-neg-out94.0%
distribute-rgt-neg-in94.0%
Simplified94.0%
associate-*r/94.1%
clear-num93.7%
*-commutative93.7%
Applied egg-rr93.7%
Taylor expanded in x around inf 71.4%
associate-/l*73.2%
Simplified73.2%
Final simplification68.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (or (<= t -6.2e-140) (not (<= t 4.8e+84))) (* -4.5 (/ t (/ a z))) (* y (/ (* x 0.5) a))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -6.2e-140) || !(t <= 4.8e+84)) {
tmp = -4.5 * (t / (a / z));
} else {
tmp = y * ((x * 0.5) / a);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
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) :: tmp
if ((t <= (-6.2d-140)) .or. (.not. (t <= 4.8d+84))) then
tmp = (-4.5d0) * (t / (a / z))
else
tmp = y * ((x * 0.5d0) / a)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -6.2e-140) || !(t <= 4.8e+84)) {
tmp = -4.5 * (t / (a / z));
} else {
tmp = y * ((x * 0.5) / a);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if (t <= -6.2e-140) or not (t <= 4.8e+84): tmp = -4.5 * (t / (a / z)) else: tmp = y * ((x * 0.5) / a) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if ((t <= -6.2e-140) || !(t <= 4.8e+84)) tmp = Float64(-4.5 * Float64(t / Float64(a / z))); else tmp = Float64(y * Float64(Float64(x * 0.5) / a)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((t <= -6.2e-140) || ~((t <= 4.8e+84)))
tmp = -4.5 * (t / (a / z));
else
tmp = y * ((x * 0.5) / a);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -6.2e-140], N[Not[LessEqual[t, 4.8e+84]], $MachinePrecision]], N[(-4.5 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(x * 0.5), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.2 \cdot 10^{-140} \lor \neg \left(t \leq 4.8 \cdot 10^{+84}\right):\\
\;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{x \cdot 0.5}{a}\\
\end{array}
\end{array}
if t < -6.1999999999999998e-140 or 4.7999999999999999e84 < t Initial program 90.1%
sub-neg90.1%
+-commutative90.1%
neg-sub090.1%
associate-+l-90.1%
sub0-neg90.1%
neg-mul-190.1%
associate-/l*90.0%
associate-/r/90.0%
*-commutative90.0%
sub-neg90.0%
+-commutative90.0%
neg-sub090.0%
associate-+l-90.0%
sub0-neg90.0%
distribute-lft-neg-out90.0%
distribute-rgt-neg-in90.0%
Simplified90.7%
Taylor expanded in x around 0 61.9%
associate-/l*64.7%
Simplified64.7%
if -6.1999999999999998e-140 < t < 4.7999999999999999e84Initial program 94.1%
sub-neg94.1%
+-commutative94.1%
neg-sub094.1%
associate-+l-94.1%
sub0-neg94.1%
neg-mul-194.1%
associate-/l*93.7%
associate-/r/94.0%
*-commutative94.0%
sub-neg94.0%
+-commutative94.0%
neg-sub094.0%
associate-+l-94.0%
sub0-neg94.0%
distribute-lft-neg-out94.0%
distribute-rgt-neg-in94.0%
Simplified94.0%
Taylor expanded in x around inf 71.4%
associate-*r/72.0%
*-commutative72.0%
associate-*l/71.9%
associate-*r*73.4%
*-commutative73.4%
associate-*l/73.5%
Simplified73.5%
Final simplification68.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= t -6.2e-140) (* z (* -4.5 (/ t a))) (if (<= t 8.9e+83) (* y (/ (* x 0.5) a)) (* -4.5 (/ t (/ a z))))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -6.2e-140) {
tmp = z * (-4.5 * (t / a));
} else if (t <= 8.9e+83) {
tmp = y * ((x * 0.5) / a);
} else {
tmp = -4.5 * (t / (a / z));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
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) :: tmp
if (t <= (-6.2d-140)) then
tmp = z * ((-4.5d0) * (t / a))
else if (t <= 8.9d+83) then
tmp = y * ((x * 0.5d0) / a)
else
tmp = (-4.5d0) * (t / (a / z))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -6.2e-140) {
tmp = z * (-4.5 * (t / a));
} else if (t <= 8.9e+83) {
tmp = y * ((x * 0.5) / a);
} else {
tmp = -4.5 * (t / (a / z));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if t <= -6.2e-140: tmp = z * (-4.5 * (t / a)) elif t <= 8.9e+83: tmp = y * ((x * 0.5) / a) else: tmp = -4.5 * (t / (a / z)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (t <= -6.2e-140) tmp = Float64(z * Float64(-4.5 * Float64(t / a))); elseif (t <= 8.9e+83) tmp = Float64(y * Float64(Float64(x * 0.5) / a)); else tmp = Float64(-4.5 * Float64(t / Float64(a / z))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (t <= -6.2e-140)
tmp = z * (-4.5 * (t / a));
elseif (t <= 8.9e+83)
tmp = y * ((x * 0.5) / a);
else
tmp = -4.5 * (t / (a / z));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[t, -6.2e-140], N[(z * N[(-4.5 * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.9e+83], N[(y * N[(N[(x * 0.5), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(-4.5 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.2 \cdot 10^{-140}:\\
\;\;\;\;z \cdot \left(-4.5 \cdot \frac{t}{a}\right)\\
\mathbf{elif}\;t \leq 8.9 \cdot 10^{+83}:\\
\;\;\;\;y \cdot \frac{x \cdot 0.5}{a}\\
\mathbf{else}:\\
\;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -6.1999999999999998e-140Initial program 90.0%
sub-neg90.0%
+-commutative90.0%
neg-sub090.0%
associate-+l-90.0%
sub0-neg90.0%
neg-mul-190.0%
associate-/l*90.0%
associate-/r/90.0%
*-commutative90.0%
sub-neg90.0%
+-commutative90.0%
neg-sub090.0%
associate-+l-90.0%
sub0-neg90.0%
distribute-lft-neg-out90.0%
distribute-rgt-neg-in90.0%
Simplified89.9%
associate-*r/89.9%
clear-num90.0%
*-commutative90.0%
Applied egg-rr90.0%
Taylor expanded in x around 0 60.8%
associate-*l/61.8%
*-commutative61.8%
*-commutative61.8%
associate-*l*61.7%
Simplified61.7%
if -6.1999999999999998e-140 < t < 8.90000000000000045e83Initial program 94.1%
sub-neg94.1%
+-commutative94.1%
neg-sub094.1%
associate-+l-94.1%
sub0-neg94.1%
neg-mul-194.1%
associate-/l*93.7%
associate-/r/94.0%
*-commutative94.0%
sub-neg94.0%
+-commutative94.0%
neg-sub094.0%
associate-+l-94.0%
sub0-neg94.0%
distribute-lft-neg-out94.0%
distribute-rgt-neg-in94.0%
Simplified94.0%
Taylor expanded in x around inf 71.4%
associate-*r/72.0%
*-commutative72.0%
associate-*l/71.9%
associate-*r*73.4%
*-commutative73.4%
associate-*l/73.5%
Simplified73.5%
if 8.90000000000000045e83 < t Initial program 90.3%
sub-neg90.3%
+-commutative90.3%
neg-sub090.3%
associate-+l-90.3%
sub0-neg90.3%
neg-mul-190.3%
associate-/l*89.9%
associate-/r/90.1%
*-commutative90.1%
sub-neg90.1%
+-commutative90.1%
neg-sub090.1%
associate-+l-90.1%
sub0-neg90.1%
distribute-lft-neg-out90.1%
distribute-rgt-neg-in90.1%
Simplified92.6%
Taylor expanded in x around 0 64.6%
associate-/l*69.1%
Simplified69.1%
Final simplification68.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= t -9.8e-142) (* z (/ t (/ a -4.5))) (if (<= t 8.5e+83) (* y (/ (* x 0.5) a)) (* -4.5 (/ t (/ a z))))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -9.8e-142) {
tmp = z * (t / (a / -4.5));
} else if (t <= 8.5e+83) {
tmp = y * ((x * 0.5) / a);
} else {
tmp = -4.5 * (t / (a / z));
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
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) :: tmp
if (t <= (-9.8d-142)) then
tmp = z * (t / (a / (-4.5d0)))
else if (t <= 8.5d+83) then
tmp = y * ((x * 0.5d0) / a)
else
tmp = (-4.5d0) * (t / (a / z))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -9.8e-142) {
tmp = z * (t / (a / -4.5));
} else if (t <= 8.5e+83) {
tmp = y * ((x * 0.5) / a);
} else {
tmp = -4.5 * (t / (a / z));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if t <= -9.8e-142: tmp = z * (t / (a / -4.5)) elif t <= 8.5e+83: tmp = y * ((x * 0.5) / a) else: tmp = -4.5 * (t / (a / z)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (t <= -9.8e-142) tmp = Float64(z * Float64(t / Float64(a / -4.5))); elseif (t <= 8.5e+83) tmp = Float64(y * Float64(Float64(x * 0.5) / a)); else tmp = Float64(-4.5 * Float64(t / Float64(a / z))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (t <= -9.8e-142)
tmp = z * (t / (a / -4.5));
elseif (t <= 8.5e+83)
tmp = y * ((x * 0.5) / a);
else
tmp = -4.5 * (t / (a / z));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[t, -9.8e-142], N[(z * N[(t / N[(a / -4.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.5e+83], N[(y * N[(N[(x * 0.5), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(-4.5 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.8 \cdot 10^{-142}:\\
\;\;\;\;z \cdot \frac{t}{\frac{a}{-4.5}}\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{+83}:\\
\;\;\;\;y \cdot \frac{x \cdot 0.5}{a}\\
\mathbf{else}:\\
\;\;\;\;-4.5 \cdot \frac{t}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -9.8000000000000007e-142Initial program 90.1%
sub-neg90.1%
+-commutative90.1%
neg-sub090.1%
associate-+l-90.1%
sub0-neg90.1%
neg-mul-190.1%
associate-/l*90.1%
associate-/r/90.1%
*-commutative90.1%
sub-neg90.1%
+-commutative90.1%
neg-sub090.1%
associate-+l-90.1%
sub0-neg90.1%
distribute-lft-neg-out90.1%
distribute-rgt-neg-in90.1%
Simplified90.0%
add-cube-cbrt89.1%
pow389.1%
Applied egg-rr89.1%
Taylor expanded in x around 0 60.2%
associate-*r/60.2%
*-commutative60.2%
*-commutative60.2%
associate-/l*60.1%
associate-*r/61.1%
Simplified61.1%
if -9.8000000000000007e-142 < t < 8.4999999999999995e83Initial program 94.0%
sub-neg94.0%
+-commutative94.0%
neg-sub094.0%
associate-+l-94.0%
sub0-neg94.0%
neg-mul-194.0%
associate-/l*93.6%
associate-/r/93.9%
*-commutative93.9%
sub-neg93.9%
+-commutative93.9%
neg-sub093.9%
associate-+l-93.9%
sub0-neg93.9%
distribute-lft-neg-out93.9%
distribute-rgt-neg-in93.9%
Simplified93.9%
Taylor expanded in x around inf 71.1%
associate-*r/71.8%
*-commutative71.8%
associate-*l/71.6%
associate-*r*73.2%
*-commutative73.2%
associate-*l/73.3%
Simplified73.3%
if 8.4999999999999995e83 < t Initial program 90.3%
sub-neg90.3%
+-commutative90.3%
neg-sub090.3%
associate-+l-90.3%
sub0-neg90.3%
neg-mul-190.3%
associate-/l*89.9%
associate-/r/90.1%
*-commutative90.1%
sub-neg90.1%
+-commutative90.1%
neg-sub090.1%
associate-+l-90.1%
sub0-neg90.1%
distribute-lft-neg-out90.1%
distribute-rgt-neg-in90.1%
Simplified92.6%
Taylor expanded in x around 0 64.6%
associate-/l*69.1%
Simplified69.1%
Final simplification68.0%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= t -6.2e-140) (* z (/ t (/ a -4.5))) (if (<= t 3.6e+83) (* y (/ (* x 0.5) a)) (/ (* t -4.5) (/ a z)))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -6.2e-140) {
tmp = z * (t / (a / -4.5));
} else if (t <= 3.6e+83) {
tmp = y * ((x * 0.5) / a);
} else {
tmp = (t * -4.5) / (a / z);
}
return tmp;
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
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) :: tmp
if (t <= (-6.2d-140)) then
tmp = z * (t / (a / (-4.5d0)))
else if (t <= 3.6d+83) then
tmp = y * ((x * 0.5d0) / a)
else
tmp = (t * (-4.5d0)) / (a / z)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -6.2e-140) {
tmp = z * (t / (a / -4.5));
} else if (t <= 3.6e+83) {
tmp = y * ((x * 0.5) / a);
} else {
tmp = (t * -4.5) / (a / z);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): tmp = 0 if t <= -6.2e-140: tmp = z * (t / (a / -4.5)) elif t <= 3.6e+83: tmp = y * ((x * 0.5) / a) else: tmp = (t * -4.5) / (a / z) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a) tmp = 0.0 if (t <= -6.2e-140) tmp = Float64(z * Float64(t / Float64(a / -4.5))); elseif (t <= 3.6e+83) tmp = Float64(y * Float64(Float64(x * 0.5) / a)); else tmp = Float64(Float64(t * -4.5) / Float64(a / z)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (t <= -6.2e-140)
tmp = z * (t / (a / -4.5));
elseif (t <= 3.6e+83)
tmp = y * ((x * 0.5) / a);
else
tmp = (t * -4.5) / (a / z);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[t, -6.2e-140], N[(z * N[(t / N[(a / -4.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.6e+83], N[(y * N[(N[(x * 0.5), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(N[(t * -4.5), $MachinePrecision] / N[(a / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.2 \cdot 10^{-140}:\\
\;\;\;\;z \cdot \frac{t}{\frac{a}{-4.5}}\\
\mathbf{elif}\;t \leq 3.6 \cdot 10^{+83}:\\
\;\;\;\;y \cdot \frac{x \cdot 0.5}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot -4.5}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -6.1999999999999998e-140Initial program 90.0%
sub-neg90.0%
+-commutative90.0%
neg-sub090.0%
associate-+l-90.0%
sub0-neg90.0%
neg-mul-190.0%
associate-/l*90.0%
associate-/r/90.0%
*-commutative90.0%
sub-neg90.0%
+-commutative90.0%
neg-sub090.0%
associate-+l-90.0%
sub0-neg90.0%
distribute-lft-neg-out90.0%
distribute-rgt-neg-in90.0%
Simplified89.9%
add-cube-cbrt89.0%
pow389.0%
Applied egg-rr89.0%
Taylor expanded in x around 0 60.8%
associate-*r/60.8%
*-commutative60.8%
*-commutative60.8%
associate-/l*60.7%
associate-*r/61.7%
Simplified61.7%
if -6.1999999999999998e-140 < t < 3.5999999999999997e83Initial program 94.1%
sub-neg94.1%
+-commutative94.1%
neg-sub094.1%
associate-+l-94.1%
sub0-neg94.1%
neg-mul-194.1%
associate-/l*93.7%
associate-/r/94.0%
*-commutative94.0%
sub-neg94.0%
+-commutative94.0%
neg-sub094.0%
associate-+l-94.0%
sub0-neg94.0%
distribute-lft-neg-out94.0%
distribute-rgt-neg-in94.0%
Simplified94.0%
Taylor expanded in x around inf 71.4%
associate-*r/72.0%
*-commutative72.0%
associate-*l/71.9%
associate-*r*73.4%
*-commutative73.4%
associate-*l/73.5%
Simplified73.5%
if 3.5999999999999997e83 < t Initial program 90.3%
sub-neg90.3%
+-commutative90.3%
neg-sub090.3%
associate-+l-90.3%
sub0-neg90.3%
neg-mul-190.3%
associate-/l*89.9%
associate-/r/90.1%
*-commutative90.1%
sub-neg90.1%
+-commutative90.1%
neg-sub090.1%
associate-+l-90.1%
sub0-neg90.1%
distribute-lft-neg-out90.1%
distribute-rgt-neg-in90.1%
Simplified92.6%
Taylor expanded in x around 0 64.6%
associate-/l*69.1%
Simplified69.1%
associate-*r/69.2%
Applied egg-rr69.2%
Final simplification68.3%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (* -4.5 (/ t (/ a z))))
assert(x < y);
double code(double x, double y, double z, double t, double a) {
return -4.5 * (t / (a / z));
}
NOTE: x and y should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
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
code = (-4.5d0) * (t / (a / z))
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a) {
return -4.5 * (t / (a / z));
}
[x, y] = sort([x, y]) def code(x, y, z, t, a): return -4.5 * (t / (a / z))
x, y = sort([x, y]) function code(x, y, z, t, a) return Float64(-4.5 * Float64(t / Float64(a / z))) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z, t, a)
tmp = -4.5 * (t / (a / z));
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := N[(-4.5 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
-4.5 \cdot \frac{t}{\frac{a}{z}}
\end{array}
Initial program 92.0%
sub-neg92.0%
+-commutative92.0%
neg-sub092.0%
associate-+l-92.0%
sub0-neg92.0%
neg-mul-192.0%
associate-/l*91.7%
associate-/r/91.9%
*-commutative91.9%
sub-neg91.9%
+-commutative91.9%
neg-sub091.9%
associate-+l-91.9%
sub0-neg91.9%
distribute-lft-neg-out91.9%
distribute-rgt-neg-in91.9%
Simplified92.2%
Taylor expanded in x around 0 49.2%
associate-/l*49.7%
Simplified49.7%
Final simplification49.7%
(FPCore (x y z t a)
:precision binary64
(if (< a -2.090464557976709e+86)
(- (* 0.5 (/ (* y x) a)) (* 4.5 (/ t (/ a z))))
(if (< a 2.144030707833976e+99)
(/ (- (* x y) (* z (* 9.0 t))) (* a 2.0))
(- (* (/ y a) (* x 0.5)) (* (/ t a) (* z 4.5))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a < -2.090464557976709e+86) {
tmp = (0.5 * ((y * x) / a)) - (4.5 * (t / (a / z)));
} else if (a < 2.144030707833976e+99) {
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
} else {
tmp = ((y / a) * (x * 0.5)) - ((t / a) * (z * 4.5));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
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) :: tmp
if (a < (-2.090464557976709d+86)) then
tmp = (0.5d0 * ((y * x) / a)) - (4.5d0 * (t / (a / z)))
else if (a < 2.144030707833976d+99) then
tmp = ((x * y) - (z * (9.0d0 * t))) / (a * 2.0d0)
else
tmp = ((y / a) * (x * 0.5d0)) - ((t / a) * (z * 4.5d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a < -2.090464557976709e+86) {
tmp = (0.5 * ((y * x) / a)) - (4.5 * (t / (a / z)));
} else if (a < 2.144030707833976e+99) {
tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0);
} else {
tmp = ((y / a) * (x * 0.5)) - ((t / a) * (z * 4.5));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a < -2.090464557976709e+86: tmp = (0.5 * ((y * x) / a)) - (4.5 * (t / (a / z))) elif a < 2.144030707833976e+99: tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0) else: tmp = ((y / a) * (x * 0.5)) - ((t / a) * (z * 4.5)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a < -2.090464557976709e+86) tmp = Float64(Float64(0.5 * Float64(Float64(y * x) / a)) - Float64(4.5 * Float64(t / Float64(a / z)))); elseif (a < 2.144030707833976e+99) tmp = Float64(Float64(Float64(x * y) - Float64(z * Float64(9.0 * t))) / Float64(a * 2.0)); else tmp = Float64(Float64(Float64(y / a) * Float64(x * 0.5)) - Float64(Float64(t / a) * Float64(z * 4.5))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a < -2.090464557976709e+86) tmp = (0.5 * ((y * x) / a)) - (4.5 * (t / (a / z))); elseif (a < 2.144030707833976e+99) tmp = ((x * y) - (z * (9.0 * t))) / (a * 2.0); else tmp = ((y / a) * (x * 0.5)) - ((t / a) * (z * 4.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Less[a, -2.090464557976709e+86], N[(N[(0.5 * N[(N[(y * x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] - N[(4.5 * N[(t / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Less[a, 2.144030707833976e+99], N[(N[(N[(x * y), $MachinePrecision] - N[(z * N[(9.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y / a), $MachinePrecision] * N[(x * 0.5), $MachinePrecision]), $MachinePrecision] - N[(N[(t / a), $MachinePrecision] * N[(z * 4.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a < -2.090464557976709 \cdot 10^{+86}:\\
\;\;\;\;0.5 \cdot \frac{y \cdot x}{a} - 4.5 \cdot \frac{t}{\frac{a}{z}}\\
\mathbf{elif}\;a < 2.144030707833976 \cdot 10^{+99}:\\
\;\;\;\;\frac{x \cdot y - z \cdot \left(9 \cdot t\right)}{a \cdot 2}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a} \cdot \left(x \cdot 0.5\right) - \frac{t}{a} \cdot \left(z \cdot 4.5\right)\\
\end{array}
\end{array}
herbie shell --seed 2023238
(FPCore (x y z t a)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, I"
:precision binary64
:herbie-target
(if (< a -2.090464557976709e+86) (- (* 0.5 (/ (* y x) a)) (* 4.5 (/ t (/ a z)))) (if (< a 2.144030707833976e+99) (/ (- (* x y) (* z (* 9.0 t))) (* a 2.0)) (- (* (/ y a) (* x 0.5)) (* (/ t a) (* z 4.5)))))
(/ (- (* x y) (* (* z 9.0) t)) (* a 2.0)))