
(FPCore (x y z t a) :precision binary64 (- x (/ (* y (- z t)) a)))
double code(double x, double y, double z, double t, double a) {
return x - ((y * (z - t)) / a);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x - ((y * (z - t)) / a)
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y * (z - t)) / a);
}
def code(x, y, z, t, a): return x - ((y * (z - t)) / a)
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y * Float64(z - t)) / a)) end
function tmp = code(x, y, z, t, a) tmp = x - ((y * (z - t)) / a); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y \cdot \left(z - t\right)}{a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (- x (/ (* y (- z t)) a)))
double code(double x, double y, double z, double t, double a) {
return x - ((y * (z - t)) / a);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x - ((y * (z - t)) / a)
end function
public static double code(double x, double y, double z, double t, double a) {
return x - ((y * (z - t)) / a);
}
def code(x, y, z, t, a): return x - ((y * (z - t)) / a)
function code(x, y, z, t, a) return Float64(x - Float64(Float64(y * Float64(z - t)) / a)) end
function tmp = code(x, y, z, t, a) tmp = x - ((y * (z - t)) / a); end
code[x_, y_, z_, t_, a_] := N[(x - N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y \cdot \left(z - t\right)}{a}
\end{array}
(FPCore (x y z t a) :precision binary64 (if (<= a -5.9e-108) (+ x (* y (/ (- t z) a))) (+ x (/ (- t z) (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -5.9e-108) {
tmp = x + (y * ((t - z) / a));
} else {
tmp = x + ((t - 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 (a <= (-5.9d-108)) then
tmp = x + (y * ((t - z) / a))
else
tmp = x + ((t - 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 (a <= -5.9e-108) {
tmp = x + (y * ((t - z) / a));
} else {
tmp = x + ((t - z) / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -5.9e-108: tmp = x + (y * ((t - z) / a)) else: tmp = x + ((t - z) / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -5.9e-108) tmp = Float64(x + Float64(y * Float64(Float64(t - z) / a))); else tmp = Float64(x + Float64(Float64(t - z) / Float64(a / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -5.9e-108) tmp = x + (y * ((t - z) / a)); else tmp = x + ((t - z) / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -5.9e-108], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t - z), $MachinePrecision] / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.9 \cdot 10^{-108}:\\
\;\;\;\;x + y \cdot \frac{t - z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t - z}{\frac{a}{y}}\\
\end{array}
\end{array}
if a < -5.89999999999999965e-108Initial program 94.8%
associate-/l*99.9%
Simplified99.9%
if -5.89999999999999965e-108 < a Initial program 92.5%
associate-/l*89.5%
Simplified89.5%
Taylor expanded in y around 0 92.5%
*-commutative92.5%
associate-*r/99.2%
Simplified99.2%
Taylor expanded in z around 0 85.1%
mul-1-neg85.1%
associate-*r/88.0%
distribute-lft-neg-out88.0%
*-commutative88.0%
associate-*l/89.4%
distribute-lft-out99.2%
+-commutative99.2%
sub-neg99.2%
associate-*l/92.5%
associate-/l*89.5%
*-commutative89.5%
associate-/r/99.3%
Simplified99.3%
Final simplification99.5%
(FPCore (x y z t a) :precision binary64 (if (<= x -6e-52) x (if (<= x 1.8e-114) (/ t (/ a y)) (if (<= x 4500.0) (* z (/ y (- a))) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -6e-52) {
tmp = x;
} else if (x <= 1.8e-114) {
tmp = t / (a / y);
} else if (x <= 4500.0) {
tmp = z * (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 (x <= (-6d-52)) then
tmp = x
else if (x <= 1.8d-114) then
tmp = t / (a / y)
else if (x <= 4500.0d0) then
tmp = z * (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 (x <= -6e-52) {
tmp = x;
} else if (x <= 1.8e-114) {
tmp = t / (a / y);
} else if (x <= 4500.0) {
tmp = z * (y / -a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -6e-52: tmp = x elif x <= 1.8e-114: tmp = t / (a / y) elif x <= 4500.0: tmp = z * (y / -a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -6e-52) tmp = x; elseif (x <= 1.8e-114) tmp = Float64(t / Float64(a / y)); elseif (x <= 4500.0) tmp = Float64(z * Float64(y / Float64(-a))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -6e-52) tmp = x; elseif (x <= 1.8e-114) tmp = t / (a / y); elseif (x <= 4500.0) tmp = z * (y / -a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -6e-52], x, If[LessEqual[x, 1.8e-114], N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4500.0], N[(z * N[(y / (-a)), $MachinePrecision]), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6 \cdot 10^{-52}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{-114}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\mathbf{elif}\;x \leq 4500:\\
\;\;\;\;z \cdot \frac{y}{-a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -6e-52 or 4500 < x Initial program 95.0%
associate-/l*93.0%
Simplified93.0%
Taylor expanded in x around inf 63.2%
if -6e-52 < x < 1.80000000000000009e-114Initial program 92.8%
associate-/l*95.6%
Simplified95.6%
Taylor expanded in t around inf 50.6%
*-commutative50.6%
associate-/l*51.4%
Simplified51.4%
Taylor expanded in y around 0 50.6%
associate-*l/51.4%
associate-/r/55.6%
Simplified55.6%
if 1.80000000000000009e-114 < x < 4500Initial program 87.1%
associate-/l*86.8%
Simplified86.8%
Taylor expanded in y around 0 87.1%
*-commutative87.1%
associate-*r/96.8%
Simplified96.8%
Taylor expanded in z around inf 40.3%
mul-1-neg40.3%
associate-*r/36.7%
distribute-lft-neg-out36.7%
*-commutative36.7%
Simplified36.7%
distribute-rgt-neg-out36.7%
associate-/r/52.9%
div-inv52.7%
clear-num52.8%
Applied egg-rr52.8%
Final simplification59.3%
(FPCore (x y z t a) :precision binary64 (if (<= x -2.25e-52) x (if (<= x 1.8e-114) (/ t (/ a y)) (if (<= x 115.0) (/ (- z) (/ a y)) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -2.25e-52) {
tmp = x;
} else if (x <= 1.8e-114) {
tmp = t / (a / y);
} else if (x <= 115.0) {
tmp = -z / (a / y);
} 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 (x <= (-2.25d-52)) then
tmp = x
else if (x <= 1.8d-114) then
tmp = t / (a / y)
else if (x <= 115.0d0) then
tmp = -z / (a / y)
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 (x <= -2.25e-52) {
tmp = x;
} else if (x <= 1.8e-114) {
tmp = t / (a / y);
} else if (x <= 115.0) {
tmp = -z / (a / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -2.25e-52: tmp = x elif x <= 1.8e-114: tmp = t / (a / y) elif x <= 115.0: tmp = -z / (a / y) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -2.25e-52) tmp = x; elseif (x <= 1.8e-114) tmp = Float64(t / Float64(a / y)); elseif (x <= 115.0) tmp = Float64(Float64(-z) / Float64(a / y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -2.25e-52) tmp = x; elseif (x <= 1.8e-114) tmp = t / (a / y); elseif (x <= 115.0) tmp = -z / (a / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -2.25e-52], x, If[LessEqual[x, 1.8e-114], N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 115.0], N[((-z) / N[(a / y), $MachinePrecision]), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.25 \cdot 10^{-52}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{-114}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\mathbf{elif}\;x \leq 115:\\
\;\;\;\;\frac{-z}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -2.25e-52 or 115 < x Initial program 95.0%
associate-/l*93.0%
Simplified93.0%
Taylor expanded in x around inf 63.2%
if -2.25e-52 < x < 1.80000000000000009e-114Initial program 92.8%
associate-/l*95.6%
Simplified95.6%
Taylor expanded in t around inf 50.6%
*-commutative50.6%
associate-/l*51.4%
Simplified51.4%
Taylor expanded in y around 0 50.6%
associate-*l/51.4%
associate-/r/55.6%
Simplified55.6%
if 1.80000000000000009e-114 < x < 115Initial program 87.1%
associate-/l*86.8%
Simplified86.8%
Taylor expanded in y around 0 87.1%
*-commutative87.1%
associate-*r/96.8%
Simplified96.8%
Taylor expanded in z around inf 40.3%
mul-1-neg40.3%
associate-*r/36.7%
distribute-lft-neg-out36.7%
*-commutative36.7%
Simplified36.7%
add-sqr-sqrt18.4%
sqrt-unprod16.2%
sqr-neg16.2%
sqrt-unprod0.8%
add-sqr-sqrt2.3%
associate-/r/5.6%
frac-2neg5.6%
distribute-neg-frac25.6%
add-sqr-sqrt1.5%
sqrt-unprod22.8%
sqr-neg22.8%
sqrt-unprod24.6%
add-sqr-sqrt52.9%
Applied egg-rr52.9%
Final simplification59.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.95e+56) (not (<= z 7.5e+31))) (* (/ y a) (- t z)) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.95e+56) || !(z <= 7.5e+31)) {
tmp = (y / a) * (t - z);
} 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 <= (-1.95d+56)) .or. (.not. (z <= 7.5d+31))) then
tmp = (y / a) * (t - z)
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 <= -1.95e+56) || !(z <= 7.5e+31)) {
tmp = (y / a) * (t - z);
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.95e+56) or not (z <= 7.5e+31): tmp = (y / a) * (t - z) else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.95e+56) || !(z <= 7.5e+31)) tmp = Float64(Float64(y / a) * Float64(t - z)); else tmp = Float64(x + Float64(Float64(y * t) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.95e+56) || ~((z <= 7.5e+31))) tmp = (y / a) * (t - z); else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.95e+56], N[Not[LessEqual[z, 7.5e+31]], $MachinePrecision]], N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.95 \cdot 10^{+56} \lor \neg \left(z \leq 7.5 \cdot 10^{+31}\right):\\
\;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -1.94999999999999997e56 or 7.5e31 < z Initial program 88.5%
associate-/l*91.0%
Simplified91.0%
Taylor expanded in y around 0 88.5%
*-commutative88.5%
associate-*r/97.4%
Simplified97.4%
Taylor expanded in x around 0 64.9%
mul-1-neg64.9%
*-commutative64.9%
associate-*r/71.0%
*-commutative71.0%
sub-neg71.0%
+-commutative71.0%
distribute-rgt-out61.7%
distribute-lft-neg-out61.7%
associate-*r/57.1%
mul-1-neg57.1%
distribute-neg-in57.1%
mul-1-neg57.1%
associate-*l/59.1%
*-commutative59.1%
remove-double-neg59.1%
sub-neg59.1%
associate-*r/57.1%
associate-*l/61.7%
*-commutative61.7%
distribute-lft-out--71.0%
Simplified71.0%
if -1.94999999999999997e56 < z < 7.5e31Initial program 96.8%
sub-neg96.8%
distribute-frac-neg296.8%
+-commutative96.8%
associate-/l*94.9%
fma-define94.8%
distribute-frac-neg294.8%
distribute-neg-frac94.8%
sub-neg94.8%
distribute-neg-in94.8%
remove-double-neg94.8%
+-commutative94.8%
sub-neg94.8%
Simplified94.8%
Taylor expanded in z around 0 91.6%
Final simplification83.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.42e+51) (not (<= z 3.6e+67))) (- x (/ (* y z) a)) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.42e+51) || !(z <= 3.6e+67)) {
tmp = x - ((y * z) / 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 <= (-1.42d+51)) .or. (.not. (z <= 3.6d+67))) then
tmp = x - ((y * z) / 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 <= -1.42e+51) || !(z <= 3.6e+67)) {
tmp = x - ((y * z) / a);
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.42e+51) or not (z <= 3.6e+67): tmp = x - ((y * z) / a) else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.42e+51) || !(z <= 3.6e+67)) tmp = Float64(x - Float64(Float64(y * z) / a)); else tmp = Float64(x + Float64(Float64(y * t) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.42e+51) || ~((z <= 3.6e+67))) tmp = x - ((y * z) / a); else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.42e+51], N[Not[LessEqual[z, 3.6e+67]], $MachinePrecision]], N[(x - N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.42 \cdot 10^{+51} \lor \neg \left(z \leq 3.6 \cdot 10^{+67}\right):\\
\;\;\;\;x - \frac{y \cdot z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -1.41999999999999998e51 or 3.5999999999999999e67 < z Initial program 88.2%
associate-/l*90.0%
Simplified90.0%
Taylor expanded in z around inf 85.7%
if -1.41999999999999998e51 < z < 3.5999999999999999e67Initial program 96.4%
sub-neg96.4%
distribute-frac-neg296.4%
+-commutative96.4%
associate-/l*95.2%
fma-define95.2%
distribute-frac-neg295.2%
distribute-neg-frac95.2%
sub-neg95.2%
distribute-neg-in95.2%
remove-double-neg95.2%
+-commutative95.2%
sub-neg95.2%
Simplified95.2%
Taylor expanded in z around 0 89.5%
Final simplification88.1%
(FPCore (x y z t a) :precision binary64 (if (<= a -170000000000.0) x (if (<= a 3.9e+107) (* (/ y a) (- t z)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -170000000000.0) {
tmp = x;
} else if (a <= 3.9e+107) {
tmp = (y / a) * (t - z);
} 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 (a <= (-170000000000.0d0)) then
tmp = x
else if (a <= 3.9d+107) then
tmp = (y / a) * (t - z)
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 (a <= -170000000000.0) {
tmp = x;
} else if (a <= 3.9e+107) {
tmp = (y / a) * (t - z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -170000000000.0: tmp = x elif a <= 3.9e+107: tmp = (y / a) * (t - z) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -170000000000.0) tmp = x; elseif (a <= 3.9e+107) tmp = Float64(Float64(y / a) * Float64(t - z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -170000000000.0) tmp = x; elseif (a <= 3.9e+107) tmp = (y / a) * (t - z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -170000000000.0], x, If[LessEqual[a, 3.9e+107], N[(N[(y / a), $MachinePrecision] * N[(t - z), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -170000000000:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 3.9 \cdot 10^{+107}:\\
\;\;\;\;\frac{y}{a} \cdot \left(t - z\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.7e11 or 3.8999999999999998e107 < a Initial program 87.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around inf 67.7%
if -1.7e11 < a < 3.8999999999999998e107Initial program 96.9%
associate-/l*88.9%
Simplified88.9%
Taylor expanded in y around 0 96.9%
*-commutative96.9%
associate-*r/98.6%
Simplified98.6%
Taylor expanded in x around 0 73.9%
mul-1-neg73.9%
*-commutative73.9%
associate-*r/75.6%
*-commutative75.6%
sub-neg75.6%
+-commutative75.6%
distribute-rgt-out65.1%
distribute-lft-neg-out65.1%
associate-*r/64.0%
mul-1-neg64.0%
distribute-neg-in64.0%
mul-1-neg64.0%
associate-*l/60.4%
*-commutative60.4%
remove-double-neg60.4%
sub-neg60.4%
associate-*r/64.0%
associate-*l/65.1%
*-commutative65.1%
distribute-lft-out--75.6%
Simplified75.6%
Final simplification72.4%
(FPCore (x y z t a) :precision binary64 (if (<= x -1.7e-54) x (if (<= x 2.5e-114) (* t (/ y a)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -1.7e-54) {
tmp = x;
} else if (x <= 2.5e-114) {
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 (x <= (-1.7d-54)) then
tmp = x
else if (x <= 2.5d-114) 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 (x <= -1.7e-54) {
tmp = x;
} else if (x <= 2.5e-114) {
tmp = t * (y / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -1.7e-54: tmp = x elif x <= 2.5e-114: tmp = t * (y / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -1.7e-54) tmp = x; elseif (x <= 2.5e-114) 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 (x <= -1.7e-54) tmp = x; elseif (x <= 2.5e-114) tmp = t * (y / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -1.7e-54], x, If[LessEqual[x, 2.5e-114], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.7 \cdot 10^{-54}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{-114}:\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.69999999999999994e-54 or 2.49999999999999995e-114 < x Initial program 93.6%
associate-/l*91.9%
Simplified91.9%
Taylor expanded in x around inf 56.8%
if -1.69999999999999994e-54 < x < 2.49999999999999995e-114Initial program 92.8%
associate-/l*95.6%
Simplified95.6%
Taylor expanded in t around inf 50.6%
associate-/l*55.3%
Simplified55.3%
Final simplification56.3%
(FPCore (x y z t a) :precision binary64 (if (<= x -6e-52) x (if (<= x 3.3e-114) (/ t (/ a y)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -6e-52) {
tmp = x;
} else if (x <= 3.3e-114) {
tmp = t / (a / y);
} 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 (x <= (-6d-52)) then
tmp = x
else if (x <= 3.3d-114) then
tmp = t / (a / y)
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 (x <= -6e-52) {
tmp = x;
} else if (x <= 3.3e-114) {
tmp = t / (a / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -6e-52: tmp = x elif x <= 3.3e-114: tmp = t / (a / y) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -6e-52) tmp = x; elseif (x <= 3.3e-114) tmp = Float64(t / Float64(a / y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -6e-52) tmp = x; elseif (x <= 3.3e-114) tmp = t / (a / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -6e-52], x, If[LessEqual[x, 3.3e-114], N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6 \cdot 10^{-52}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 3.3 \cdot 10^{-114}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -6e-52 or 3.30000000000000035e-114 < x Initial program 93.6%
associate-/l*91.9%
Simplified91.9%
Taylor expanded in x around inf 56.8%
if -6e-52 < x < 3.30000000000000035e-114Initial program 92.8%
associate-/l*95.6%
Simplified95.6%
Taylor expanded in t around inf 50.6%
*-commutative50.6%
associate-/l*51.4%
Simplified51.4%
Taylor expanded in y around 0 50.6%
associate-*l/51.4%
associate-/r/55.6%
Simplified55.6%
Final simplification56.4%
(FPCore (x y z t a) :precision binary64 (if (<= a -6e-63) (+ x (* y (/ (- t z) a))) (- x (* (- z t) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -6e-63) {
tmp = x + (y * ((t - z) / a));
} else {
tmp = x - ((z - 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 (a <= (-6d-63)) then
tmp = x + (y * ((t - z) / a))
else
tmp = x - ((z - 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 (a <= -6e-63) {
tmp = x + (y * ((t - z) / a));
} else {
tmp = x - ((z - t) * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -6e-63: tmp = x + (y * ((t - z) / a)) else: tmp = x - ((z - t) * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -6e-63) tmp = Float64(x + Float64(y * Float64(Float64(t - z) / a))); else tmp = Float64(x - Float64(Float64(z - t) * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -6e-63) tmp = x + (y * ((t - z) / a)); else tmp = x - ((z - t) * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -6e-63], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6 \cdot 10^{-63}:\\
\;\;\;\;x + y \cdot \frac{t - z}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \left(z - t\right) \cdot \frac{y}{a}\\
\end{array}
\end{array}
if a < -5.99999999999999959e-63Initial program 94.3%
associate-/l*99.9%
Simplified99.9%
if -5.99999999999999959e-63 < a Initial program 92.9%
associate-/l*90.0%
Simplified90.0%
Taylor expanded in y around 0 92.9%
*-commutative92.9%
associate-*r/99.2%
Simplified99.2%
Final simplification99.4%
(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 93.3%
associate-/l*93.2%
Simplified93.2%
Final simplification93.2%
(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 93.3%
associate-/l*93.2%
Simplified93.2%
Taylor expanded in x around inf 41.1%
Final simplification41.1%
(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 2024046
(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)))