
(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 10 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 97.6%
associate-/l*94.7%
Simplified94.7%
Taylor expanded in y around 0 97.6%
associate-*l/98.6%
*-commutative98.6%
Simplified98.6%
Final simplification98.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* z (/ y (- a)))))
(if (<= t -4.2e+101)
(/ y (/ a t))
(if (<= t -4.2e-103)
x
(if (<= t -1.65e-270)
t_1
(if (<= t 6.8e-51) x (if (<= t 4.5e+56) t_1 (* t (/ y a)))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = z * (y / -a);
double tmp;
if (t <= -4.2e+101) {
tmp = y / (a / t);
} else if (t <= -4.2e-103) {
tmp = x;
} else if (t <= -1.65e-270) {
tmp = t_1;
} else if (t <= 6.8e-51) {
tmp = x;
} else if (t <= 4.5e+56) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = z * (y / -a)
if (t <= (-4.2d+101)) then
tmp = y / (a / t)
else if (t <= (-4.2d-103)) then
tmp = x
else if (t <= (-1.65d-270)) then
tmp = t_1
else if (t <= 6.8d-51) then
tmp = x
else if (t <= 4.5d+56) then
tmp = t_1
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 t_1 = z * (y / -a);
double tmp;
if (t <= -4.2e+101) {
tmp = y / (a / t);
} else if (t <= -4.2e-103) {
tmp = x;
} else if (t <= -1.65e-270) {
tmp = t_1;
} else if (t <= 6.8e-51) {
tmp = x;
} else if (t <= 4.5e+56) {
tmp = t_1;
} else {
tmp = t * (y / a);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = z * (y / -a) tmp = 0 if t <= -4.2e+101: tmp = y / (a / t) elif t <= -4.2e-103: tmp = x elif t <= -1.65e-270: tmp = t_1 elif t <= 6.8e-51: tmp = x elif t <= 4.5e+56: tmp = t_1 else: tmp = t * (y / a) return tmp
function code(x, y, z, t, a) t_1 = Float64(z * Float64(y / Float64(-a))) tmp = 0.0 if (t <= -4.2e+101) tmp = Float64(y / Float64(a / t)); elseif (t <= -4.2e-103) tmp = x; elseif (t <= -1.65e-270) tmp = t_1; elseif (t <= 6.8e-51) tmp = x; elseif (t <= 4.5e+56) tmp = t_1; else tmp = Float64(t * Float64(y / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = z * (y / -a); tmp = 0.0; if (t <= -4.2e+101) tmp = y / (a / t); elseif (t <= -4.2e-103) tmp = x; elseif (t <= -1.65e-270) tmp = t_1; elseif (t <= 6.8e-51) tmp = x; elseif (t <= 4.5e+56) tmp = t_1; else tmp = t * (y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * N[(y / (-a)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.2e+101], N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -4.2e-103], x, If[LessEqual[t, -1.65e-270], t$95$1, If[LessEqual[t, 6.8e-51], x, If[LessEqual[t, 4.5e+56], t$95$1, N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \frac{y}{-a}\\
\mathbf{if}\;t \leq -4.2 \cdot 10^{+101}:\\
\;\;\;\;\frac{y}{\frac{a}{t}}\\
\mathbf{elif}\;t \leq -4.2 \cdot 10^{-103}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq -1.65 \cdot 10^{-270}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 6.8 \cdot 10^{-51}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{+56}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -4.2e101Initial program 94.9%
associate-/l*92.7%
Simplified92.7%
Taylor expanded in x around 0 81.8%
mul-1-neg81.8%
distribute-frac-neg281.8%
sub-neg81.8%
+-commutative81.8%
neg-sub081.8%
associate--r-81.8%
neg-sub081.8%
associate-*r/81.8%
distribute-neg-frac81.8%
distribute-neg-frac281.8%
remove-double-neg81.8%
Simplified81.8%
clear-num81.8%
un-div-inv81.8%
Applied egg-rr81.8%
Taylor expanded in t around inf 68.8%
if -4.2e101 < t < -4.20000000000000009e-103 or -1.65000000000000009e-270 < t < 6.80000000000000005e-51Initial program 99.0%
associate-/l*96.5%
Simplified96.5%
Taylor expanded in x around inf 61.6%
if -4.20000000000000009e-103 < t < -1.65000000000000009e-270 or 6.80000000000000005e-51 < t < 4.5000000000000003e56Initial program 97.5%
associate-/l*98.1%
Simplified98.1%
Taylor expanded in y around 0 97.5%
associate-*l/98.1%
*-commutative98.1%
Simplified98.1%
Taylor expanded in z around inf 56.6%
associate-*l/60.9%
associate-*r*60.9%
neg-mul-160.9%
*-commutative60.9%
distribute-neg-frac260.9%
Simplified60.9%
if 4.5000000000000003e56 < t Initial program 96.3%
associate-/l*88.7%
Simplified88.7%
Taylor expanded in y around 0 96.3%
associate-*l/98.1%
*-commutative98.1%
Simplified98.1%
Taylor expanded in t around inf 64.0%
associate-*r/64.8%
Simplified64.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (/ z (- a)))))
(if (<= t -8.8e+99)
(/ y (/ a t))
(if (<= t -1.65e-146)
x
(if (<= t -9e-269)
t_1
(if (<= t 1.6e-50) x (if (<= t 2.3e+29) t_1 (* t (/ y a)))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z / -a);
double tmp;
if (t <= -8.8e+99) {
tmp = y / (a / t);
} else if (t <= -1.65e-146) {
tmp = x;
} else if (t <= -9e-269) {
tmp = t_1;
} else if (t <= 1.6e-50) {
tmp = x;
} else if (t <= 2.3e+29) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = y * (z / -a)
if (t <= (-8.8d+99)) then
tmp = y / (a / t)
else if (t <= (-1.65d-146)) then
tmp = x
else if (t <= (-9d-269)) then
tmp = t_1
else if (t <= 1.6d-50) then
tmp = x
else if (t <= 2.3d+29) then
tmp = t_1
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 t_1 = y * (z / -a);
double tmp;
if (t <= -8.8e+99) {
tmp = y / (a / t);
} else if (t <= -1.65e-146) {
tmp = x;
} else if (t <= -9e-269) {
tmp = t_1;
} else if (t <= 1.6e-50) {
tmp = x;
} else if (t <= 2.3e+29) {
tmp = t_1;
} else {
tmp = t * (y / a);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * (z / -a) tmp = 0 if t <= -8.8e+99: tmp = y / (a / t) elif t <= -1.65e-146: tmp = x elif t <= -9e-269: tmp = t_1 elif t <= 1.6e-50: tmp = x elif t <= 2.3e+29: tmp = t_1 else: tmp = t * (y / a) return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(z / Float64(-a))) tmp = 0.0 if (t <= -8.8e+99) tmp = Float64(y / Float64(a / t)); elseif (t <= -1.65e-146) tmp = x; elseif (t <= -9e-269) tmp = t_1; elseif (t <= 1.6e-50) tmp = x; elseif (t <= 2.3e+29) tmp = t_1; else tmp = Float64(t * Float64(y / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * (z / -a); tmp = 0.0; if (t <= -8.8e+99) tmp = y / (a / t); elseif (t <= -1.65e-146) tmp = x; elseif (t <= -9e-269) tmp = t_1; elseif (t <= 1.6e-50) tmp = x; elseif (t <= 2.3e+29) tmp = t_1; else tmp = t * (y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(z / (-a)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -8.8e+99], N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.65e-146], x, If[LessEqual[t, -9e-269], t$95$1, If[LessEqual[t, 1.6e-50], x, If[LessEqual[t, 2.3e+29], t$95$1, N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z}{-a}\\
\mathbf{if}\;t \leq -8.8 \cdot 10^{+99}:\\
\;\;\;\;\frac{y}{\frac{a}{t}}\\
\mathbf{elif}\;t \leq -1.65 \cdot 10^{-146}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq -9 \cdot 10^{-269}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.6 \cdot 10^{-50}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 2.3 \cdot 10^{+29}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -8.79999999999999913e99Initial program 94.9%
associate-/l*92.7%
Simplified92.7%
Taylor expanded in x around 0 81.8%
mul-1-neg81.8%
distribute-frac-neg281.8%
sub-neg81.8%
+-commutative81.8%
neg-sub081.8%
associate--r-81.8%
neg-sub081.8%
associate-*r/81.8%
distribute-neg-frac81.8%
distribute-neg-frac281.8%
remove-double-neg81.8%
Simplified81.8%
clear-num81.8%
un-div-inv81.8%
Applied egg-rr81.8%
Taylor expanded in t around inf 68.8%
if -8.79999999999999913e99 < t < -1.65e-146 or -9.0000000000000003e-269 < t < 1.6e-50Initial program 99.0%
associate-/l*95.8%
Simplified95.8%
Taylor expanded in x around inf 60.2%
if -1.65e-146 < t < -9.0000000000000003e-269 or 1.6e-50 < t < 2.3000000000000001e29Initial program 96.8%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in z around inf 65.2%
mul-1-neg65.2%
associate-/l*68.3%
distribute-rgt-neg-in68.3%
distribute-neg-frac268.3%
Simplified68.3%
if 2.3000000000000001e29 < t Initial program 96.8%
associate-/l*90.4%
Simplified90.4%
Taylor expanded in y around 0 96.8%
associate-*l/98.3%
*-commutative98.3%
Simplified98.3%
Taylor expanded in t around inf 59.8%
associate-*r/60.4%
Simplified60.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.4e+96) (not (<= z 4.4e+48))) (- x (/ (* z y) a)) (+ x (/ (* t y) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.4e+96) || !(z <= 4.4e+48)) {
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 <= (-4.4d+96)) .or. (.not. (z <= 4.4d+48))) 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 <= -4.4e+96) || !(z <= 4.4e+48)) {
tmp = x - ((z * y) / a);
} else {
tmp = x + ((t * y) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.4e+96) or not (z <= 4.4e+48): 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 <= -4.4e+96) || !(z <= 4.4e+48)) tmp = Float64(x - Float64(Float64(z * y) / a)); else tmp = Float64(x + Float64(Float64(t * y) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -4.4e+96) || ~((z <= 4.4e+48))) 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, -4.4e+96], N[Not[LessEqual[z, 4.4e+48]], $MachinePrecision]], N[(x - N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{+96} \lor \neg \left(z \leq 4.4 \cdot 10^{+48}\right):\\
\;\;\;\;x - \frac{z \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\end{array}
\end{array}
if z < -4.3999999999999998e96 or 4.3999999999999999e48 < z Initial program 96.3%
associate-/l*88.8%
Simplified88.8%
Taylor expanded in z around inf 89.6%
if -4.3999999999999998e96 < z < 4.3999999999999999e48Initial program 98.1%
sub-neg98.1%
distribute-frac-neg298.1%
+-commutative98.1%
associate-/l*97.3%
fma-define97.3%
distribute-frac-neg297.3%
distribute-neg-frac97.3%
sub-neg97.3%
distribute-neg-in97.3%
remove-double-neg97.3%
+-commutative97.3%
sub-neg97.3%
Simplified97.3%
Taylor expanded in z around 0 88.6%
Final simplification88.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -4.8e-38) (not (<= y 9.5e-90))) (* y (/ (- t z) a)) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -4.8e-38) || !(y <= 9.5e-90)) {
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 <= (-4.8d-38)) .or. (.not. (y <= 9.5d-90))) 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 <= -4.8e-38) || !(y <= 9.5e-90)) {
tmp = y * ((t - z) / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -4.8e-38) or not (y <= 9.5e-90): tmp = y * ((t - z) / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -4.8e-38) || !(y <= 9.5e-90)) 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 <= -4.8e-38) || ~((y <= 9.5e-90))) tmp = y * ((t - z) / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -4.8e-38], N[Not[LessEqual[y, 9.5e-90]], $MachinePrecision]], N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.8 \cdot 10^{-38} \lor \neg \left(y \leq 9.5 \cdot 10^{-90}\right):\\
\;\;\;\;y \cdot \frac{t - z}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -4.80000000000000044e-38 or 9.5000000000000003e-90 < y Initial program 96.1%
associate-/l*99.3%
Simplified99.3%
Taylor expanded in x around 0 77.4%
mul-1-neg77.4%
distribute-frac-neg277.4%
sub-neg77.4%
+-commutative77.4%
neg-sub077.4%
associate--r-77.4%
neg-sub077.4%
associate-*r/80.5%
distribute-neg-frac80.5%
distribute-neg-frac280.5%
remove-double-neg80.5%
Simplified80.5%
if -4.80000000000000044e-38 < y < 9.5000000000000003e-90Initial program 99.9%
associate-/l*87.6%
Simplified87.6%
Taylor expanded in x around inf 71.8%
Final simplification77.1%
(FPCore (x y z t a) :precision binary64 (if (<= z -5.8e+177) (* z (/ y (- a))) (if (<= z 2.55e+48) (+ x (/ (* t y) a)) (* y (/ (- t z) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.8e+177) {
tmp = z * (y / -a);
} else if (z <= 2.55e+48) {
tmp = x + ((t * 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 (z <= (-5.8d+177)) then
tmp = z * (y / -a)
else if (z <= 2.55d+48) then
tmp = x + ((t * 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 (z <= -5.8e+177) {
tmp = z * (y / -a);
} else if (z <= 2.55e+48) {
tmp = x + ((t * y) / a);
} else {
tmp = y * ((t - z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.8e+177: tmp = z * (y / -a) elif z <= 2.55e+48: tmp = x + ((t * y) / a) else: tmp = y * ((t - z) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.8e+177) tmp = Float64(z * Float64(y / Float64(-a))); elseif (z <= 2.55e+48) tmp = Float64(x + Float64(Float64(t * y) / a)); else tmp = Float64(y * Float64(Float64(t - z) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5.8e+177) tmp = z * (y / -a); elseif (z <= 2.55e+48) tmp = x + ((t * y) / a); else tmp = y * ((t - z) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.8e+177], N[(z * N[(y / (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.55e+48], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{+177}:\\
\;\;\;\;z \cdot \frac{y}{-a}\\
\mathbf{elif}\;z \leq 2.55 \cdot 10^{+48}:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{t - z}{a}\\
\end{array}
\end{array}
if z < -5.80000000000000027e177Initial program 95.8%
associate-/l*78.8%
Simplified78.8%
Taylor expanded in y around 0 95.8%
associate-*l/99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around inf 78.9%
associate-*l/79.0%
associate-*r*79.0%
neg-mul-179.0%
*-commutative79.0%
distribute-neg-frac279.0%
Simplified79.0%
if -5.80000000000000027e177 < z < 2.5499999999999999e48Initial program 98.2%
sub-neg98.2%
distribute-frac-neg298.2%
+-commutative98.2%
associate-/l*96.0%
fma-define96.0%
distribute-frac-neg296.0%
distribute-neg-frac96.0%
sub-neg96.0%
distribute-neg-in96.0%
remove-double-neg96.0%
+-commutative96.0%
sub-neg96.0%
Simplified96.0%
Taylor expanded in z around 0 86.4%
if 2.5499999999999999e48 < z Initial program 95.4%
associate-/l*97.6%
Simplified97.6%
Taylor expanded in x around 0 69.5%
mul-1-neg69.5%
distribute-frac-neg269.5%
sub-neg69.5%
+-commutative69.5%
neg-sub069.5%
associate--r-69.5%
neg-sub069.5%
associate-*r/71.7%
distribute-neg-frac71.7%
distribute-neg-frac271.7%
remove-double-neg71.7%
Simplified71.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -1.45e-31) (not (<= y 5.5e-77))) (* t (/ y a)) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.45e-31) || !(y <= 5.5e-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.45d-31)) .or. (.not. (y <= 5.5d-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.45e-31) || !(y <= 5.5e-77)) {
tmp = t * (y / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -1.45e-31) or not (y <= 5.5e-77): tmp = t * (y / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -1.45e-31) || !(y <= 5.5e-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.45e-31) || ~((y <= 5.5e-77))) tmp = t * (y / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -1.45e-31], N[Not[LessEqual[y, 5.5e-77]], $MachinePrecision]], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.45 \cdot 10^{-31} \lor \neg \left(y \leq 5.5 \cdot 10^{-77}\right):\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.45e-31 or 5.49999999999999998e-77 < y Initial program 96.1%
associate-/l*99.3%
Simplified99.3%
Taylor expanded in y around 0 96.1%
associate-*l/98.6%
*-commutative98.6%
Simplified98.6%
Taylor expanded in t around inf 51.3%
associate-*r/52.8%
Simplified52.8%
if -1.45e-31 < y < 5.49999999999999998e-77Initial program 99.6%
associate-/l*88.3%
Simplified88.3%
Taylor expanded in x around inf 68.9%
Final simplification59.4%
(FPCore (x y z t a) :precision binary64 (if (<= y -5e-34) (* y (/ t a)) (if (<= y 6e-76) x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -5e-34) {
tmp = y * (t / a);
} else if (y <= 6e-76) {
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 <= (-5d-34)) then
tmp = y * (t / a)
else if (y <= 6d-76) 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 <= -5e-34) {
tmp = y * (t / a);
} else if (y <= 6e-76) {
tmp = x;
} else {
tmp = t * (y / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -5e-34: tmp = y * (t / a) elif y <= 6e-76: tmp = x else: tmp = t * (y / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -5e-34) tmp = Float64(y * Float64(t / a)); elseif (y <= 6e-76) 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 <= -5e-34) tmp = y * (t / a); elseif (y <= 6e-76) tmp = x; else tmp = t * (y / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -5e-34], N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6e-76], x, N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5 \cdot 10^{-34}:\\
\;\;\;\;y \cdot \frac{t}{a}\\
\mathbf{elif}\;y \leq 6 \cdot 10^{-76}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if y < -5.0000000000000003e-34Initial program 95.3%
associate-/l*98.7%
Simplified98.7%
Taylor expanded in t around inf 54.5%
*-commutative54.5%
associate-/l*55.0%
Simplified55.0%
if -5.0000000000000003e-34 < y < 6.00000000000000048e-76Initial program 99.6%
associate-/l*88.3%
Simplified88.3%
Taylor expanded in x around inf 68.9%
if 6.00000000000000048e-76 < y Initial program 97.1%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in y around 0 97.1%
associate-*l/98.4%
*-commutative98.4%
Simplified98.4%
Taylor expanded in t around inf 47.4%
associate-*r/50.2%
Simplified50.2%
(FPCore (x y z t a) :precision binary64 (if (<= z -6.5e+113) (- x (/ (* z y) a)) (+ x (* y (/ (- t z) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.5e+113) {
tmp = x - ((z * y) / a);
} else {
tmp = x + (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 (z <= (-6.5d+113)) then
tmp = x - ((z * y) / a)
else
tmp = x + (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 (z <= -6.5e+113) {
tmp = x - ((z * y) / a);
} else {
tmp = x + (y * ((t - z) / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6.5e+113: tmp = x - ((z * y) / a) else: tmp = x + (y * ((t - z) / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.5e+113) tmp = Float64(x - Float64(Float64(z * y) / a)); else tmp = Float64(x + Float64(y * Float64(Float64(t - z) / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -6.5e+113) tmp = x - ((z * y) / a); else tmp = x + (y * ((t - z) / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.5e+113], N[(x - N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.5 \cdot 10^{+113}:\\
\;\;\;\;x - \frac{z \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t - z}{a}\\
\end{array}
\end{array}
if z < -6.5000000000000001e113Initial program 97.4%
associate-/l*79.0%
Simplified79.0%
Taylor expanded in z around inf 92.1%
if -6.5000000000000001e113 < z Initial program 97.6%
associate-/l*97.4%
Simplified97.4%
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 97.6%
associate-/l*94.7%
Simplified94.7%
Taylor expanded in x around inf 40.7%
(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 2024103
(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)))