
(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 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (- x (/ (* y (- z t)) a)))
double code(double x, double y, double z, double t, double a) {
return x - ((y * (z - t)) / a);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x - ((y * (z - t)) / a)
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y * (z - t)) / a);
}
def code(x, y, z, t, a): return x - ((y * (z - t)) / a)
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y * Float64(z - t)) / a)) end
function tmp = code(x, y, z, t, a) tmp = x - ((y * (z - t)) / a); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y \cdot \left(z - t\right)}{a}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (/ (- t z) (/ a y))))
double code(double x, double y, double z, double t, double a) {
return x + ((t - z) / (a / y));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((t - z) / (a / y))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((t - z) / (a / y));
}
def code(x, y, z, t, a): return x + ((t - z) / (a / y))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(t - z) / Float64(a / y))) end
function tmp = code(x, y, z, t, a) tmp = x + ((t - z) / (a / y)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(t - z), $MachinePrecision] / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{t - z}{\frac{a}{y}}
\end{array}
Initial program 95.0%
associate-/l*94.0%
Simplified94.0%
Taylor expanded in y around 0 95.0%
associate-*l/97.1%
*-commutative97.1%
Simplified97.1%
clear-num97.0%
un-div-inv97.5%
Applied egg-rr97.5%
Final simplification97.5%
(FPCore (x y z t a) :precision binary64 (if (<= x -8.2e+108) x (* y (/ (- t z) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -8.2e+108) {
tmp = x;
} 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 (x <= (-8.2d+108)) then
tmp = x
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 (x <= -8.2e+108) {
tmp = x;
} else {
tmp = y * ((t - z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -8.2e+108: tmp = x else: tmp = y * ((t - z) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -8.2e+108) tmp = x; 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 (x <= -8.2e+108) tmp = x; else tmp = y * ((t - z) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -8.2e+108], x, N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.2 \cdot 10^{+108}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{t - z}{a}\\
\end{array}
\end{array}
if x < -8.1999999999999998e108Initial program 97.2%
associate-/l*91.5%
Simplified91.5%
Taylor expanded in x around inf 70.0%
if -8.1999999999999998e108 < x Initial program 94.7%
associate-/l*94.4%
Simplified94.4%
Taylor expanded in x around 0 59.9%
mul-1-neg59.9%
distribute-frac-neg259.9%
sub-neg59.9%
+-commutative59.9%
neg-sub059.9%
associate--r-59.9%
neg-sub059.9%
associate-*r/60.8%
distribute-neg-frac60.8%
distribute-neg-frac260.8%
remove-double-neg60.8%
Simplified60.8%
Final simplification62.1%
(FPCore (x y z t a) :precision binary64 (if (<= a -6.4e+106) x (* (/ y a) (- t z))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -6.4e+106) {
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 (a <= (-6.4d+106)) 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 (a <= -6.4e+106) {
tmp = x;
} else {
tmp = (y / a) * (t - z);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -6.4e+106: tmp = x else: tmp = (y / a) * (t - z) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -6.4e+106) 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 (a <= -6.4e+106) tmp = x; else tmp = (y / a) * (t - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -6.4e+106], x, N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.4 \cdot 10^{+106}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\
\end{array}
\end{array}
if a < -6.3999999999999996e106Initial program 83.0%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around inf 64.8%
if -6.3999999999999996e106 < a Initial program 97.6%
associate-/l*92.7%
Simplified92.7%
Taylor expanded in y around 0 97.6%
associate-*l/98.1%
*-commutative98.1%
Simplified98.1%
Taylor expanded in x around 0 62.2%
mul-1-neg62.2%
*-commutative62.2%
associate-*r/62.7%
*-commutative62.7%
distribute-rgt-neg-in62.7%
neg-sub062.7%
associate--r-62.7%
neg-sub062.7%
+-commutative62.7%
sub-neg62.7%
Simplified62.7%
Final simplification63.0%
(FPCore (x y z t a) :precision binary64 (if (<= y -0.22) (* y (/ (- t z) a)) (+ x (/ (* t y) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -0.22) {
tmp = y * ((t - z) / a);
} else {
tmp = x + ((t * y) / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= (-0.22d0)) then
tmp = y * ((t - z) / a)
else
tmp = x + ((t * y) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -0.22) {
tmp = y * ((t - z) / a);
} else {
tmp = x + ((t * y) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -0.22: tmp = y * ((t - z) / a) else: tmp = x + ((t * y) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -0.22) tmp = Float64(y * Float64(Float64(t - z) / 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 (y <= -0.22) tmp = y * ((t - z) / a); else tmp = x + ((t * y) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -0.22], N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.22:\\
\;\;\;\;y \cdot \frac{t - z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\end{array}
\end{array}
if y < -0.220000000000000001Initial program 87.6%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around 0 68.1%
mul-1-neg68.1%
distribute-frac-neg268.1%
sub-neg68.1%
+-commutative68.1%
neg-sub068.1%
associate--r-68.1%
neg-sub068.1%
associate-*r/80.2%
distribute-neg-frac80.2%
distribute-neg-frac280.2%
remove-double-neg80.2%
Simplified80.2%
if -0.220000000000000001 < y Initial program 97.0%
sub-neg97.0%
distribute-frac-neg297.0%
+-commutative97.0%
associate-/l*92.4%
fma-define92.4%
distribute-frac-neg292.4%
distribute-neg-frac92.4%
sub-neg92.4%
distribute-neg-in92.4%
remove-double-neg92.4%
+-commutative92.4%
sub-neg92.4%
Simplified92.4%
Taylor expanded in z around 0 75.6%
Final simplification76.6%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.2e-80) (+ x (/ (* t y) a)) (- x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.2e-80) {
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 <= (-2.2d-80)) 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 <= -2.2e-80) {
tmp = x + ((t * y) / a);
} else {
tmp = x - (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.2e-80: 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 <= -2.2e-80) tmp = Float64(x + Float64(Float64(t * 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 <= -2.2e-80) tmp = x + ((t * y) / a); else tmp = x - (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.2e-80], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.2 \cdot 10^{-80}:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -2.2000000000000001e-80Initial program 96.7%
sub-neg96.7%
distribute-frac-neg296.7%
+-commutative96.7%
associate-/l*90.3%
fma-define90.3%
distribute-frac-neg290.3%
distribute-neg-frac90.3%
sub-neg90.3%
distribute-neg-in90.3%
remove-double-neg90.3%
+-commutative90.3%
sub-neg90.3%
Simplified90.3%
Taylor expanded in z around 0 77.9%
if -2.2000000000000001e-80 < t Initial program 94.5%
associate-/l*95.1%
Simplified95.1%
Taylor expanded in z around inf 77.0%
associate-/l*77.8%
Simplified77.8%
Final simplification77.8%
(FPCore (x y z t a) :precision binary64 (if (<= t -4.3e+101) (+ x (/ (* t y) a)) (- x (/ z (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.3e+101) {
tmp = x + ((t * y) / a);
} else {
tmp = x - (z / (a / y));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-4.3d+101)) then
tmp = x + ((t * y) / a)
else
tmp = x - (z / (a / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -4.3e+101) {
tmp = x + ((t * y) / a);
} else {
tmp = x - (z / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -4.3e+101: tmp = x + ((t * y) / a) else: tmp = x - (z / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -4.3e+101) tmp = Float64(x + Float64(Float64(t * y) / a)); else tmp = Float64(x - Float64(z / Float64(a / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -4.3e+101) tmp = x + ((t * y) / a); else tmp = x - (z / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -4.3e+101], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x - N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.3 \cdot 10^{+101}:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{z}{\frac{a}{y}}\\
\end{array}
\end{array}
if t < -4.3000000000000001e101Initial program 96.6%
sub-neg96.6%
distribute-frac-neg296.6%
+-commutative96.6%
associate-/l*87.4%
fma-define87.4%
distribute-frac-neg287.4%
distribute-neg-frac87.4%
sub-neg87.4%
distribute-neg-in87.4%
remove-double-neg87.4%
+-commutative87.4%
sub-neg87.4%
Simplified87.4%
Taylor expanded in z around 0 83.8%
if -4.3000000000000001e101 < t Initial program 94.8%
associate-/l*94.9%
Simplified94.9%
Taylor expanded in z around inf 76.3%
associate-/l*76.5%
Simplified76.5%
*-commutative76.5%
associate-/r/78.0%
Applied egg-rr78.0%
Final simplification78.7%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.5e+31) (+ x (/ (* t y) a)) (- x (/ (* z y) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.5e+31) {
tmp = x + ((t * y) / a);
} else {
tmp = x - ((z * y) / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-1.5d+31)) then
tmp = x + ((t * y) / a)
else
tmp = x - ((z * y) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.5e+31) {
tmp = x + ((t * y) / a);
} else {
tmp = x - ((z * y) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.5e+31: tmp = x + ((t * y) / a) else: tmp = x - ((z * y) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.5e+31) tmp = Float64(x + Float64(Float64(t * y) / a)); else tmp = Float64(x - Float64(Float64(z * y) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.5e+31) tmp = x + ((t * y) / a); else tmp = x - ((z * y) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.5e+31], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.5 \cdot 10^{+31}:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{z \cdot y}{a}\\
\end{array}
\end{array}
if t < -1.49999999999999995e31Initial program 95.4%
sub-neg95.4%
distribute-frac-neg295.4%
+-commutative95.4%
associate-/l*91.0%
fma-define91.1%
distribute-frac-neg291.1%
distribute-neg-frac91.1%
sub-neg91.1%
distribute-neg-in91.1%
remove-double-neg91.1%
+-commutative91.1%
sub-neg91.1%
Simplified91.1%
Taylor expanded in z around 0 79.8%
if -1.49999999999999995e31 < t Initial program 95.0%
associate-/l*94.6%
Simplified94.6%
Taylor expanded in z around inf 77.0%
Final simplification77.5%
(FPCore (x y z t a) :precision binary64 (if (<= t 1.2e+156) (- x (/ z (/ a y))) (/ (* y (- t z)) a)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 1.2e+156) {
tmp = x - (z / (a / y));
} 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 <= 1.2d+156) then
tmp = x - (z / (a / y))
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 <= 1.2e+156) {
tmp = x - (z / (a / y));
} else {
tmp = (y * (t - z)) / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 1.2e+156: tmp = x - (z / (a / y)) else: tmp = (y * (t - z)) / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 1.2e+156) tmp = Float64(x - Float64(z / Float64(a / y))); 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 <= 1.2e+156) tmp = x - (z / (a / y)); else tmp = (y * (t - z)) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 1.2e+156], N[(x - N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(t - z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.2 \cdot 10^{+156}:\\
\;\;\;\;x - \frac{z}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \left(t - z\right)}{a}\\
\end{array}
\end{array}
if t < 1.2000000000000001e156Initial program 95.6%
associate-/l*95.2%
Simplified95.2%
Taylor expanded in z around inf 78.0%
associate-/l*78.0%
Simplified78.0%
*-commutative78.0%
associate-/r/80.4%
Applied egg-rr80.4%
if 1.2000000000000001e156 < t Initial program 91.3%
sub-neg91.3%
distribute-frac-neg291.3%
+-commutative91.3%
associate-/l*86.2%
fma-define86.2%
distribute-frac-neg286.2%
distribute-neg-frac86.2%
sub-neg86.2%
distribute-neg-in86.2%
remove-double-neg86.2%
+-commutative86.2%
sub-neg86.2%
Simplified86.2%
Taylor expanded in y around -inf 80.2%
Final simplification80.4%
(FPCore (x y z t a) :precision binary64 (if (<= t 1.05e+90) (- x (/ z (/ a y))) (+ x (/ y (/ a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 1.05e+90) {
tmp = x - (z / (a / y));
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 1.05d+90) then
tmp = x - (z / (a / y))
else
tmp = x + (y / (a / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 1.05e+90) {
tmp = x - (z / (a / y));
} else {
tmp = x + (y / (a / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 1.05e+90: tmp = x - (z / (a / y)) else: tmp = x + (y / (a / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 1.05e+90) tmp = Float64(x - Float64(z / Float64(a / y))); else tmp = Float64(x + Float64(y / Float64(a / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 1.05e+90) tmp = x - (z / (a / y)); else tmp = x + (y / (a / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 1.05e+90], N[(x - N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(a / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.05 \cdot 10^{+90}:\\
\;\;\;\;x - \frac{z}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t}}\\
\end{array}
\end{array}
if t < 1.0499999999999999e90Initial program 95.7%
associate-/l*94.7%
Simplified94.7%
Taylor expanded in z around inf 78.3%
associate-/l*78.2%
Simplified78.2%
*-commutative78.2%
associate-/r/81.0%
Applied egg-rr81.0%
if 1.0499999999999999e90 < t Initial program 92.7%
associate-/l*91.3%
Simplified91.3%
clear-num91.4%
un-div-inv93.1%
Applied egg-rr93.1%
Taylor expanded in z around 0 81.3%
associate-*r/81.3%
neg-mul-181.3%
Simplified81.3%
Final simplification81.0%
(FPCore (x y z t a) :precision binary64 (if (<= z 21500000.0) x (* y (- (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 21500000.0) {
tmp = x;
} else {
tmp = 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 (z <= 21500000.0d0) then
tmp = x
else
tmp = 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 (z <= 21500000.0) {
tmp = x;
} else {
tmp = y * -(z / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= 21500000.0: tmp = x else: tmp = y * -(z / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= 21500000.0) tmp = x; else tmp = Float64(y * Float64(-Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= 21500000.0) tmp = x; else tmp = y * -(z / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, 21500000.0], x, N[(y * (-N[(z / a), $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 21500000:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-\frac{z}{a}\right)\\
\end{array}
\end{array}
if z < 2.15e7Initial program 95.5%
associate-/l*96.1%
Simplified96.1%
Taylor expanded in x around inf 47.3%
if 2.15e7 < z Initial program 93.5%
associate-/l*87.0%
Simplified87.0%
Taylor expanded in z around inf 53.2%
mul-1-neg53.2%
associate-/l*51.5%
distribute-rgt-neg-in51.5%
distribute-neg-frac251.5%
Simplified51.5%
Final simplification48.3%
(FPCore (x y z t a) :precision binary64 (if (<= z 5000.0) x (* z (/ y (- a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 5000.0) {
tmp = x;
} else {
tmp = z * (y / -a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= 5000.0d0) then
tmp = x
else
tmp = z * (y / -a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 5000.0) {
tmp = x;
} else {
tmp = z * (y / -a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= 5000.0: tmp = x else: tmp = z * (y / -a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= 5000.0) tmp = x; else tmp = Float64(z * Float64(y / Float64(-a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= 5000.0) tmp = x; else tmp = z * (y / -a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, 5000.0], x, N[(z * N[(y / (-a)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 5000:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{y}{-a}\\
\end{array}
\end{array}
if z < 5e3Initial program 95.5%
associate-/l*96.1%
Simplified96.1%
Taylor expanded in x around inf 47.3%
if 5e3 < z Initial program 93.5%
associate-/l*87.0%
Simplified87.0%
Taylor expanded in y around 0 93.5%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 53.2%
mul-1-neg53.2%
associate-*l/56.2%
distribute-rgt-neg-in56.2%
Simplified56.2%
Final simplification49.4%
(FPCore (x y z t a) :precision binary64 (if (<= z 44.0) x (* y (- (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 44.0) {
tmp = x;
} else {
tmp = 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 (z <= 44.0d0) then
tmp = x
else
tmp = 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 (z <= 44.0) {
tmp = x;
} else {
tmp = y * -(z / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= 44.0: tmp = x else: tmp = y * -(z / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= 44.0) tmp = x; else tmp = Float64(y * Float64(-Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= 44.0) tmp = x; else tmp = y * -(z / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, 44.0], x, N[(y * (-N[(z / a), $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 44:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-\frac{z}{a}\right)\\
\end{array}
\end{array}
if z < 44Initial program 95.5%
associate-/l*96.1%
Simplified96.1%
Taylor expanded in x around inf 47.3%
if 44 < z Initial program 93.5%
associate-/l*87.0%
Simplified87.0%
Taylor expanded in y around 0 93.5%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 53.2%
associate-*r/53.2%
mul-1-neg53.2%
distribute-rgt-neg-out53.2%
Simplified53.2%
distribute-rgt-neg-out53.2%
distribute-lft-neg-in53.2%
associate-*r/51.5%
*-commutative51.5%
Applied egg-rr51.5%
Final simplification48.3%
(FPCore (x y z t a) :precision binary64 (if (<= z 25.5) x (/ (* z y) (- a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 25.5) {
tmp = x;
} else {
tmp = (z * y) / -a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= 25.5d0) then
tmp = x
else
tmp = (z * y) / -a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 25.5) {
tmp = x;
} else {
tmp = (z * y) / -a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= 25.5: tmp = x else: tmp = (z * y) / -a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= 25.5) tmp = x; else tmp = Float64(Float64(z * y) / Float64(-a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= 25.5) tmp = x; else tmp = (z * y) / -a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, 25.5], x, N[(N[(z * y), $MachinePrecision] / (-a)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 25.5:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{z \cdot y}{-a}\\
\end{array}
\end{array}
if z < 25.5Initial program 95.5%
associate-/l*96.1%
Simplified96.1%
Taylor expanded in x around inf 47.3%
if 25.5 < z Initial program 93.5%
associate-/l*87.0%
Simplified87.0%
Taylor expanded in y around 0 93.5%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 53.2%
associate-*r/53.2%
mul-1-neg53.2%
distribute-rgt-neg-out53.2%
Simplified53.2%
Final simplification48.7%
(FPCore (x y z t a) :precision binary64 (if (<= y 3200000000000.0) x (/ (* t y) a)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= 3200000000000.0) {
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 <= 3200000000000.0d0) 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 <= 3200000000000.0) {
tmp = x;
} else {
tmp = (t * y) / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= 3200000000000.0: tmp = x else: tmp = (t * y) / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= 3200000000000.0) tmp = x; else tmp = Float64(Float64(t * y) / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= 3200000000000.0) tmp = x; else tmp = (t * y) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, 3200000000000.0], x, N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3200000000000:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{t \cdot y}{a}\\
\end{array}
\end{array}
if y < 3.2e12Initial program 96.4%
associate-/l*92.1%
Simplified92.1%
Taylor expanded in x around inf 50.2%
if 3.2e12 < y Initial program 90.8%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in t around inf 57.9%
*-commutative57.9%
Simplified57.9%
Final simplification52.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 95.0%
associate-/l*94.0%
Simplified94.0%
Final simplification94.0%
(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 95.0%
associate-/l*94.0%
Simplified94.0%
Taylor expanded in y around 0 95.0%
associate-*l/97.1%
*-commutative97.1%
Simplified97.1%
Final simplification97.1%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 95.0%
associate-/l*94.0%
Simplified94.0%
Taylor expanded in x around inf 41.7%
Final simplification41.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 2024066
(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)))