
(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 11 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 (* (/ y a) (- z t))))
double code(double x, double y, double z, double t, double a) {
return x - ((y / a) * (z - t));
}
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) * (z - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y / a) * (z - t));
}
def code(x, y, z, t, a): return x - ((y / a) * (z - t))
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y / a) * Float64(z - t))) end
function tmp = code(x, y, z, t, a) tmp = x - ((y / a) * (z - t)); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y / a), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y}{a} \cdot \left(z - t\right)
\end{array}
Initial program 90.7%
associate-*l/96.9%
Simplified96.9%
Final simplification96.9%
(FPCore (x y z t a)
:precision binary64
(if (or (<= y -3.3e-74)
(and (not (<= y 3.7e-106))
(or (<= y 19500000000.0) (not (<= y 1.02e+58)))))
(* y (/ (- t z) a))
x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -3.3e-74) || (!(y <= 3.7e-106) && ((y <= 19500000000.0) || !(y <= 1.02e+58)))) {
tmp = y * ((t - z) / 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 <= (-3.3d-74)) .or. (.not. (y <= 3.7d-106)) .and. (y <= 19500000000.0d0) .or. (.not. (y <= 1.02d+58))) then
tmp = y * ((t - z) / 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 <= -3.3e-74) || (!(y <= 3.7e-106) && ((y <= 19500000000.0) || !(y <= 1.02e+58)))) {
tmp = y * ((t - z) / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -3.3e-74) or (not (y <= 3.7e-106) and ((y <= 19500000000.0) or not (y <= 1.02e+58))): tmp = y * ((t - z) / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -3.3e-74) || (!(y <= 3.7e-106) && ((y <= 19500000000.0) || !(y <= 1.02e+58)))) tmp = Float64(y * Float64(Float64(t - z) / a)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -3.3e-74) || (~((y <= 3.7e-106)) && ((y <= 19500000000.0) || ~((y <= 1.02e+58))))) tmp = y * ((t - z) / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -3.3e-74], And[N[Not[LessEqual[y, 3.7e-106]], $MachinePrecision], Or[LessEqual[y, 19500000000.0], N[Not[LessEqual[y, 1.02e+58]], $MachinePrecision]]]], N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.3 \cdot 10^{-74} \lor \neg \left(y \leq 3.7 \cdot 10^{-106}\right) \land \left(y \leq 19500000000 \lor \neg \left(y \leq 1.02 \cdot 10^{+58}\right)\right):\\
\;\;\;\;y \cdot \frac{t - z}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -3.29999999999999996e-74 or 3.69999999999999979e-106 < y < 1.95e10 or 1.02000000000000005e58 < y Initial program 85.9%
associate-*l/97.6%
Simplified97.6%
Taylor expanded in x around 0 73.1%
mul-1-neg73.1%
associate-*r/83.6%
distribute-rgt-neg-in83.6%
neg-sub083.6%
div-sub81.7%
associate-+l-81.7%
neg-sub081.7%
+-commutative81.7%
sub-neg81.7%
div-sub83.6%
Simplified83.6%
if -3.29999999999999996e-74 < y < 3.69999999999999979e-106 or 1.95e10 < y < 1.02000000000000005e58Initial program 98.9%
associate-*l/95.7%
Simplified95.7%
Taylor expanded in x around inf 73.1%
Final simplification79.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* y (/ z a)))))
(if (<= y -2.4e-40)
t_1
(if (<= y 3.9e+61) x (if (<= y 1.09e+195) t_1 (/ t (/ a y)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = -(y * (z / a));
double tmp;
if (y <= -2.4e-40) {
tmp = t_1;
} else if (y <= 3.9e+61) {
tmp = x;
} else if (y <= 1.09e+195) {
tmp = t_1;
} else {
tmp = t / (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) :: t_1
real(8) :: tmp
t_1 = -(y * (z / a))
if (y <= (-2.4d-40)) then
tmp = t_1
else if (y <= 3.9d+61) then
tmp = x
else if (y <= 1.09d+195) then
tmp = t_1
else
tmp = t / (a / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = -(y * (z / a));
double tmp;
if (y <= -2.4e-40) {
tmp = t_1;
} else if (y <= 3.9e+61) {
tmp = x;
} else if (y <= 1.09e+195) {
tmp = t_1;
} else {
tmp = t / (a / y);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = -(y * (z / a)) tmp = 0 if y <= -2.4e-40: tmp = t_1 elif y <= 3.9e+61: tmp = x elif y <= 1.09e+195: tmp = t_1 else: tmp = t / (a / y) return tmp
function code(x, y, z, t, a) t_1 = Float64(-Float64(y * Float64(z / a))) tmp = 0.0 if (y <= -2.4e-40) tmp = t_1; elseif (y <= 3.9e+61) tmp = x; elseif (y <= 1.09e+195) tmp = t_1; else tmp = Float64(t / Float64(a / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = -(y * (z / a)); tmp = 0.0; if (y <= -2.4e-40) tmp = t_1; elseif (y <= 3.9e+61) tmp = x; elseif (y <= 1.09e+195) tmp = t_1; else tmp = t / (a / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = (-N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[y, -2.4e-40], t$95$1, If[LessEqual[y, 3.9e+61], x, If[LessEqual[y, 1.09e+195], t$95$1, N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -y \cdot \frac{z}{a}\\
\mathbf{if}\;y \leq -2.4 \cdot 10^{-40}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 3.9 \cdot 10^{+61}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.09 \cdot 10^{+195}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if y < -2.39999999999999991e-40 or 3.89999999999999987e61 < y < 1.09e195Initial program 84.4%
associate-*l/97.5%
Simplified97.5%
Taylor expanded in x around 0 74.2%
mul-1-neg74.2%
associate-*r/86.3%
distribute-rgt-neg-in86.3%
neg-sub086.3%
div-sub83.7%
associate-+l-83.7%
neg-sub083.7%
+-commutative83.7%
sub-neg83.7%
div-sub86.3%
Simplified86.3%
Taylor expanded in t around 0 62.0%
neg-mul-162.0%
distribute-neg-frac62.0%
Simplified62.0%
if -2.39999999999999991e-40 < y < 3.89999999999999987e61Initial program 98.3%
associate-*l/96.6%
Simplified96.6%
Taylor expanded in x around inf 62.9%
if 1.09e195 < y Initial program 78.9%
associate-*l/94.7%
Simplified94.7%
Taylor expanded in t around inf 46.3%
associate-*l/67.3%
*-commutative67.3%
Simplified67.3%
clear-num67.3%
div-inv67.3%
Applied egg-rr67.3%
Final simplification62.8%
(FPCore (x y z t a) :precision binary64 (if (<= y -2.7e-40) (* (/ y a) (- z)) (if (<= y 6.4e+62) x (if (<= y 3.1e+195) (- (* y (/ z a))) (/ t (/ a y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -2.7e-40) {
tmp = (y / a) * -z;
} else if (y <= 6.4e+62) {
tmp = x;
} else if (y <= 3.1e+195) {
tmp = -(y * (z / a));
} else {
tmp = t / (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 (y <= (-2.7d-40)) then
tmp = (y / a) * -z
else if (y <= 6.4d+62) then
tmp = x
else if (y <= 3.1d+195) then
tmp = -(y * (z / a))
else
tmp = t / (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 (y <= -2.7e-40) {
tmp = (y / a) * -z;
} else if (y <= 6.4e+62) {
tmp = x;
} else if (y <= 3.1e+195) {
tmp = -(y * (z / a));
} else {
tmp = t / (a / y);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -2.7e-40: tmp = (y / a) * -z elif y <= 6.4e+62: tmp = x elif y <= 3.1e+195: tmp = -(y * (z / a)) else: tmp = t / (a / y) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -2.7e-40) tmp = Float64(Float64(y / a) * Float64(-z)); elseif (y <= 6.4e+62) tmp = x; elseif (y <= 3.1e+195) tmp = Float64(-Float64(y * Float64(z / a))); else tmp = Float64(t / Float64(a / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -2.7e-40) tmp = (y / a) * -z; elseif (y <= 6.4e+62) tmp = x; elseif (y <= 3.1e+195) tmp = -(y * (z / a)); else tmp = t / (a / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -2.7e-40], N[(N[(y / a), $MachinePrecision] * (-z)), $MachinePrecision], If[LessEqual[y, 6.4e+62], x, If[LessEqual[y, 3.1e+195], (-N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.7 \cdot 10^{-40}:\\
\;\;\;\;\frac{y}{a} \cdot \left(-z\right)\\
\mathbf{elif}\;y \leq 6.4 \cdot 10^{+62}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 3.1 \cdot 10^{+195}:\\
\;\;\;\;-y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if y < -2.7e-40Initial program 85.1%
associate-*l/98.6%
Simplified98.6%
Taylor expanded in z around inf 56.7%
mul-1-neg56.7%
associate-*l/64.1%
*-commutative64.1%
distribute-rgt-neg-in64.1%
distribute-frac-neg64.1%
Simplified64.1%
if -2.7e-40 < y < 6.39999999999999968e62Initial program 98.3%
associate-*l/96.6%
Simplified96.6%
Taylor expanded in x around inf 62.9%
if 6.39999999999999968e62 < y < 3.1000000000000002e195Initial program 83.0%
associate-*l/95.3%
Simplified95.3%
Taylor expanded in x around 0 70.4%
mul-1-neg70.4%
associate-*r/84.7%
distribute-rgt-neg-in84.7%
neg-sub084.7%
div-sub77.0%
associate-+l-77.0%
neg-sub077.0%
+-commutative77.0%
sub-neg77.0%
div-sub84.7%
Simplified84.7%
Taylor expanded in t around 0 62.7%
neg-mul-162.7%
distribute-neg-frac62.7%
Simplified62.7%
if 3.1000000000000002e195 < y Initial program 78.9%
associate-*l/94.7%
Simplified94.7%
Taylor expanded in t around inf 46.3%
associate-*l/67.3%
*-commutative67.3%
Simplified67.3%
clear-num67.3%
div-inv67.3%
Applied egg-rr67.3%
Final simplification63.5%
(FPCore (x y z t a) :precision binary64 (if (<= y -1.85e-40) (* (/ y a) (- z)) (if (<= y 3.9e+61) x (if (<= y 6.2e+194) (/ (- y) (/ a z)) (/ t (/ a y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.85e-40) {
tmp = (y / a) * -z;
} else if (y <= 3.9e+61) {
tmp = x;
} else if (y <= 6.2e+194) {
tmp = -y / (a / z);
} else {
tmp = t / (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 (y <= (-1.85d-40)) then
tmp = (y / a) * -z
else if (y <= 3.9d+61) then
tmp = x
else if (y <= 6.2d+194) then
tmp = -y / (a / z)
else
tmp = t / (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 (y <= -1.85e-40) {
tmp = (y / a) * -z;
} else if (y <= 3.9e+61) {
tmp = x;
} else if (y <= 6.2e+194) {
tmp = -y / (a / z);
} else {
tmp = t / (a / y);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1.85e-40: tmp = (y / a) * -z elif y <= 3.9e+61: tmp = x elif y <= 6.2e+194: tmp = -y / (a / z) else: tmp = t / (a / y) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.85e-40) tmp = Float64(Float64(y / a) * Float64(-z)); elseif (y <= 3.9e+61) tmp = x; elseif (y <= 6.2e+194) tmp = Float64(Float64(-y) / Float64(a / z)); else tmp = Float64(t / Float64(a / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -1.85e-40) tmp = (y / a) * -z; elseif (y <= 3.9e+61) tmp = x; elseif (y <= 6.2e+194) tmp = -y / (a / z); else tmp = t / (a / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.85e-40], N[(N[(y / a), $MachinePrecision] * (-z)), $MachinePrecision], If[LessEqual[y, 3.9e+61], x, If[LessEqual[y, 6.2e+194], N[((-y) / N[(a / z), $MachinePrecision]), $MachinePrecision], N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.85 \cdot 10^{-40}:\\
\;\;\;\;\frac{y}{a} \cdot \left(-z\right)\\
\mathbf{elif}\;y \leq 3.9 \cdot 10^{+61}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 6.2 \cdot 10^{+194}:\\
\;\;\;\;\frac{-y}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if y < -1.84999999999999999e-40Initial program 85.1%
associate-*l/98.6%
Simplified98.6%
Taylor expanded in z around inf 56.7%
mul-1-neg56.7%
associate-*l/64.1%
*-commutative64.1%
distribute-rgt-neg-in64.1%
distribute-frac-neg64.1%
Simplified64.1%
if -1.84999999999999999e-40 < y < 3.89999999999999987e61Initial program 98.3%
associate-*l/96.6%
Simplified96.6%
Taylor expanded in x around inf 62.9%
if 3.89999999999999987e61 < y < 6.1999999999999999e194Initial program 83.0%
associate-*l/95.3%
Simplified95.3%
Taylor expanded in x around 0 70.4%
mul-1-neg70.4%
associate-*r/84.7%
distribute-rgt-neg-in84.7%
neg-sub084.7%
div-sub77.0%
associate-+l-77.0%
neg-sub077.0%
+-commutative77.0%
sub-neg77.0%
div-sub84.7%
Simplified84.7%
Taylor expanded in t around 0 62.7%
neg-mul-162.7%
distribute-neg-frac62.7%
Simplified62.7%
Taylor expanded in y around 0 48.5%
mul-1-neg48.5%
associate-/l*62.8%
distribute-neg-frac62.8%
Simplified62.8%
if 6.1999999999999999e194 < y Initial program 78.9%
associate-*l/94.7%
Simplified94.7%
Taylor expanded in t around inf 46.3%
associate-*l/67.3%
*-commutative67.3%
Simplified67.3%
clear-num67.3%
div-inv67.3%
Applied egg-rr67.3%
Final simplification63.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -2.7e-40) (not (<= y 5e+58))) (* y (/ (- t z) a)) (+ x (* (/ y a) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -2.7e-40) || !(y <= 5e+58)) {
tmp = y * ((t - z) / a);
} else {
tmp = x + ((y / a) * t);
}
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-40)) .or. (.not. (y <= 5d+58))) then
tmp = y * ((t - z) / a)
else
tmp = x + ((y / a) * t)
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-40) || !(y <= 5e+58)) {
tmp = y * ((t - z) / a);
} else {
tmp = x + ((y / a) * t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -2.7e-40) or not (y <= 5e+58): tmp = y * ((t - z) / a) else: tmp = x + ((y / a) * t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -2.7e-40) || !(y <= 5e+58)) tmp = Float64(y * Float64(Float64(t - z) / a)); else tmp = Float64(x + Float64(Float64(y / a) * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -2.7e-40) || ~((y <= 5e+58))) tmp = y * ((t - z) / a); else tmp = x + ((y / a) * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -2.7e-40], N[Not[LessEqual[y, 5e+58]], $MachinePrecision]], N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y / a), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.7 \cdot 10^{-40} \lor \neg \left(y \leq 5 \cdot 10^{+58}\right):\\
\;\;\;\;y \cdot \frac{t - z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{a} \cdot t\\
\end{array}
\end{array}
if y < -2.7e-40 or 4.99999999999999986e58 < y Initial program 83.2%
associate-*l/97.2%
Simplified97.2%
Taylor expanded in x around 0 73.8%
mul-1-neg73.8%
associate-*r/87.6%
distribute-rgt-neg-in87.6%
neg-sub087.6%
div-sub85.4%
associate-+l-85.4%
neg-sub085.4%
+-commutative85.4%
sub-neg85.4%
div-sub87.6%
Simplified87.6%
if -2.7e-40 < y < 4.99999999999999986e58Initial program 99.1%
associate-*l/96.6%
Simplified96.6%
Taylor expanded in z around 0 80.0%
cancel-sign-sub-inv80.0%
metadata-eval80.0%
*-lft-identity80.0%
+-commutative80.0%
associate-*l/79.8%
*-commutative79.8%
Simplified79.8%
Final simplification83.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.5e+42) (not (<= z 4.2e+23))) (- x (* (/ y a) z)) (+ x (* (/ y a) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.5e+42) || !(z <= 4.2e+23)) {
tmp = x - ((y / a) * z);
} else {
tmp = x + ((y / a) * t);
}
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.5d+42)) .or. (.not. (z <= 4.2d+23))) then
tmp = x - ((y / a) * z)
else
tmp = x + ((y / a) * t)
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.5e+42) || !(z <= 4.2e+23)) {
tmp = x - ((y / a) * z);
} else {
tmp = x + ((y / a) * t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.5e+42) or not (z <= 4.2e+23): tmp = x - ((y / a) * z) else: tmp = x + ((y / a) * t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.5e+42) || !(z <= 4.2e+23)) tmp = Float64(x - Float64(Float64(y / a) * z)); else tmp = Float64(x + Float64(Float64(y / a) * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.5e+42) || ~((z <= 4.2e+23))) tmp = x - ((y / a) * z); else tmp = x + ((y / a) * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.5e+42], N[Not[LessEqual[z, 4.2e+23]], $MachinePrecision]], N[(x - N[(N[(y / a), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y / a), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{+42} \lor \neg \left(z \leq 4.2 \cdot 10^{+23}\right):\\
\;\;\;\;x - \frac{y}{a} \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{a} \cdot t\\
\end{array}
\end{array}
if z < -2.50000000000000003e42 or 4.2000000000000003e23 < z Initial program 89.8%
associate-*l/96.8%
Simplified96.8%
Taylor expanded in z around inf 84.0%
associate-*l/89.5%
*-commutative89.5%
Simplified89.5%
if -2.50000000000000003e42 < z < 4.2000000000000003e23Initial program 91.5%
associate-*l/97.0%
Simplified97.0%
Taylor expanded in z around 0 82.3%
cancel-sign-sub-inv82.3%
metadata-eval82.3%
*-lft-identity82.3%
+-commutative82.3%
associate-*l/90.5%
*-commutative90.5%
Simplified90.5%
Final simplification90.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -6.6e-74) (not (<= y 1.05e+58))) (* (/ y a) t) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -6.6e-74) || !(y <= 1.05e+58)) {
tmp = (y / a) * t;
} 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 <= (-6.6d-74)) .or. (.not. (y <= 1.05d+58))) then
tmp = (y / a) * t
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 <= -6.6e-74) || !(y <= 1.05e+58)) {
tmp = (y / a) * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -6.6e-74) or not (y <= 1.05e+58): tmp = (y / a) * t else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -6.6e-74) || !(y <= 1.05e+58)) tmp = Float64(Float64(y / a) * t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -6.6e-74) || ~((y <= 1.05e+58))) tmp = (y / a) * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -6.6e-74], N[Not[LessEqual[y, 1.05e+58]], $MachinePrecision]], N[(N[(y / a), $MachinePrecision] * t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.6 \cdot 10^{-74} \lor \neg \left(y \leq 1.05 \cdot 10^{+58}\right):\\
\;\;\;\;\frac{y}{a} \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -6.59999999999999992e-74 or 1.05000000000000006e58 < y Initial program 84.5%
associate-*l/97.4%
Simplified97.4%
Taylor expanded in t around inf 34.5%
associate-*l/42.8%
*-commutative42.8%
Simplified42.8%
if -6.59999999999999992e-74 < y < 1.05000000000000006e58Initial program 99.0%
associate-*l/96.2%
Simplified96.2%
Taylor expanded in x around inf 66.9%
Final simplification53.0%
(FPCore (x y z t a) :precision binary64 (if (<= y -4.8e-74) (* (/ y a) t) (if (<= y 1.04e+58) x (/ t (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -4.8e-74) {
tmp = (y / a) * t;
} else if (y <= 1.04e+58) {
tmp = x;
} else {
tmp = t / (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 (y <= (-4.8d-74)) then
tmp = (y / a) * t
else if (y <= 1.04d+58) then
tmp = x
else
tmp = t / (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 (y <= -4.8e-74) {
tmp = (y / a) * t;
} else if (y <= 1.04e+58) {
tmp = x;
} else {
tmp = t / (a / y);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -4.8e-74: tmp = (y / a) * t elif y <= 1.04e+58: tmp = x else: tmp = t / (a / y) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -4.8e-74) tmp = Float64(Float64(y / a) * t); elseif (y <= 1.04e+58) tmp = x; else tmp = Float64(t / Float64(a / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -4.8e-74) tmp = (y / a) * t; elseif (y <= 1.04e+58) tmp = x; else tmp = t / (a / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -4.8e-74], N[(N[(y / a), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[y, 1.04e+58], x, N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.8 \cdot 10^{-74}:\\
\;\;\;\;\frac{y}{a} \cdot t\\
\mathbf{elif}\;y \leq 1.04 \cdot 10^{+58}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if y < -4.7999999999999998e-74Initial program 87.1%
associate-*l/98.8%
Simplified98.8%
Taylor expanded in t around inf 34.9%
associate-*l/43.3%
*-commutative43.3%
Simplified43.3%
if -4.7999999999999998e-74 < y < 1.04e58Initial program 99.0%
associate-*l/96.2%
Simplified96.2%
Taylor expanded in x around inf 66.9%
if 1.04e58 < y Initial program 80.7%
associate-*l/95.3%
Simplified95.3%
Taylor expanded in t around inf 33.9%
associate-*l/42.0%
*-commutative42.0%
Simplified42.0%
clear-num42.0%
div-inv42.0%
Applied egg-rr42.0%
Final simplification53.0%
(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 90.7%
associate-*r/95.1%
Simplified95.1%
Final simplification95.1%
(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 90.7%
associate-*l/96.9%
Simplified96.9%
Taylor expanded in x around inf 37.4%
Final simplification37.4%
(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 2023195
(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)))