
(FPCore (x y z t a) :precision binary64 (- x (/ (* y (- z t)) a)))
double code(double x, double y, double z, double t, double a) {
return x - ((y * (z - t)) / a);
}
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 - t)) / a)
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y * (z - t)) / a);
}
def code(x, y, z, t, a): return x - ((y * (z - t)) / a)
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y * Float64(z - t)) / a)) end
function tmp = code(x, y, z, t, a) tmp = x - ((y * (z - t)) / a); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y \cdot \left(z - t\right)}{a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (- x (/ (* y (- z t)) a)))
double code(double x, double y, double z, double t, double a) {
return x - ((y * (z - t)) / a);
}
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 - t)) / a)
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y * (z - t)) / a);
}
def code(x, y, z, t, a): return x - ((y * (z - t)) / a)
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y * Float64(z - t)) / a)) end
function tmp = code(x, y, z, t, a) tmp = x - ((y * (z - t)) / a); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y \cdot \left(z - t\right)}{a}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (/ (- t z) (/ a y))))
double code(double x, double y, double z, double t, double a) {
return x + ((t - z) / (a / y));
}
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 + ((t - z) / (a / y))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((t - z) / (a / y));
}
def code(x, y, z, t, a): return x + ((t - z) / (a / y))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(t - z) / Float64(a / y))) end
function tmp = code(x, y, z, t, a) tmp = x + ((t - z) / (a / y)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(t - z), $MachinePrecision] / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{t - z}{\frac{a}{y}}
\end{array}
Initial program 93.6%
associate-*r/91.8%
Simplified91.8%
*-commutative91.8%
associate-*l/93.6%
associate-/l*97.1%
Applied egg-rr97.1%
Final simplification97.1%
(FPCore (x y z t a)
:precision binary64
(if (<= y -2.5e+49)
(/ t (/ a y))
(if (<= y 4.5e-89)
x
(if (<= y 150000000000.0)
(/ (* t y) a)
(if (or (<= y 3.6e+134) (not (<= y 7e+225)))
(* z (/ (- y) a))
(* y (/ t a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -2.5e+49) {
tmp = t / (a / y);
} else if (y <= 4.5e-89) {
tmp = x;
} else if (y <= 150000000000.0) {
tmp = (t * y) / a;
} else if ((y <= 3.6e+134) || !(y <= 7e+225)) {
tmp = z * (-y / a);
} else {
tmp = y * (t / a);
}
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 (y <= (-2.5d+49)) then
tmp = t / (a / y)
else if (y <= 4.5d-89) then
tmp = x
else if (y <= 150000000000.0d0) then
tmp = (t * y) / a
else if ((y <= 3.6d+134) .or. (.not. (y <= 7d+225))) then
tmp = z * (-y / a)
else
tmp = y * (t / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -2.5e+49) {
tmp = t / (a / y);
} else if (y <= 4.5e-89) {
tmp = x;
} else if (y <= 150000000000.0) {
tmp = (t * y) / a;
} else if ((y <= 3.6e+134) || !(y <= 7e+225)) {
tmp = z * (-y / a);
} else {
tmp = y * (t / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -2.5e+49: tmp = t / (a / y) elif y <= 4.5e-89: tmp = x elif y <= 150000000000.0: tmp = (t * y) / a elif (y <= 3.6e+134) or not (y <= 7e+225): tmp = z * (-y / a) else: tmp = y * (t / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -2.5e+49) tmp = Float64(t / Float64(a / y)); elseif (y <= 4.5e-89) tmp = x; elseif (y <= 150000000000.0) tmp = Float64(Float64(t * y) / a); elseif ((y <= 3.6e+134) || !(y <= 7e+225)) tmp = Float64(z * Float64(Float64(-y) / a)); else tmp = Float64(y * Float64(t / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -2.5e+49) tmp = t / (a / y); elseif (y <= 4.5e-89) tmp = x; elseif (y <= 150000000000.0) tmp = (t * y) / a; elseif ((y <= 3.6e+134) || ~((y <= 7e+225))) tmp = z * (-y / a); else tmp = y * (t / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -2.5e+49], N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.5e-89], x, If[LessEqual[y, 150000000000.0], N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision], If[Or[LessEqual[y, 3.6e+134], N[Not[LessEqual[y, 7e+225]], $MachinePrecision]], N[(z * N[((-y) / a), $MachinePrecision]), $MachinePrecision], N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{+49}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{-89}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 150000000000:\\
\;\;\;\;\frac{t \cdot y}{a}\\
\mathbf{elif}\;y \leq 3.6 \cdot 10^{+134} \lor \neg \left(y \leq 7 \cdot 10^{+225}\right):\\
\;\;\;\;z \cdot \frac{-y}{a}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if y < -2.5000000000000002e49Initial program 88.9%
associate-*r/98.2%
Simplified98.2%
Taylor expanded in t around inf 45.7%
associate-*l/53.2%
*-commutative53.2%
Simplified53.2%
clear-num53.1%
div-inv53.4%
Applied egg-rr53.4%
if -2.5000000000000002e49 < y < 4.4999999999999999e-89Initial program 99.0%
associate-*r/83.4%
Simplified83.4%
Taylor expanded in x around inf 67.3%
if 4.4999999999999999e-89 < y < 1.5e11Initial program 99.9%
associate-*r/93.0%
Simplified93.0%
Taylor expanded in t around inf 67.7%
if 1.5e11 < y < 3.59999999999999988e134 or 7.0000000000000006e225 < y Initial program 89.1%
associate-*r/98.0%
Simplified98.0%
Taylor expanded in z around inf 51.0%
mul-1-neg51.0%
associate-*l/57.6%
*-commutative57.6%
distribute-rgt-neg-in57.6%
distribute-frac-neg57.6%
Simplified57.6%
if 3.59999999999999988e134 < y < 7.0000000000000006e225Initial program 86.5%
associate-*r/99.9%
Simplified99.9%
*-commutative99.9%
associate-*l/86.5%
associate-/l*95.6%
Applied egg-rr95.6%
Taylor expanded in t around inf 72.4%
associate-*r/77.0%
Simplified77.0%
Final simplification62.9%
(FPCore (x y z t a)
:precision binary64
(if (<= y -1.9e+49)
(/ t (/ a y))
(if (<= y 9.2e-94)
x
(if (<= y 13500000000.0)
(/ (* t y) a)
(if (<= y 3.7e+134)
(/ y (/ (- a) z))
(if (<= y 7e+225) (* y (/ t a)) (* z (/ (- y) a))))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.9e+49) {
tmp = t / (a / y);
} else if (y <= 9.2e-94) {
tmp = x;
} else if (y <= 13500000000.0) {
tmp = (t * y) / a;
} else if (y <= 3.7e+134) {
tmp = y / (-a / z);
} else if (y <= 7e+225) {
tmp = y * (t / a);
} else {
tmp = z * (-y / a);
}
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 (y <= (-1.9d+49)) then
tmp = t / (a / y)
else if (y <= 9.2d-94) then
tmp = x
else if (y <= 13500000000.0d0) then
tmp = (t * y) / a
else if (y <= 3.7d+134) then
tmp = y / (-a / z)
else if (y <= 7d+225) then
tmp = y * (t / a)
else
tmp = z * (-y / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.9e+49) {
tmp = t / (a / y);
} else if (y <= 9.2e-94) {
tmp = x;
} else if (y <= 13500000000.0) {
tmp = (t * y) / a;
} else if (y <= 3.7e+134) {
tmp = y / (-a / z);
} else if (y <= 7e+225) {
tmp = y * (t / a);
} else {
tmp = z * (-y / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1.9e+49: tmp = t / (a / y) elif y <= 9.2e-94: tmp = x elif y <= 13500000000.0: tmp = (t * y) / a elif y <= 3.7e+134: tmp = y / (-a / z) elif y <= 7e+225: tmp = y * (t / a) else: tmp = z * (-y / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.9e+49) tmp = Float64(t / Float64(a / y)); elseif (y <= 9.2e-94) tmp = x; elseif (y <= 13500000000.0) tmp = Float64(Float64(t * y) / a); elseif (y <= 3.7e+134) tmp = Float64(y / Float64(Float64(-a) / z)); elseif (y <= 7e+225) tmp = Float64(y * Float64(t / a)); else tmp = Float64(z * Float64(Float64(-y) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -1.9e+49) tmp = t / (a / y); elseif (y <= 9.2e-94) tmp = x; elseif (y <= 13500000000.0) tmp = (t * y) / a; elseif (y <= 3.7e+134) tmp = y / (-a / z); elseif (y <= 7e+225) tmp = y * (t / a); else tmp = z * (-y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.9e+49], N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.2e-94], x, If[LessEqual[y, 13500000000.0], N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[y, 3.7e+134], N[(y / N[((-a) / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7e+225], N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision], N[(z * N[((-y) / a), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.9 \cdot 10^{+49}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\mathbf{elif}\;y \leq 9.2 \cdot 10^{-94}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 13500000000:\\
\;\;\;\;\frac{t \cdot y}{a}\\
\mathbf{elif}\;y \leq 3.7 \cdot 10^{+134}:\\
\;\;\;\;\frac{y}{\frac{-a}{z}}\\
\mathbf{elif}\;y \leq 7 \cdot 10^{+225}:\\
\;\;\;\;y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{-y}{a}\\
\end{array}
\end{array}
if y < -1.8999999999999999e49Initial program 88.9%
associate-*r/98.2%
Simplified98.2%
Taylor expanded in t around inf 45.7%
associate-*l/53.2%
*-commutative53.2%
Simplified53.2%
clear-num53.1%
div-inv53.4%
Applied egg-rr53.4%
if -1.8999999999999999e49 < y < 9.1999999999999997e-94Initial program 99.0%
associate-*r/83.4%
Simplified83.4%
Taylor expanded in x around inf 67.3%
if 9.1999999999999997e-94 < y < 1.35e10Initial program 99.9%
associate-*r/93.0%
Simplified93.0%
Taylor expanded in t around inf 67.7%
if 1.35e10 < y < 3.70000000000000013e134Initial program 86.4%
associate-*r/99.8%
Simplified99.8%
Taylor expanded in z around inf 42.8%
mul-1-neg42.8%
associate-*l/48.3%
*-commutative48.3%
distribute-rgt-neg-in48.3%
distribute-frac-neg48.3%
Simplified48.3%
*-commutative48.3%
distribute-frac-neg48.3%
distribute-lft-neg-in48.3%
associate-/r/49.4%
frac-2neg49.4%
distribute-neg-frac49.4%
remove-double-neg49.4%
distribute-neg-frac49.4%
Applied egg-rr49.4%
if 3.70000000000000013e134 < y < 7.0000000000000006e225Initial program 86.5%
associate-*r/99.9%
Simplified99.9%
*-commutative99.9%
associate-*l/86.5%
associate-/l*95.6%
Applied egg-rr95.6%
Taylor expanded in t around inf 72.4%
associate-*r/77.0%
Simplified77.0%
if 7.0000000000000006e225 < y Initial program 92.3%
associate-*r/96.0%
Simplified96.0%
Taylor expanded in z around inf 60.6%
mul-1-neg60.6%
associate-*l/68.4%
*-commutative68.4%
distribute-rgt-neg-in68.4%
distribute-frac-neg68.4%
Simplified68.4%
Final simplification63.0%
(FPCore (x y z t a)
:precision binary64
(if (or (<= y -4.4e-38)
(not (or (<= y -2e-75) (and (not (<= y -1.6e-143)) (<= y 2.2e-161)))))
(* (/ y a) (- t z))
x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -4.4e-38) || !((y <= -2e-75) || (!(y <= -1.6e-143) && (y <= 2.2e-161)))) {
tmp = (y / a) * (t - z);
} else {
tmp = x;
}
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 ((y <= (-4.4d-38)) .or. (.not. (y <= (-2d-75)) .or. (.not. (y <= (-1.6d-143))) .and. (y <= 2.2d-161))) then
tmp = (y / a) * (t - z)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -4.4e-38) || !((y <= -2e-75) || (!(y <= -1.6e-143) && (y <= 2.2e-161)))) {
tmp = (y / a) * (t - z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -4.4e-38) or not ((y <= -2e-75) or (not (y <= -1.6e-143) and (y <= 2.2e-161))): tmp = (y / a) * (t - z) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -4.4e-38) || !((y <= -2e-75) || (!(y <= -1.6e-143) && (y <= 2.2e-161)))) tmp = Float64(Float64(y / a) * Float64(t - z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -4.4e-38) || ~(((y <= -2e-75) || (~((y <= -1.6e-143)) && (y <= 2.2e-161))))) tmp = (y / a) * (t - z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -4.4e-38], N[Not[Or[LessEqual[y, -2e-75], And[N[Not[LessEqual[y, -1.6e-143]], $MachinePrecision], LessEqual[y, 2.2e-161]]]], $MachinePrecision]], N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.4 \cdot 10^{-38} \lor \neg \left(y \leq -2 \cdot 10^{-75} \lor \neg \left(y \leq -1.6 \cdot 10^{-143}\right) \land y \leq 2.2 \cdot 10^{-161}\right):\\
\;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -4.40000000000000015e-38 or -1.9999999999999999e-75 < y < -1.5999999999999999e-143 or 2.20000000000000002e-161 < y Initial program 91.8%
associate-*r/95.8%
Simplified95.8%
*-commutative95.8%
associate-*l/91.8%
associate-/l*96.6%
Applied egg-rr96.6%
Taylor expanded in x around 0 70.2%
associate-/l*74.4%
div-sub64.7%
associate-/l*62.9%
associate-/l*64.2%
associate-*r/62.5%
associate-*r/64.2%
associate-*l/64.3%
*-commutative64.3%
distribute-lft-out--64.3%
neg-mul-164.3%
rem-3cbrt-rft64.2%
unpow264.2%
neg-mul-164.2%
distribute-lft-neg-in64.2%
cancel-sign-sub64.2%
distribute-lft-neg-in64.2%
Simplified74.1%
if -4.40000000000000015e-38 < y < -1.9999999999999999e-75 or -1.5999999999999999e-143 < y < 2.20000000000000002e-161Initial program 98.5%
associate-*r/81.0%
Simplified81.0%
Taylor expanded in x around inf 80.7%
Final simplification75.9%
(FPCore (x y z t a)
:precision binary64
(if (or (<= y -2.7e+49)
(not (or (<= y 2.4e-91) (and (not (<= y 1.4e+87)) (<= y 3.4e+134)))))
(* t (/ y a))
x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -2.7e+49) || !((y <= 2.4e-91) || (!(y <= 1.4e+87) && (y <= 3.4e+134)))) {
tmp = t * (y / a);
} else {
tmp = x;
}
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 ((y <= (-2.7d+49)) .or. (.not. (y <= 2.4d-91) .or. (.not. (y <= 1.4d+87)) .and. (y <= 3.4d+134))) then
tmp = t * (y / a)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -2.7e+49) || !((y <= 2.4e-91) || (!(y <= 1.4e+87) && (y <= 3.4e+134)))) {
tmp = t * (y / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -2.7e+49) or not ((y <= 2.4e-91) or (not (y <= 1.4e+87) and (y <= 3.4e+134))): tmp = t * (y / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -2.7e+49) || !((y <= 2.4e-91) || (!(y <= 1.4e+87) && (y <= 3.4e+134)))) tmp = Float64(t * Float64(y / a)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -2.7e+49) || ~(((y <= 2.4e-91) || (~((y <= 1.4e+87)) && (y <= 3.4e+134))))) tmp = t * (y / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -2.7e+49], N[Not[Or[LessEqual[y, 2.4e-91], And[N[Not[LessEqual[y, 1.4e+87]], $MachinePrecision], LessEqual[y, 3.4e+134]]]], $MachinePrecision]], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.7 \cdot 10^{+49} \lor \neg \left(y \leq 2.4 \cdot 10^{-91} \lor \neg \left(y \leq 1.4 \cdot 10^{+87}\right) \land y \leq 3.4 \cdot 10^{+134}\right):\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -2.7000000000000001e49 or 2.40000000000000011e-91 < y < 1.40000000000000008e87 or 3.40000000000000018e134 < y Initial program 89.7%
associate-*r/97.7%
Simplified97.7%
Taylor expanded in t around inf 49.8%
associate-*l/53.6%
*-commutative53.6%
Simplified53.6%
if -2.7000000000000001e49 < y < 2.40000000000000011e-91 or 1.40000000000000008e87 < y < 3.40000000000000018e134Initial program 98.3%
associate-*r/84.8%
Simplified84.8%
Taylor expanded in x around inf 65.9%
Final simplification59.3%
(FPCore (x y z t a)
:precision binary64
(if (<= y -1.8e+49)
(* t (/ y a))
(if (<= y 1.2e-93)
x
(if (or (<= y 1.55e+87) (not (<= y 3.4e+134))) (* y (/ t a)) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.8e+49) {
tmp = t * (y / a);
} else if (y <= 1.2e-93) {
tmp = x;
} else if ((y <= 1.55e+87) || !(y <= 3.4e+134)) {
tmp = y * (t / a);
} else {
tmp = x;
}
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 (y <= (-1.8d+49)) then
tmp = t * (y / a)
else if (y <= 1.2d-93) then
tmp = x
else if ((y <= 1.55d+87) .or. (.not. (y <= 3.4d+134))) then
tmp = y * (t / a)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.8e+49) {
tmp = t * (y / a);
} else if (y <= 1.2e-93) {
tmp = x;
} else if ((y <= 1.55e+87) || !(y <= 3.4e+134)) {
tmp = y * (t / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1.8e+49: tmp = t * (y / a) elif y <= 1.2e-93: tmp = x elif (y <= 1.55e+87) or not (y <= 3.4e+134): tmp = y * (t / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.8e+49) tmp = Float64(t * Float64(y / a)); elseif (y <= 1.2e-93) tmp = x; elseif ((y <= 1.55e+87) || !(y <= 3.4e+134)) tmp = Float64(y * Float64(t / a)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -1.8e+49) tmp = t * (y / a); elseif (y <= 1.2e-93) tmp = x; elseif ((y <= 1.55e+87) || ~((y <= 3.4e+134))) tmp = y * (t / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.8e+49], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.2e-93], x, If[Or[LessEqual[y, 1.55e+87], N[Not[LessEqual[y, 3.4e+134]], $MachinePrecision]], N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.8 \cdot 10^{+49}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{-93}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.55 \cdot 10^{+87} \lor \neg \left(y \leq 3.4 \cdot 10^{+134}\right):\\
\;\;\;\;y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.79999999999999998e49Initial program 88.9%
associate-*r/98.2%
Simplified98.2%
Taylor expanded in t around inf 45.7%
associate-*l/53.2%
*-commutative53.2%
Simplified53.2%
if -1.79999999999999998e49 < y < 1.2000000000000001e-93 or 1.55e87 < y < 3.40000000000000018e134Initial program 98.3%
associate-*r/84.8%
Simplified84.8%
Taylor expanded in x around inf 65.9%
if 1.2000000000000001e-93 < y < 1.55e87 or 3.40000000000000018e134 < y Initial program 90.3%
associate-*r/97.3%
Simplified97.3%
*-commutative97.3%
associate-*l/90.3%
associate-/l*97.4%
Applied egg-rr97.4%
Taylor expanded in t around inf 52.9%
associate-*r/56.3%
Simplified56.3%
Final simplification60.0%
(FPCore (x y z t a)
:precision binary64
(if (<= y -2.2e+49)
(/ t (/ a y))
(if (<= y 4.2e-89)
x
(if (or (<= y 6e+84) (not (<= y 3.4e+134))) (* y (/ t a)) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -2.2e+49) {
tmp = t / (a / y);
} else if (y <= 4.2e-89) {
tmp = x;
} else if ((y <= 6e+84) || !(y <= 3.4e+134)) {
tmp = y * (t / a);
} else {
tmp = x;
}
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 (y <= (-2.2d+49)) then
tmp = t / (a / y)
else if (y <= 4.2d-89) then
tmp = x
else if ((y <= 6d+84) .or. (.not. (y <= 3.4d+134))) then
tmp = y * (t / a)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -2.2e+49) {
tmp = t / (a / y);
} else if (y <= 4.2e-89) {
tmp = x;
} else if ((y <= 6e+84) || !(y <= 3.4e+134)) {
tmp = y * (t / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -2.2e+49: tmp = t / (a / y) elif y <= 4.2e-89: tmp = x elif (y <= 6e+84) or not (y <= 3.4e+134): tmp = y * (t / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -2.2e+49) tmp = Float64(t / Float64(a / y)); elseif (y <= 4.2e-89) tmp = x; elseif ((y <= 6e+84) || !(y <= 3.4e+134)) tmp = Float64(y * Float64(t / a)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -2.2e+49) tmp = t / (a / y); elseif (y <= 4.2e-89) tmp = x; elseif ((y <= 6e+84) || ~((y <= 3.4e+134))) tmp = y * (t / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -2.2e+49], N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.2e-89], x, If[Or[LessEqual[y, 6e+84], N[Not[LessEqual[y, 3.4e+134]], $MachinePrecision]], N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.2 \cdot 10^{+49}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{-89}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 6 \cdot 10^{+84} \lor \neg \left(y \leq 3.4 \cdot 10^{+134}\right):\\
\;\;\;\;y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -2.2000000000000001e49Initial program 88.9%
associate-*r/98.2%
Simplified98.2%
Taylor expanded in t around inf 45.7%
associate-*l/53.2%
*-commutative53.2%
Simplified53.2%
clear-num53.1%
div-inv53.4%
Applied egg-rr53.4%
if -2.2000000000000001e49 < y < 4.2000000000000002e-89 or 5.99999999999999992e84 < y < 3.40000000000000018e134Initial program 98.3%
associate-*r/84.8%
Simplified84.8%
Taylor expanded in x around inf 65.9%
if 4.2000000000000002e-89 < y < 5.99999999999999992e84 or 3.40000000000000018e134 < y Initial program 90.3%
associate-*r/97.3%
Simplified97.3%
*-commutative97.3%
associate-*l/90.3%
associate-/l*97.4%
Applied egg-rr97.4%
Taylor expanded in t around inf 52.9%
associate-*r/56.3%
Simplified56.3%
Final simplification60.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.9e-11) (not (<= a 8e-99))) (+ x (* y (/ t a))) (* (/ y a) (- t z))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.9e-11) || !(a <= 8e-99)) {
tmp = x + (y * (t / a));
} else {
tmp = (y / a) * (t - z);
}
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 <= (-1.9d-11)) .or. (.not. (a <= 8d-99))) then
tmp = x + (y * (t / a))
else
tmp = (y / a) * (t - z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.9e-11) || !(a <= 8e-99)) {
tmp = x + (y * (t / a));
} else {
tmp = (y / a) * (t - z);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.9e-11) or not (a <= 8e-99): tmp = x + (y * (t / a)) else: tmp = (y / a) * (t - z) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.9e-11) || !(a <= 8e-99)) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(Float64(y / a) * Float64(t - z)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.9e-11) || ~((a <= 8e-99))) tmp = x + (y * (t / a)); else tmp = (y / a) * (t - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.9e-11], N[Not[LessEqual[a, 8e-99]], $MachinePrecision]], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.9 \cdot 10^{-11} \lor \neg \left(a \leq 8 \cdot 10^{-99}\right):\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\
\end{array}
\end{array}
if a < -1.8999999999999999e-11 or 8.0000000000000002e-99 < a Initial program 90.1%
associate-*r/97.4%
Simplified97.4%
Taylor expanded in z around 0 77.5%
neg-mul-177.5%
distribute-neg-frac77.5%
Simplified77.5%
sub-neg77.5%
distribute-lft-neg-in77.5%
add-sqr-sqrt39.2%
sqrt-unprod56.6%
sqr-neg56.6%
sqrt-unprod25.8%
add-sqr-sqrt54.2%
add-sqr-sqrt27.9%
sqrt-unprod51.0%
sqr-neg51.0%
sqrt-unprod35.1%
add-sqr-sqrt77.5%
Applied egg-rr77.5%
if -1.8999999999999999e-11 < a < 8.0000000000000002e-99Initial program 98.9%
associate-*r/83.4%
Simplified83.4%
*-commutative83.4%
associate-*l/98.9%
associate-/l*97.2%
Applied egg-rr97.2%
Taylor expanded in x around 0 83.2%
associate-/l*81.5%
div-sub66.9%
associate-/l*69.9%
associate-/l*75.5%
associate-*r/69.9%
associate-*r/75.5%
associate-*l/67.2%
*-commutative67.2%
distribute-lft-out--67.2%
neg-mul-167.2%
rem-3cbrt-rft67.1%
unpow267.1%
neg-mul-167.1%
distribute-lft-neg-in67.1%
cancel-sign-sub67.1%
distribute-lft-neg-in67.1%
Simplified81.6%
Final simplification79.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.85e+57) (not (<= z 3.05e-22))) (- x (* y (/ z a))) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.85e+57) || !(z <= 3.05e-22)) {
tmp = x - (y * (z / a));
} else {
tmp = x + (t * (y / a));
}
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 ((z <= (-2.85d+57)) .or. (.not. (z <= 3.05d-22))) then
tmp = x - (y * (z / a))
else
tmp = x + (t * (y / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.85e+57) || !(z <= 3.05e-22)) {
tmp = x - (y * (z / a));
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.85e+57) or not (z <= 3.05e-22): tmp = x - (y * (z / a)) else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.85e+57) || !(z <= 3.05e-22)) tmp = Float64(x - Float64(y * Float64(z / a))); else tmp = Float64(x + Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.85e+57) || ~((z <= 3.05e-22))) tmp = x - (y * (z / a)); else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.85e+57], N[Not[LessEqual[z, 3.05e-22]], $MachinePrecision]], N[(x - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.85 \cdot 10^{+57} \lor \neg \left(z \leq 3.05 \cdot 10^{-22}\right):\\
\;\;\;\;x - y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -2.8499999999999999e57 or 3.04999999999999978e-22 < z Initial program 91.0%
associate-*r/90.0%
Simplified90.0%
Taylor expanded in z around inf 86.6%
if -2.8499999999999999e57 < z < 3.04999999999999978e-22Initial program 95.8%
associate-*r/93.2%
Simplified93.2%
Taylor expanded in z around 0 87.4%
sub-neg87.4%
mul-1-neg87.4%
remove-double-neg87.4%
+-commutative87.4%
associate-*l/89.8%
*-commutative89.8%
Simplified89.8%
Final simplification88.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -5.5e+194) (* (/ y a) (- t z)) (if (<= z 1.9e+171) (+ x (* t (/ y a))) (/ (- z) (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.5e+194) {
tmp = (y / a) * (t - z);
} else if (z <= 1.9e+171) {
tmp = x + (t * (y / a));
} else {
tmp = -z / (a / y);
}
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 (z <= (-5.5d+194)) then
tmp = (y / a) * (t - z)
else if (z <= 1.9d+171) then
tmp = x + (t * (y / a))
else
tmp = -z / (a / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.5e+194) {
tmp = (y / a) * (t - z);
} else if (z <= 1.9e+171) {
tmp = x + (t * (y / a));
} else {
tmp = -z / (a / y);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.5e+194: tmp = (y / a) * (t - z) elif z <= 1.9e+171: tmp = x + (t * (y / a)) else: tmp = -z / (a / y) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.5e+194) tmp = Float64(Float64(y / a) * Float64(t - z)); elseif (z <= 1.9e+171) tmp = Float64(x + Float64(t * Float64(y / a))); else tmp = Float64(Float64(-z) / Float64(a / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5.5e+194) tmp = (y / a) * (t - z); elseif (z <= 1.9e+171) tmp = x + (t * (y / a)); else tmp = -z / (a / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.5e+194], N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.9e+171], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-z) / N[(a / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+194}:\\
\;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{+171}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{-z}{\frac{a}{y}}\\
\end{array}
\end{array}
if z < -5.4999999999999999e194Initial program 83.6%
associate-*r/87.8%
Simplified87.8%
*-commutative87.8%
associate-*l/83.6%
associate-/l*95.6%
Applied egg-rr95.6%
Taylor expanded in x around 0 70.8%
associate-/l*82.8%
div-sub74.1%
associate-/l*65.8%
associate-/l*66.1%
associate-*r/65.9%
associate-*r/66.1%
associate-*l/70.2%
*-commutative70.2%
distribute-lft-out--70.2%
neg-mul-170.2%
rem-3cbrt-rft69.6%
unpow269.6%
neg-mul-169.6%
distribute-lft-neg-in69.6%
cancel-sign-sub69.6%
distribute-lft-neg-in69.6%
Simplified83.0%
if -5.4999999999999999e194 < z < 1.9000000000000001e171Initial program 95.2%
associate-*r/92.4%
Simplified92.4%
Taylor expanded in z around 0 80.6%
sub-neg80.6%
mul-1-neg80.6%
remove-double-neg80.6%
+-commutative80.6%
associate-*l/82.7%
*-commutative82.7%
Simplified82.7%
if 1.9000000000000001e171 < z Initial program 90.5%
associate-*r/90.3%
Simplified90.3%
Taylor expanded in z around inf 80.9%
mul-1-neg80.9%
associate-*l/87.1%
*-commutative87.1%
distribute-rgt-neg-in87.1%
distribute-frac-neg87.1%
Simplified87.1%
add-sqr-sqrt46.9%
sqrt-unprod43.9%
distribute-frac-neg43.9%
distribute-frac-neg43.9%
sqr-neg43.9%
sqrt-unprod0.3%
add-sqr-sqrt0.8%
clear-num0.8%
div-inv0.8%
frac-2neg0.8%
distribute-neg-frac0.8%
add-sqr-sqrt0.2%
sqrt-unprod34.0%
sqr-neg34.0%
sqrt-unprod40.1%
add-sqr-sqrt87.1%
frac-2neg87.1%
Applied egg-rr87.1%
Final simplification83.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.1e+55) (- x (* y (/ z a))) (if (<= z 1.38e-15) (+ x (* t (/ y a))) (- x (/ y (/ a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.1e+55) {
tmp = x - (y * (z / a));
} else if (z <= 1.38e-15) {
tmp = x + (t * (y / a));
} else {
tmp = x - (y / (a / z));
}
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 (z <= (-2.1d+55)) then
tmp = x - (y * (z / a))
else if (z <= 1.38d-15) then
tmp = x + (t * (y / a))
else
tmp = x - (y / (a / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.1e+55) {
tmp = x - (y * (z / a));
} else if (z <= 1.38e-15) {
tmp = x + (t * (y / a));
} else {
tmp = x - (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.1e+55: tmp = x - (y * (z / a)) elif z <= 1.38e-15: tmp = x + (t * (y / a)) else: tmp = x - (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.1e+55) tmp = Float64(x - Float64(y * Float64(z / a))); elseif (z <= 1.38e-15) tmp = Float64(x + Float64(t * Float64(y / a))); else tmp = Float64(x - Float64(y / Float64(a / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.1e+55) tmp = x - (y * (z / a)); elseif (z <= 1.38e-15) tmp = x + (t * (y / a)); else tmp = x - (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.1e+55], N[(x - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.38e-15], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{+55}:\\
\;\;\;\;x - y \cdot \frac{z}{a}\\
\mathbf{elif}\;z \leq 1.38 \cdot 10^{-15}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if z < -2.1000000000000001e55Initial program 88.6%
associate-*r/90.3%
Simplified90.3%
Taylor expanded in z around inf 82.4%
if -2.1000000000000001e55 < z < 1.3799999999999999e-15Initial program 95.8%
associate-*r/93.2%
Simplified93.2%
Taylor expanded in z around 0 87.4%
sub-neg87.4%
mul-1-neg87.4%
remove-double-neg87.4%
+-commutative87.4%
associate-*l/89.8%
*-commutative89.8%
Simplified89.8%
if 1.3799999999999999e-15 < z Initial program 92.8%
associate-/l*89.9%
Simplified89.9%
Taylor expanded in z around inf 89.8%
Final simplification88.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -2e+57) (- x (* y (/ z a))) (if (<= z 1.4e-20) (+ x (* t (/ y a))) (- x (/ (* z y) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2e+57) {
tmp = x - (y * (z / a));
} else if (z <= 1.4e-20) {
tmp = x + (t * (y / a));
} else {
tmp = x - ((z * y) / a);
}
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 (z <= (-2d+57)) then
tmp = x - (y * (z / a))
else if (z <= 1.4d-20) then
tmp = x + (t * (y / a))
else
tmp = x - ((z * y) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2e+57) {
tmp = x - (y * (z / a));
} else if (z <= 1.4e-20) {
tmp = x + (t * (y / a));
} else {
tmp = x - ((z * y) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2e+57: tmp = x - (y * (z / a)) elif z <= 1.4e-20: tmp = x + (t * (y / a)) else: tmp = x - ((z * y) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2e+57) tmp = Float64(x - Float64(y * Float64(z / a))); elseif (z <= 1.4e-20) tmp = Float64(x + Float64(t * Float64(y / a))); else tmp = Float64(x - Float64(Float64(z * y) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2e+57) tmp = x - (y * (z / a)); elseif (z <= 1.4e-20) tmp = x + (t * (y / a)); else tmp = x - ((z * y) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2e+57], N[(x - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.4e-20], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+57}:\\
\;\;\;\;x - y \cdot \frac{z}{a}\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-20}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{z \cdot y}{a}\\
\end{array}
\end{array}
if z < -2.0000000000000001e57Initial program 88.6%
associate-*r/90.3%
Simplified90.3%
Taylor expanded in z around inf 82.4%
if -2.0000000000000001e57 < z < 1.4000000000000001e-20Initial program 95.8%
associate-*r/93.2%
Simplified93.2%
Taylor expanded in z around 0 87.4%
sub-neg87.4%
mul-1-neg87.4%
remove-double-neg87.4%
+-commutative87.4%
associate-*l/89.8%
*-commutative89.8%
Simplified89.8%
if 1.4000000000000001e-20 < z Initial program 92.8%
associate-*r/89.8%
Simplified89.8%
Taylor expanded in z around inf 89.9%
Final simplification88.4%
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- t z) a))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((t - z) / a));
}
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 * ((t - z) / a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((t - z) / a));
}
def code(x, y, z, t, a): return x + (y * ((t - z) / a))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(t - z) / a))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((t - z) / a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{t - z}{a}
\end{array}
Initial program 93.6%
associate-*r/91.8%
Simplified91.8%
Final simplification91.8%
(FPCore (x y z t a) :precision binary64 (+ x (* (/ y a) (- t z))))
double code(double x, double y, double z, double t, double a) {
return x + ((y / a) * (t - z));
}
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 / a) * (t - z))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y / a) * (t - z));
}
def code(x, y, z, t, a): return x + ((y / a) * (t - z))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y / a) * Float64(t - z))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y / a) * (t - z)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{a} \cdot \left(t - z\right)
\end{array}
Initial program 93.6%
associate-*l/96.9%
Simplified96.9%
Final simplification96.9%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
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
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 93.6%
associate-*r/91.8%
Simplified91.8%
Taylor expanded in x around inf 39.5%
Final simplification39.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ a (- z t))))
(if (< y -1.0761266216389975e-10)
(- x (/ 1.0 (/ t_1 y)))
(if (< y 2.894426862792089e-49)
(- x (/ (* y (- z t)) a))
(- x (/ y t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a / (z - t);
double tmp;
if (y < -1.0761266216389975e-10) {
tmp = x - (1.0 / (t_1 / y));
} else if (y < 2.894426862792089e-49) {
tmp = x - ((y * (z - t)) / a);
} else {
tmp = x - (y / t_1);
}
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) :: t_1
real(8) :: tmp
t_1 = a / (z - t)
if (y < (-1.0761266216389975d-10)) then
tmp = x - (1.0d0 / (t_1 / y))
else if (y < 2.894426862792089d-49) then
tmp = x - ((y * (z - t)) / a)
else
tmp = x - (y / t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = a / (z - t);
double tmp;
if (y < -1.0761266216389975e-10) {
tmp = x - (1.0 / (t_1 / y));
} else if (y < 2.894426862792089e-49) {
tmp = x - ((y * (z - t)) / a);
} else {
tmp = x - (y / t_1);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a / (z - t) tmp = 0 if y < -1.0761266216389975e-10: tmp = x - (1.0 / (t_1 / y)) elif y < 2.894426862792089e-49: tmp = x - ((y * (z - t)) / a) else: tmp = x - (y / t_1) return tmp
function code(x, y, z, t, a) t_1 = Float64(a / Float64(z - t)) tmp = 0.0 if (y < -1.0761266216389975e-10) tmp = Float64(x - Float64(1.0 / Float64(t_1 / y))); elseif (y < 2.894426862792089e-49) tmp = Float64(x - Float64(Float64(y * Float64(z - t)) / a)); else tmp = Float64(x - Float64(y / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a / (z - t); tmp = 0.0; if (y < -1.0761266216389975e-10) tmp = x - (1.0 / (t_1 / y)); elseif (y < 2.894426862792089e-49) tmp = x - ((y * (z - t)) / a); else tmp = x - (y / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[Less[y, -1.0761266216389975e-10], N[(x - N[(1.0 / N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Less[y, 2.894426862792089e-49], N[(x - N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a}{z - t}\\
\mathbf{if}\;y < -1.0761266216389975 \cdot 10^{-10}:\\
\;\;\;\;x - \frac{1}{\frac{t_1}{y}}\\
\mathbf{elif}\;y < 2.894426862792089 \cdot 10^{-49}:\\
\;\;\;\;x - \frac{y \cdot \left(z - t\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{t_1}\\
\end{array}
\end{array}
herbie shell --seed 2023208
(FPCore (x y z t a)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, F"
:precision binary64
:herbie-target
(if (< y -1.0761266216389975e-10) (- x (/ 1.0 (/ (/ a (- z t)) y))) (if (< y 2.894426862792089e-49) (- x (/ (* y (- z t)) a)) (- x (/ y (/ a (- z t))))))
(- x (/ (* y (- z t)) a)))