
(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 13 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 (- 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(y / Float64(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[(y / N[(a / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{a}{t - z}}
\end{array}
Initial program 94.3%
associate-/l*96.6%
Simplified96.6%
clear-num96.6%
un-div-inv97.3%
Applied egg-rr97.3%
Final simplification97.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ t (/ a y))))
(if (<= y -1.05e+96)
t_1
(if (<= y 1.7e-64) x (if (<= y 1e+192) (* z (/ y (- a))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t / (a / y);
double tmp;
if (y <= -1.05e+96) {
tmp = t_1;
} else if (y <= 1.7e-64) {
tmp = x;
} else if (y <= 1e+192) {
tmp = z * (y / -a);
} else {
tmp = 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 = t / (a / y)
if (y <= (-1.05d+96)) then
tmp = t_1
else if (y <= 1.7d-64) then
tmp = x
else if (y <= 1d+192) then
tmp = z * (y / -a)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t / (a / y);
double tmp;
if (y <= -1.05e+96) {
tmp = t_1;
} else if (y <= 1.7e-64) {
tmp = x;
} else if (y <= 1e+192) {
tmp = z * (y / -a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t / (a / y) tmp = 0 if y <= -1.05e+96: tmp = t_1 elif y <= 1.7e-64: tmp = x elif y <= 1e+192: tmp = z * (y / -a) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(t / Float64(a / y)) tmp = 0.0 if (y <= -1.05e+96) tmp = t_1; elseif (y <= 1.7e-64) tmp = x; elseif (y <= 1e+192) tmp = Float64(z * Float64(y / Float64(-a))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t / (a / y); tmp = 0.0; if (y <= -1.05e+96) tmp = t_1; elseif (y <= 1.7e-64) tmp = x; elseif (y <= 1e+192) tmp = z * (y / -a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.05e+96], t$95$1, If[LessEqual[y, 1.7e-64], x, If[LessEqual[y, 1e+192], N[(z * N[(y / (-a)), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t}{\frac{a}{y}}\\
\mathbf{if}\;y \leq -1.05 \cdot 10^{+96}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{-64}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 10^{+192}:\\
\;\;\;\;z \cdot \frac{y}{-a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.0500000000000001e96 or 1.00000000000000004e192 < y Initial program 86.4%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around inf 50.0%
associate-/l*60.6%
Simplified60.6%
clear-num60.6%
un-div-inv60.6%
Applied egg-rr60.6%
if -1.0500000000000001e96 < y < 1.70000000000000006e-64Initial program 99.2%
associate-/l*94.0%
Simplified94.0%
Taylor expanded in x around inf 66.4%
if 1.70000000000000006e-64 < y < 1.00000000000000004e192Initial program 93.3%
associate-/l*98.4%
Simplified98.4%
Taylor expanded in z around inf 51.1%
mul-1-neg51.1%
associate-/l*54.4%
distribute-rgt-neg-in54.4%
distribute-neg-frac254.4%
Simplified54.4%
associate-*r/51.1%
frac-2neg51.1%
distribute-rgt-neg-in51.1%
remove-double-neg51.1%
Applied egg-rr51.1%
Taylor expanded in y around 0 51.1%
neg-mul-151.1%
distribute-neg-frac251.1%
*-commutative51.1%
associate-*r/55.9%
Simplified55.9%
(FPCore (x y z t a) :precision binary64 (if (<= y -5e+96) (/ t (/ a y)) (if (<= y 6.5e-64) x (if (<= y 1.15e+58) (* (/ z a) (- y)) (* t (/ y a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -5e+96) {
tmp = t / (a / y);
} else if (y <= 6.5e-64) {
tmp = x;
} else if (y <= 1.15e+58) {
tmp = (z / a) * -y;
} else {
tmp = 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 (y <= (-5d+96)) then
tmp = t / (a / y)
else if (y <= 6.5d-64) then
tmp = x
else if (y <= 1.15d+58) then
tmp = (z / a) * -y
else
tmp = 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 (y <= -5e+96) {
tmp = t / (a / y);
} else if (y <= 6.5e-64) {
tmp = x;
} else if (y <= 1.15e+58) {
tmp = (z / a) * -y;
} else {
tmp = t * (y / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -5e+96: tmp = t / (a / y) elif y <= 6.5e-64: tmp = x elif y <= 1.15e+58: tmp = (z / a) * -y else: tmp = t * (y / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -5e+96) tmp = Float64(t / Float64(a / y)); elseif (y <= 6.5e-64) tmp = x; elseif (y <= 1.15e+58) tmp = Float64(Float64(z / a) * Float64(-y)); else tmp = Float64(t * Float64(y / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -5e+96) tmp = t / (a / y); elseif (y <= 6.5e-64) tmp = x; elseif (y <= 1.15e+58) tmp = (z / a) * -y; else tmp = t * (y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -5e+96], N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.5e-64], x, If[LessEqual[y, 1.15e+58], N[(N[(z / a), $MachinePrecision] * (-y)), $MachinePrecision], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{+96}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{-64}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{+58}:\\
\;\;\;\;\frac{z}{a} \cdot \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if y < -5.0000000000000004e96Initial program 87.9%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around inf 46.9%
associate-/l*56.6%
Simplified56.6%
clear-num56.6%
un-div-inv56.6%
Applied egg-rr56.6%
if -5.0000000000000004e96 < y < 6.5000000000000004e-64Initial program 99.2%
associate-/l*94.0%
Simplified94.0%
Taylor expanded in x around inf 66.4%
if 6.5000000000000004e-64 < y < 1.15000000000000001e58Initial program 99.9%
associate-/l*96.8%
Simplified96.8%
Taylor expanded in z around inf 59.3%
mul-1-neg59.3%
associate-/l*59.2%
distribute-rgt-neg-in59.2%
distribute-neg-frac259.2%
Simplified59.2%
if 1.15000000000000001e58 < y Initial program 85.6%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around inf 50.1%
associate-/l*57.9%
Simplified57.9%
Final simplification62.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -4.5e+65) (not (<= t 2.1e+45))) (+ x (* t (/ y a))) (- x (/ y (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -4.5e+65) || !(t <= 2.1e+45)) {
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 ((t <= (-4.5d+65)) .or. (.not. (t <= 2.1d+45))) 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 ((t <= -4.5e+65) || !(t <= 2.1e+45)) {
tmp = x + (t * (y / a));
} else {
tmp = x - (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -4.5e+65) or not (t <= 2.1e+45): tmp = x + (t * (y / a)) else: tmp = x - (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -4.5e+65) || !(t <= 2.1e+45)) 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 ((t <= -4.5e+65) || ~((t <= 2.1e+45))) tmp = x + (t * (y / a)); else tmp = x - (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -4.5e+65], N[Not[LessEqual[t, 2.1e+45]], $MachinePrecision]], 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}\;t \leq -4.5 \cdot 10^{+65} \lor \neg \left(t \leq 2.1 \cdot 10^{+45}\right):\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -4.5e65 or 2.09999999999999995e45 < t Initial program 91.2%
sub-neg91.2%
distribute-frac-neg291.2%
+-commutative91.2%
associate-/l*95.2%
fma-define95.2%
distribute-frac-neg295.2%
distribute-neg-frac95.2%
sub-neg95.2%
distribute-neg-in95.2%
remove-double-neg95.2%
+-commutative95.2%
sub-neg95.2%
Simplified95.2%
Taylor expanded in z around 0 82.4%
associate-*r/90.1%
*-commutative90.1%
Applied egg-rr90.1%
if -4.5e65 < t < 2.09999999999999995e45Initial program 96.3%
associate-/l*97.5%
Simplified97.5%
clear-num97.5%
un-div-inv98.6%
Applied egg-rr98.6%
Taylor expanded in z around inf 91.1%
Final simplification90.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -5e+65) (not (<= t 1.05e+45))) (+ x (* t (/ y a))) (- x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5e+65) || !(t <= 1.05e+45)) {
tmp = x + (t * (y / a));
} else {
tmp = x - (y * (z / 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 ((t <= (-5d+65)) .or. (.not. (t <= 1.05d+45))) then
tmp = x + (t * (y / a))
else
tmp = x - (y * (z / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5e+65) || !(t <= 1.05e+45)) {
tmp = x + (t * (y / a));
} else {
tmp = x - (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -5e+65) or not (t <= 1.05e+45): tmp = x + (t * (y / a)) else: tmp = x - (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -5e+65) || !(t <= 1.05e+45)) tmp = Float64(x + Float64(t * Float64(y / a))); else tmp = Float64(x - Float64(y * Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -5e+65) || ~((t <= 1.05e+45))) tmp = x + (t * (y / a)); else tmp = x - (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -5e+65], N[Not[LessEqual[t, 1.05e+45]], $MachinePrecision]], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{+65} \lor \neg \left(t \leq 1.05 \cdot 10^{+45}\right):\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -4.99999999999999973e65 or 1.04999999999999997e45 < t Initial program 91.2%
sub-neg91.2%
distribute-frac-neg291.2%
+-commutative91.2%
associate-/l*95.2%
fma-define95.2%
distribute-frac-neg295.2%
distribute-neg-frac95.2%
sub-neg95.2%
distribute-neg-in95.2%
remove-double-neg95.2%
+-commutative95.2%
sub-neg95.2%
Simplified95.2%
Taylor expanded in z around 0 82.4%
associate-*r/90.1%
*-commutative90.1%
Applied egg-rr90.1%
if -4.99999999999999973e65 < t < 1.04999999999999997e45Initial program 96.3%
associate-/l*97.5%
Simplified97.5%
Taylor expanded in z around inf 88.9%
associate-/l*90.5%
Simplified90.5%
Final simplification90.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.4e+20) (not (<= z 1.2e+118))) (* (/ y a) (- t z)) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.4e+20) || !(z <= 1.2e+118)) {
tmp = (y / a) * (t - z);
} 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 <= (-3.4d+20)) .or. (.not. (z <= 1.2d+118))) then
tmp = (y / a) * (t - z)
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 <= -3.4e+20) || !(z <= 1.2e+118)) {
tmp = (y / a) * (t - z);
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.4e+20) or not (z <= 1.2e+118): tmp = (y / a) * (t - z) else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.4e+20) || !(z <= 1.2e+118)) tmp = Float64(Float64(y / a) * Float64(t - z)); 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 <= -3.4e+20) || ~((z <= 1.2e+118))) tmp = (y / a) * (t - z); else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.4e+20], N[Not[LessEqual[z, 1.2e+118]], $MachinePrecision]], N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.4 \cdot 10^{+20} \lor \neg \left(z \leq 1.2 \cdot 10^{+118}\right):\\
\;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -3.4e20 or 1.2e118 < z Initial program 87.4%
associate-/l*95.6%
Simplified95.6%
clear-num95.6%
un-div-inv96.6%
Applied egg-rr96.6%
Taylor expanded in x around 0 68.9%
mul-1-neg68.9%
associate-*l/79.1%
sub-neg79.1%
distribute-lft-out72.5%
associate-*l/61.0%
associate-*r/70.3%
+-commutative70.3%
*-commutative70.3%
distribute-lft-neg-out70.3%
associate-/l*67.4%
mul-1-neg67.4%
distribute-neg-in67.4%
mul-1-neg67.4%
remove-double-neg67.4%
sub-neg67.4%
*-commutative67.4%
associate-*l/62.1%
associate-*r/69.5%
associate-/l*72.5%
distribute-rgt-out--79.1%
Simplified79.1%
if -3.4e20 < z < 1.2e118Initial program 98.1%
sub-neg98.1%
distribute-frac-neg298.1%
+-commutative98.1%
associate-/l*97.1%
fma-define97.2%
distribute-frac-neg297.2%
distribute-neg-frac97.2%
sub-neg97.2%
distribute-neg-in97.2%
remove-double-neg97.2%
+-commutative97.2%
sub-neg97.2%
Simplified97.2%
Taylor expanded in z around 0 85.9%
associate-*r/89.3%
*-commutative89.3%
Applied egg-rr89.3%
Final simplification85.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -6.4e+35) (not (<= y 2.6e-64))) (* y (/ (- t z) a)) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -6.4e+35) || !(y <= 2.6e-64)) {
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 <= (-6.4d+35)) .or. (.not. (y <= 2.6d-64))) 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 <= -6.4e+35) || !(y <= 2.6e-64)) {
tmp = y * ((t - z) / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -6.4e+35) or not (y <= 2.6e-64): tmp = y * ((t - z) / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -6.4e+35) || !(y <= 2.6e-64)) 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 <= -6.4e+35) || ~((y <= 2.6e-64))) tmp = y * ((t - z) / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -6.4e+35], N[Not[LessEqual[y, 2.6e-64]], $MachinePrecision]], N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.4 \cdot 10^{+35} \lor \neg \left(y \leq 2.6 \cdot 10^{-64}\right):\\
\;\;\;\;y \cdot \frac{t - z}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -6.39999999999999965e35 or 2.6e-64 < y Initial program 90.3%
associate-/l*99.3%
Simplified99.3%
Taylor expanded in x around 0 73.6%
associate-*r/73.6%
neg-mul-173.6%
distribute-rgt-neg-in73.6%
sub-neg73.6%
distribute-neg-in73.6%
remove-double-neg73.6%
+-commutative73.6%
sub-neg73.6%
associate-*r/79.9%
Simplified79.9%
if -6.39999999999999965e35 < y < 2.6e-64Initial program 99.9%
associate-/l*92.9%
Simplified92.9%
Taylor expanded in x around inf 71.9%
Final simplification76.5%
(FPCore (x y z t a) :precision binary64 (if (<= t -6.5e+64) (* t (+ (/ x t) (/ y a))) (if (<= t 2.6e+43) (- x (/ y (/ a z))) (+ x (* t (/ y a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -6.5e+64) {
tmp = t * ((x / t) + (y / a));
} else if (t <= 2.6e+43) {
tmp = x - (y / (a / z));
} 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 (t <= (-6.5d+64)) then
tmp = t * ((x / t) + (y / a))
else if (t <= 2.6d+43) then
tmp = x - (y / (a / z))
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 (t <= -6.5e+64) {
tmp = t * ((x / t) + (y / a));
} else if (t <= 2.6e+43) {
tmp = x - (y / (a / z));
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -6.5e+64: tmp = t * ((x / t) + (y / a)) elif t <= 2.6e+43: tmp = x - (y / (a / z)) else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -6.5e+64) tmp = Float64(t * Float64(Float64(x / t) + Float64(y / a))); elseif (t <= 2.6e+43) tmp = Float64(x - Float64(y / Float64(a / z))); 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 (t <= -6.5e+64) tmp = t * ((x / t) + (y / a)); elseif (t <= 2.6e+43) tmp = x - (y / (a / z)); else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -6.5e+64], N[(t * N[(N[(x / t), $MachinePrecision] + N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.6e+43], N[(x - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.5 \cdot 10^{+64}:\\
\;\;\;\;t \cdot \left(\frac{x}{t} + \frac{y}{a}\right)\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{+43}:\\
\;\;\;\;x - \frac{y}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -6.50000000000000007e64Initial program 90.3%
sub-neg90.3%
distribute-frac-neg290.3%
+-commutative90.3%
associate-/l*96.1%
fma-define96.1%
distribute-frac-neg296.1%
distribute-neg-frac96.1%
sub-neg96.1%
distribute-neg-in96.1%
remove-double-neg96.1%
+-commutative96.1%
sub-neg96.1%
Simplified96.1%
Taylor expanded in z around 0 80.7%
Taylor expanded in t around inf 90.1%
if -6.50000000000000007e64 < t < 2.60000000000000021e43Initial program 96.3%
associate-/l*97.5%
Simplified97.5%
clear-num97.5%
un-div-inv98.6%
Applied egg-rr98.6%
Taylor expanded in z around inf 91.1%
if 2.60000000000000021e43 < t Initial program 92.1%
sub-neg92.1%
distribute-frac-neg292.1%
+-commutative92.1%
associate-/l*94.2%
fma-define94.2%
distribute-frac-neg294.2%
distribute-neg-frac94.2%
sub-neg94.2%
distribute-neg-in94.2%
remove-double-neg94.2%
+-commutative94.2%
sub-neg94.2%
Simplified94.2%
Taylor expanded in z around 0 84.2%
associate-*r/90.0%
*-commutative90.0%
Applied egg-rr90.0%
Final simplification90.7%
(FPCore (x y z t a) :precision binary64 (if (<= y -1.1e+36) (* y (/ (- t z) a)) (if (<= y 3.8e-64) x (* (/ y a) (- t z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.1e+36) {
tmp = y * ((t - z) / a);
} else if (y <= 3.8e-64) {
tmp = x;
} 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 (y <= (-1.1d+36)) then
tmp = y * ((t - z) / a)
else if (y <= 3.8d-64) then
tmp = x
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 (y <= -1.1e+36) {
tmp = y * ((t - z) / a);
} else if (y <= 3.8e-64) {
tmp = x;
} else {
tmp = (y / a) * (t - z);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1.1e+36: tmp = y * ((t - z) / a) elif y <= 3.8e-64: tmp = x else: tmp = (y / a) * (t - z) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.1e+36) tmp = Float64(y * Float64(Float64(t - z) / a)); elseif (y <= 3.8e-64) tmp = x; 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 (y <= -1.1e+36) tmp = y * ((t - z) / a); elseif (y <= 3.8e-64) tmp = x; else tmp = (y / a) * (t - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.1e+36], N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.8e-64], x, N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{+36}:\\
\;\;\;\;y \cdot \frac{t - z}{a}\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{-64}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\
\end{array}
\end{array}
if y < -1.1e36Initial program 90.5%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around 0 69.5%
associate-*r/69.5%
neg-mul-169.5%
distribute-rgt-neg-in69.5%
sub-neg69.5%
distribute-neg-in69.5%
remove-double-neg69.5%
+-commutative69.5%
sub-neg69.5%
associate-*r/77.3%
Simplified77.3%
if -1.1e36 < y < 3.8000000000000002e-64Initial program 99.9%
associate-/l*92.9%
Simplified92.9%
Taylor expanded in x around inf 71.9%
if 3.8000000000000002e-64 < y Initial program 90.2%
associate-/l*98.9%
Simplified98.9%
clear-num98.9%
un-div-inv99.0%
Applied egg-rr99.0%
Taylor expanded in x around 0 76.2%
mul-1-neg76.2%
associate-*l/82.5%
sub-neg82.5%
distribute-lft-out74.7%
associate-*l/72.8%
associate-*r/79.2%
+-commutative79.2%
*-commutative79.2%
distribute-lft-neg-out79.2%
associate-/l*76.0%
mul-1-neg76.0%
distribute-neg-in76.0%
mul-1-neg76.0%
remove-double-neg76.0%
sub-neg76.0%
*-commutative76.0%
associate-*l/71.7%
associate-*r/71.5%
associate-/l*74.7%
distribute-rgt-out--82.5%
Simplified82.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -5.8e+95) (not (<= y 7e-45))) (* t (/ y a)) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -5.8e+95) || !(y <= 7e-45)) {
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 <= (-5.8d+95)) .or. (.not. (y <= 7d-45))) 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 <= -5.8e+95) || !(y <= 7e-45)) {
tmp = t * (y / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -5.8e+95) or not (y <= 7e-45): tmp = t * (y / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -5.8e+95) || !(y <= 7e-45)) 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 <= -5.8e+95) || ~((y <= 7e-45))) tmp = t * (y / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -5.8e+95], N[Not[LessEqual[y, 7e-45]], $MachinePrecision]], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.8 \cdot 10^{+95} \lor \neg \left(y \leq 7 \cdot 10^{-45}\right):\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -5.80000000000000027e95 or 7e-45 < y Initial program 89.2%
associate-/l*99.2%
Simplified99.2%
Taylor expanded in t around inf 45.3%
associate-/l*52.1%
Simplified52.1%
if -5.80000000000000027e95 < y < 7e-45Initial program 99.2%
associate-/l*94.2%
Simplified94.2%
Taylor expanded in x around inf 65.2%
Final simplification58.9%
(FPCore (x y z t a) :precision binary64 (if (<= y -3.6e+96) (/ t (/ a y)) (if (<= y 1e-43) x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -3.6e+96) {
tmp = t / (a / y);
} else if (y <= 1e-43) {
tmp = x;
} else {
tmp = 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 (y <= (-3.6d+96)) then
tmp = t / (a / y)
else if (y <= 1d-43) then
tmp = x
else
tmp = 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 (y <= -3.6e+96) {
tmp = t / (a / y);
} else if (y <= 1e-43) {
tmp = x;
} else {
tmp = t * (y / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -3.6e+96: tmp = t / (a / y) elif y <= 1e-43: tmp = x else: tmp = t * (y / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -3.6e+96) tmp = Float64(t / Float64(a / y)); elseif (y <= 1e-43) tmp = x; else tmp = Float64(t * Float64(y / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -3.6e+96) tmp = t / (a / y); elseif (y <= 1e-43) tmp = x; else tmp = t * (y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -3.6e+96], N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1e-43], x, N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.6 \cdot 10^{+96}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\mathbf{elif}\;y \leq 10^{-43}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if y < -3.60000000000000013e96Initial program 87.9%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around inf 46.9%
associate-/l*56.6%
Simplified56.6%
clear-num56.6%
un-div-inv56.6%
Applied egg-rr56.6%
if -3.60000000000000013e96 < y < 1.00000000000000008e-43Initial program 99.2%
associate-/l*94.2%
Simplified94.2%
Taylor expanded in x around inf 65.2%
if 1.00000000000000008e-43 < y Initial program 89.8%
associate-/l*98.9%
Simplified98.9%
Taylor expanded in t around inf 44.6%
associate-/l*50.1%
Simplified50.1%
(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 94.3%
associate-/l*96.6%
Simplified96.6%
Final simplification96.6%
(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 94.3%
associate-/l*96.6%
Simplified96.6%
Taylor expanded in x around inf 42.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 2024181
(FPCore (x y z t a)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, F"
:precision binary64
:alt
(! :herbie-platform default (if (< y -430450648655599/4000000000000000000000000) (- x (/ 1 (/ (/ a (- z t)) y))) (if (< y 2894426862792089/10000000000000000000000000000000000000000000000000000000000000000) (- x (/ (* y (- z t)) a)) (- x (/ y (/ a (- z t)))))))
(- x (/ (* y (- z t)) a)))