
(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 14 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(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 94.5%
associate-/l*94.0%
Simplified94.0%
Taylor expanded in y around 0 94.5%
associate-*l/97.4%
*-commutative97.4%
Simplified97.4%
Final simplification97.4%
(FPCore (x y z t a)
:precision binary64
(if (<= t -1.8e+124)
(* y (/ t a))
(if (<= t -2.4e-308)
x
(if (<= t 1.2e+41) (* z (/ (- y) a)) (* t (/ y a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.8e+124) {
tmp = y * (t / a);
} else if (t <= -2.4e-308) {
tmp = x;
} else if (t <= 1.2e+41) {
tmp = z * (-y / a);
} 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 (t <= (-1.8d+124)) then
tmp = y * (t / a)
else if (t <= (-2.4d-308)) then
tmp = x
else if (t <= 1.2d+41) then
tmp = z * (-y / a)
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 (t <= -1.8e+124) {
tmp = y * (t / a);
} else if (t <= -2.4e-308) {
tmp = x;
} else if (t <= 1.2e+41) {
tmp = z * (-y / a);
} else {
tmp = t * (y / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.8e+124: tmp = y * (t / a) elif t <= -2.4e-308: tmp = x elif t <= 1.2e+41: tmp = z * (-y / a) else: tmp = t * (y / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.8e+124) tmp = Float64(y * Float64(t / a)); elseif (t <= -2.4e-308) tmp = x; elseif (t <= 1.2e+41) tmp = Float64(z * Float64(Float64(-y) / a)); else tmp = Float64(t * Float64(y / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.8e+124) tmp = y * (t / a); elseif (t <= -2.4e-308) tmp = x; elseif (t <= 1.2e+41) tmp = z * (-y / a); else tmp = t * (y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.8e+124], N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -2.4e-308], x, If[LessEqual[t, 1.2e+41], N[(z * N[((-y) / a), $MachinePrecision]), $MachinePrecision], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.8 \cdot 10^{+124}:\\
\;\;\;\;y \cdot \frac{t}{a}\\
\mathbf{elif}\;t \leq -2.4 \cdot 10^{-308}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 1.2 \cdot 10^{+41}:\\
\;\;\;\;z \cdot \frac{-y}{a}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -1.79999999999999993e124Initial program 89.9%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in t around inf 48.4%
*-commutative48.4%
associate-/l*58.2%
Simplified58.2%
if -1.79999999999999993e124 < t < -2.40000000000000008e-308Initial program 96.4%
associate-/l*92.7%
Simplified92.7%
Taylor expanded in x around inf 62.0%
if -2.40000000000000008e-308 < t < 1.2000000000000001e41Initial program 93.4%
associate-/l*97.2%
Simplified97.2%
Taylor expanded in z around inf 55.6%
mul-1-neg55.6%
associate-/l*58.3%
distribute-rgt-neg-in58.3%
distribute-frac-neg258.3%
Simplified58.3%
Taylor expanded in y around 0 55.6%
mul-1-neg55.6%
associate-*l/59.6%
associate-/r/58.3%
distribute-neg-frac58.3%
Simplified58.3%
Taylor expanded in y around 0 55.6%
mul-1-neg55.6%
associate-*l/59.6%
distribute-rgt-neg-out59.6%
Simplified59.6%
if 1.2000000000000001e41 < t Initial program 94.5%
associate-/l*88.8%
Simplified88.8%
Taylor expanded in y around inf 63.3%
Taylor expanded in t around inf 65.7%
associate-/l*67.3%
Simplified67.3%
Final simplification62.0%
(FPCore (x y z t a)
:precision binary64
(if (<= t -2.7e+129)
(* y (/ t a))
(if (<= t -2.3e-307)
x
(if (<= t 1.9e+38) (* (/ z a) (- y)) (* t (/ y a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.7e+129) {
tmp = y * (t / a);
} else if (t <= -2.3e-307) {
tmp = x;
} else if (t <= 1.9e+38) {
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 (t <= (-2.7d+129)) then
tmp = y * (t / a)
else if (t <= (-2.3d-307)) then
tmp = x
else if (t <= 1.9d+38) 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 (t <= -2.7e+129) {
tmp = y * (t / a);
} else if (t <= -2.3e-307) {
tmp = x;
} else if (t <= 1.9e+38) {
tmp = (z / a) * -y;
} else {
tmp = t * (y / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.7e+129: tmp = y * (t / a) elif t <= -2.3e-307: tmp = x elif t <= 1.9e+38: tmp = (z / a) * -y else: tmp = t * (y / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.7e+129) tmp = Float64(y * Float64(t / a)); elseif (t <= -2.3e-307) tmp = x; elseif (t <= 1.9e+38) 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 (t <= -2.7e+129) tmp = y * (t / a); elseif (t <= -2.3e-307) tmp = x; elseif (t <= 1.9e+38) tmp = (z / a) * -y; else tmp = t * (y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.7e+129], N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -2.3e-307], x, If[LessEqual[t, 1.9e+38], N[(N[(z / a), $MachinePrecision] * (-y)), $MachinePrecision], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.7 \cdot 10^{+129}:\\
\;\;\;\;y \cdot \frac{t}{a}\\
\mathbf{elif}\;t \leq -2.3 \cdot 10^{-307}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 1.9 \cdot 10^{+38}:\\
\;\;\;\;\frac{z}{a} \cdot \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -2.7000000000000001e129Initial program 89.9%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in t around inf 48.4%
*-commutative48.4%
associate-/l*58.2%
Simplified58.2%
if -2.7000000000000001e129 < t < -2.2999999999999999e-307Initial program 96.4%
associate-/l*92.7%
Simplified92.7%
Taylor expanded in x around inf 62.0%
if -2.2999999999999999e-307 < t < 1.8999999999999999e38Initial program 93.4%
associate-/l*97.2%
Simplified97.2%
Taylor expanded in z around inf 55.6%
mul-1-neg55.6%
associate-/l*58.3%
distribute-rgt-neg-in58.3%
distribute-frac-neg258.3%
Simplified58.3%
if 1.8999999999999999e38 < t Initial program 94.5%
associate-/l*88.8%
Simplified88.8%
Taylor expanded in y around inf 63.3%
Taylor expanded in t around inf 65.7%
associate-/l*67.3%
Simplified67.3%
Final simplification61.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.9e-8) (not (<= z 2.2e-70))) (- x (* z (/ y a))) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.9e-8) || !(z <= 2.2e-70)) {
tmp = x - (z * (y / 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 <= (-5.9d-8)) .or. (.not. (z <= 2.2d-70))) then
tmp = x - (z * (y / 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 <= -5.9e-8) || !(z <= 2.2e-70)) {
tmp = x - (z * (y / a));
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.9e-8) or not (z <= 2.2e-70): tmp = x - (z * (y / a)) else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.9e-8) || !(z <= 2.2e-70)) tmp = Float64(x - Float64(z * Float64(y / 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 <= -5.9e-8) || ~((z <= 2.2e-70))) tmp = x - (z * (y / a)); else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.9e-8], N[Not[LessEqual[z, 2.2e-70]], $MachinePrecision]], N[(x - N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.9 \cdot 10^{-8} \lor \neg \left(z \leq 2.2 \cdot 10^{-70}\right):\\
\;\;\;\;x - z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -5.8999999999999999e-8 or 2.1999999999999999e-70 < z Initial program 92.9%
associate-/l*92.2%
Simplified92.2%
Taylor expanded in z around inf 83.3%
*-commutative83.3%
associate-/l*86.6%
Applied egg-rr86.6%
if -5.8999999999999999e-8 < z < 2.1999999999999999e-70Initial program 96.6%
associate-/l*96.3%
Simplified96.3%
Taylor expanded in y around 0 96.6%
associate-*l/98.3%
*-commutative98.3%
Simplified98.3%
Taylor expanded in z around 0 91.2%
mul-1-neg91.2%
associate-/l*94.2%
distribute-lft-neg-out94.2%
*-commutative94.2%
Simplified94.2%
Final simplification89.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.6e-8) (not (<= z 9.8e-71))) (- x (* z (/ y a))) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.6e-8) || !(z <= 9.8e-71)) {
tmp = x - (z * (y / a));
} else {
tmp = x + (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 ((z <= (-4.6d-8)) .or. (.not. (z <= 9.8d-71))) then
tmp = x - (z * (y / a))
else
tmp = x + (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 ((z <= -4.6e-8) || !(z <= 9.8e-71)) {
tmp = x - (z * (y / a));
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.6e-8) or not (z <= 9.8e-71): tmp = x - (z * (y / a)) else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.6e-8) || !(z <= 9.8e-71)) tmp = Float64(x - Float64(z * Float64(y / a))); else tmp = Float64(x + Float64(y * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4.6e-8) || ~((z <= 9.8e-71))) tmp = x - (z * (y / a)); else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.6e-8], N[Not[LessEqual[z, 9.8e-71]], $MachinePrecision]], N[(x - N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.6 \cdot 10^{-8} \lor \neg \left(z \leq 9.8 \cdot 10^{-71}\right):\\
\;\;\;\;x - z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -4.6000000000000002e-8 or 9.7999999999999994e-71 < z Initial program 92.9%
associate-/l*92.2%
Simplified92.2%
Taylor expanded in z around inf 83.3%
*-commutative83.3%
associate-/l*86.6%
Applied egg-rr86.6%
if -4.6000000000000002e-8 < z < 9.7999999999999994e-71Initial program 96.6%
associate-/l*96.3%
Simplified96.3%
Taylor expanded in z around 0 90.9%
neg-mul-190.9%
Simplified90.9%
Final simplification88.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -8.6e+79) (not (<= y 1.06e+99))) (* y (/ (- t z) a)) (- x (/ (* z y) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -8.6e+79) || !(y <= 1.06e+99)) {
tmp = y * ((t - z) / 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 ((y <= (-8.6d+79)) .or. (.not. (y <= 1.06d+99))) then
tmp = y * ((t - z) / 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 ((y <= -8.6e+79) || !(y <= 1.06e+99)) {
tmp = y * ((t - z) / a);
} else {
tmp = x - ((z * y) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -8.6e+79) or not (y <= 1.06e+99): tmp = y * ((t - z) / a) else: tmp = x - ((z * y) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -8.6e+79) || !(y <= 1.06e+99)) tmp = Float64(y * Float64(Float64(t - z) / 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 ((y <= -8.6e+79) || ~((y <= 1.06e+99))) tmp = y * ((t - z) / a); else tmp = x - ((z * y) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -8.6e+79], N[Not[LessEqual[y, 1.06e+99]], $MachinePrecision]], N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.6 \cdot 10^{+79} \lor \neg \left(y \leq 1.06 \cdot 10^{+99}\right):\\
\;\;\;\;y \cdot \frac{t - z}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{z \cdot y}{a}\\
\end{array}
\end{array}
if y < -8.6000000000000006e79 or 1.05999999999999999e99 < y Initial program 87.6%
associate-/l*98.8%
Simplified98.8%
Taylor expanded in x around 0 75.8%
mul-1-neg75.8%
associate-*r/85.7%
distribute-rgt-neg-in85.7%
distribute-frac-neg85.7%
neg-sub085.7%
sub-neg85.7%
+-commutative85.7%
associate--r+85.7%
neg-sub085.7%
remove-double-neg85.7%
Simplified85.7%
if -8.6000000000000006e79 < y < 1.05999999999999999e99Initial program 98.7%
associate-/l*90.9%
Simplified90.9%
Taylor expanded in z around inf 83.1%
Final simplification84.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -4.8e+76) (not (<= y 7.2e+98))) (* y (/ (- t z) a)) (- x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -4.8e+76) || !(y <= 7.2e+98)) {
tmp = y * ((t - z) / 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 ((y <= (-4.8d+76)) .or. (.not. (y <= 7.2d+98))) then
tmp = y * ((t - z) / 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 ((y <= -4.8e+76) || !(y <= 7.2e+98)) {
tmp = y * ((t - z) / a);
} else {
tmp = x - (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -4.8e+76) or not (y <= 7.2e+98): tmp = y * ((t - z) / a) else: tmp = x - (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -4.8e+76) || !(y <= 7.2e+98)) tmp = Float64(y * Float64(Float64(t - z) / a)); else tmp = Float64(x - Float64(z * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -4.8e+76) || ~((y <= 7.2e+98))) tmp = y * ((t - z) / a); else tmp = x - (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -4.8e+76], N[Not[LessEqual[y, 7.2e+98]], $MachinePrecision]], N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x - N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.8 \cdot 10^{+76} \lor \neg \left(y \leq 7.2 \cdot 10^{+98}\right):\\
\;\;\;\;y \cdot \frac{t - z}{a}\\
\mathbf{else}:\\
\;\;\;\;x - z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if y < -4.8e76 or 7.19999999999999962e98 < y Initial program 87.6%
associate-/l*98.8%
Simplified98.8%
Taylor expanded in x around 0 75.8%
mul-1-neg75.8%
associate-*r/85.7%
distribute-rgt-neg-in85.7%
distribute-frac-neg85.7%
neg-sub085.7%
sub-neg85.7%
+-commutative85.7%
associate--r+85.7%
neg-sub085.7%
remove-double-neg85.7%
Simplified85.7%
if -4.8e76 < y < 7.19999999999999962e98Initial program 98.7%
associate-/l*90.9%
Simplified90.9%
Taylor expanded in z around inf 83.1%
*-commutative83.1%
associate-/l*82.1%
Applied egg-rr82.1%
Final simplification83.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -2.15e+79) (not (<= y 6.5e+96))) (* y (/ (- t z) a)) (- x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -2.15e+79) || !(y <= 6.5e+96)) {
tmp = y * ((t - z) / 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 ((y <= (-2.15d+79)) .or. (.not. (y <= 6.5d+96))) then
tmp = y * ((t - z) / 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 ((y <= -2.15e+79) || !(y <= 6.5e+96)) {
tmp = y * ((t - z) / a);
} else {
tmp = x - (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -2.15e+79) or not (y <= 6.5e+96): tmp = y * ((t - z) / a) else: tmp = x - (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -2.15e+79) || !(y <= 6.5e+96)) tmp = Float64(y * Float64(Float64(t - z) / 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 ((y <= -2.15e+79) || ~((y <= 6.5e+96))) tmp = y * ((t - z) / a); else tmp = x - (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -2.15e+79], N[Not[LessEqual[y, 6.5e+96]], $MachinePrecision]], N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.15 \cdot 10^{+79} \lor \neg \left(y \leq 6.5 \cdot 10^{+96}\right):\\
\;\;\;\;y \cdot \frac{t - z}{a}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if y < -2.1500000000000002e79 or 6.5e96 < y Initial program 87.6%
associate-/l*98.8%
Simplified98.8%
Taylor expanded in x around 0 75.8%
mul-1-neg75.8%
associate-*r/85.7%
distribute-rgt-neg-in85.7%
distribute-frac-neg85.7%
neg-sub085.7%
sub-neg85.7%
+-commutative85.7%
associate--r+85.7%
neg-sub085.7%
remove-double-neg85.7%
Simplified85.7%
if -2.1500000000000002e79 < y < 6.5e96Initial program 98.7%
associate-/l*90.9%
Simplified90.9%
Taylor expanded in z around inf 83.1%
associate-/l*77.8%
Simplified77.8%
Final simplification80.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -1.5e-43) (not (<= y 2.65e-124))) (* y (/ (- t z) a)) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.5e-43) || !(y <= 2.65e-124)) {
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 <= (-1.5d-43)) .or. (.not. (y <= 2.65d-124))) 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 <= -1.5e-43) || !(y <= 2.65e-124)) {
tmp = y * ((t - z) / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -1.5e-43) or not (y <= 2.65e-124): tmp = y * ((t - z) / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -1.5e-43) || !(y <= 2.65e-124)) 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 <= -1.5e-43) || ~((y <= 2.65e-124))) tmp = y * ((t - z) / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -1.5e-43], N[Not[LessEqual[y, 2.65e-124]], $MachinePrecision]], N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.5 \cdot 10^{-43} \lor \neg \left(y \leq 2.65 \cdot 10^{-124}\right):\\
\;\;\;\;y \cdot \frac{t - z}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.50000000000000002e-43 or 2.6499999999999999e-124 < y Initial program 91.7%
associate-/l*98.0%
Simplified98.0%
Taylor expanded in x around 0 71.7%
mul-1-neg71.7%
associate-*r/76.6%
distribute-rgt-neg-in76.6%
distribute-frac-neg76.6%
neg-sub076.6%
sub-neg76.6%
+-commutative76.6%
associate--r+76.6%
neg-sub076.6%
remove-double-neg76.6%
Simplified76.6%
if -1.50000000000000002e-43 < y < 2.6499999999999999e-124Initial program 99.0%
associate-/l*87.3%
Simplified87.3%
Taylor expanded in x around inf 69.6%
Final simplification74.0%
(FPCore (x y z t a) :precision binary64 (if (<= t -3.8e+127) (* y (/ (- t z) a)) (if (<= t 5.2e+45) (- x (* z (/ y a))) (/ (* y (- t z)) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.8e+127) {
tmp = y * ((t - z) / a);
} else if (t <= 5.2e+45) {
tmp = x - (z * (y / a));
} else {
tmp = (y * (t - 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 <= (-3.8d+127)) then
tmp = y * ((t - z) / a)
else if (t <= 5.2d+45) then
tmp = x - (z * (y / a))
else
tmp = (y * (t - 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 <= -3.8e+127) {
tmp = y * ((t - z) / a);
} else if (t <= 5.2e+45) {
tmp = x - (z * (y / a));
} else {
tmp = (y * (t - z)) / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -3.8e+127: tmp = y * ((t - z) / a) elif t <= 5.2e+45: tmp = x - (z * (y / a)) else: tmp = (y * (t - z)) / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3.8e+127) tmp = Float64(y * Float64(Float64(t - z) / a)); elseif (t <= 5.2e+45) tmp = Float64(x - Float64(z * Float64(y / a))); else tmp = Float64(Float64(y * Float64(t - z)) / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -3.8e+127) tmp = y * ((t - z) / a); elseif (t <= 5.2e+45) tmp = x - (z * (y / a)); else tmp = (y * (t - z)) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.8e+127], N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.2e+45], N[(x - N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.8 \cdot 10^{+127}:\\
\;\;\;\;y \cdot \frac{t - z}{a}\\
\mathbf{elif}\;t \leq 5.2 \cdot 10^{+45}:\\
\;\;\;\;x - z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \left(t - z\right)}{a}\\
\end{array}
\end{array}
if t < -3.7999999999999998e127Initial program 89.9%
associate-/l*99.7%
Simplified99.7%
Taylor expanded in x around 0 65.8%
mul-1-neg65.8%
associate-*r/75.6%
distribute-rgt-neg-in75.6%
distribute-frac-neg75.6%
neg-sub075.6%
sub-neg75.6%
+-commutative75.6%
associate--r+75.6%
neg-sub075.6%
remove-double-neg75.6%
Simplified75.6%
if -3.7999999999999998e127 < t < 5.20000000000000014e45Initial program 95.2%
associate-/l*94.5%
Simplified94.5%
Taylor expanded in z around inf 83.7%
*-commutative83.7%
associate-/l*87.9%
Applied egg-rr87.9%
if 5.20000000000000014e45 < t Initial program 94.5%
associate-/l*88.8%
Simplified88.8%
Taylor expanded in y around inf 63.3%
*-commutative63.3%
sub-div71.3%
associate-*l/77.2%
Applied egg-rr77.2%
Final simplification84.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -1.75e+49) (not (<= y 4.8e+77))) (* t (/ y a)) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.75e+49) || !(y <= 4.8e+77)) {
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 <= (-1.75d+49)) .or. (.not. (y <= 4.8d+77))) 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 <= -1.75e+49) || !(y <= 4.8e+77)) {
tmp = t * (y / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -1.75e+49) or not (y <= 4.8e+77): tmp = t * (y / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -1.75e+49) || !(y <= 4.8e+77)) 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 <= -1.75e+49) || ~((y <= 4.8e+77))) tmp = t * (y / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -1.75e+49], N[Not[LessEqual[y, 4.8e+77]], $MachinePrecision]], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.75 \cdot 10^{+49} \lor \neg \left(y \leq 4.8 \cdot 10^{+77}\right):\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.74999999999999987e49 or 4.7999999999999997e77 < y Initial program 89.0%
associate-/l*98.9%
Simplified98.9%
Taylor expanded in y around inf 81.8%
Taylor expanded in t around inf 42.3%
associate-/l*52.9%
Simplified52.9%
if -1.74999999999999987e49 < y < 4.7999999999999997e77Initial program 98.6%
associate-/l*90.2%
Simplified90.2%
Taylor expanded in x around inf 59.3%
Final simplification56.5%
(FPCore (x y z t a) :precision binary64 (if (<= y -2.3e+44) (/ t (/ a y)) (if (<= y 4.4e+77) x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -2.3e+44) {
tmp = t / (a / y);
} else if (y <= 4.4e+77) {
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 <= (-2.3d+44)) then
tmp = t / (a / y)
else if (y <= 4.4d+77) 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 <= -2.3e+44) {
tmp = t / (a / y);
} else if (y <= 4.4e+77) {
tmp = x;
} else {
tmp = t * (y / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -2.3e+44: tmp = t / (a / y) elif y <= 4.4e+77: tmp = x else: tmp = t * (y / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -2.3e+44) tmp = Float64(t / Float64(a / y)); elseif (y <= 4.4e+77) 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 <= -2.3e+44) tmp = t / (a / y); elseif (y <= 4.4e+77) tmp = x; else tmp = t * (y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -2.3e+44], N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.4e+77], x, N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.3 \cdot 10^{+44}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\mathbf{elif}\;y \leq 4.4 \cdot 10^{+77}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if y < -2.30000000000000004e44Initial program 92.2%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around inf 82.7%
Taylor expanded in t around inf 47.3%
associate-/l*54.3%
Simplified54.3%
clear-num54.3%
un-div-inv54.3%
Applied egg-rr54.3%
if -2.30000000000000004e44 < y < 4.4000000000000001e77Initial program 98.6%
associate-/l*90.2%
Simplified90.2%
Taylor expanded in x around inf 59.3%
if 4.4000000000000001e77 < y Initial program 84.9%
associate-/l*97.8%
Simplified97.8%
Taylor expanded in y around inf 80.7%
Taylor expanded in t around inf 36.0%
associate-/l*51.2%
Simplified51.2%
(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.5%
associate-/l*94.0%
Simplified94.0%
Final simplification94.0%
(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.5%
associate-/l*94.0%
Simplified94.0%
Taylor expanded in x around inf 40.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 2024111
(FPCore (x y z t a)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, F"
:precision binary64
:alt
(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)))