
(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 (if (<= a -4.3e+102) (+ x (/ y (/ a (- z t)))) (if (<= a 2e+35) (+ x (/ (* (- z t) y) a)) (+ x (* y (/ (- z t) a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -4.3e+102) {
tmp = x + (y / (a / (z - t)));
} else if (a <= 2e+35) {
tmp = x + (((z - t) * y) / a);
} else {
tmp = x + (y * ((z - 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 (a <= (-4.3d+102)) then
tmp = x + (y / (a / (z - t)))
else if (a <= 2d+35) then
tmp = x + (((z - t) * y) / a)
else
tmp = x + (y * ((z - 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 (a <= -4.3e+102) {
tmp = x + (y / (a / (z - t)));
} else if (a <= 2e+35) {
tmp = x + (((z - t) * y) / a);
} else {
tmp = x + (y * ((z - t) / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -4.3e+102: tmp = x + (y / (a / (z - t))) elif a <= 2e+35: tmp = x + (((z - t) * y) / a) else: tmp = x + (y * ((z - t) / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -4.3e+102) tmp = Float64(x + Float64(y / Float64(a / Float64(z - t)))); elseif (a <= 2e+35) tmp = Float64(x + Float64(Float64(Float64(z - t) * y) / a)); else tmp = Float64(x + Float64(y * Float64(Float64(z - t) / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -4.3e+102) tmp = x + (y / (a / (z - t))); elseif (a <= 2e+35) tmp = x + (((z - t) * y) / a); else tmp = x + (y * ((z - t) / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -4.3e+102], N[(x + N[(y / N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2e+35], N[(x + N[(N[(N[(z - t), $MachinePrecision] * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.3 \cdot 10^{+102}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z - t}}\\
\mathbf{elif}\;a \leq 2 \cdot 10^{+35}:\\
\;\;\;\;x + \frac{\left(z - t\right) \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\
\end{array}
\end{array}
if a < -4.3000000000000001e102Initial program 87.8%
associate-/l*99.8%
Simplified99.8%
clear-num99.8%
un-div-inv99.9%
Applied egg-rr99.9%
if -4.3000000000000001e102 < a < 1.9999999999999999e35Initial program 99.8%
if 1.9999999999999999e35 < a Initial program 80.1%
associate-/l*99.9%
Simplified99.9%
Final simplification99.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ (* z y) a))) (t_2 (* t (/ y (- a)))))
(if (<= t -5.8e+158)
t_2
(if (<= t -4.5e+96)
t_1
(if (<= t -2.1e+73) (* y (/ t (- a))) (if (<= t 2.55e+103) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((z * y) / a);
double t_2 = t * (y / -a);
double tmp;
if (t <= -5.8e+158) {
tmp = t_2;
} else if (t <= -4.5e+96) {
tmp = t_1;
} else if (t <= -2.1e+73) {
tmp = y * (t / -a);
} else if (t <= 2.55e+103) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = x + ((z * y) / a)
t_2 = t * (y / -a)
if (t <= (-5.8d+158)) then
tmp = t_2
else if (t <= (-4.5d+96)) then
tmp = t_1
else if (t <= (-2.1d+73)) then
tmp = y * (t / -a)
else if (t <= 2.55d+103) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((z * y) / a);
double t_2 = t * (y / -a);
double tmp;
if (t <= -5.8e+158) {
tmp = t_2;
} else if (t <= -4.5e+96) {
tmp = t_1;
} else if (t <= -2.1e+73) {
tmp = y * (t / -a);
} else if (t <= 2.55e+103) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((z * y) / a) t_2 = t * (y / -a) tmp = 0 if t <= -5.8e+158: tmp = t_2 elif t <= -4.5e+96: tmp = t_1 elif t <= -2.1e+73: tmp = y * (t / -a) elif t <= 2.55e+103: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(z * y) / a)) t_2 = Float64(t * Float64(y / Float64(-a))) tmp = 0.0 if (t <= -5.8e+158) tmp = t_2; elseif (t <= -4.5e+96) tmp = t_1; elseif (t <= -2.1e+73) tmp = Float64(y * Float64(t / Float64(-a))); elseif (t <= 2.55e+103) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((z * y) / a); t_2 = t * (y / -a); tmp = 0.0; if (t <= -5.8e+158) tmp = t_2; elseif (t <= -4.5e+96) tmp = t_1; elseif (t <= -2.1e+73) tmp = y * (t / -a); elseif (t <= 2.55e+103) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(y / (-a)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.8e+158], t$95$2, If[LessEqual[t, -4.5e+96], t$95$1, If[LessEqual[t, -2.1e+73], N[(y * N[(t / (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.55e+103], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{z \cdot y}{a}\\
t_2 := t \cdot \frac{y}{-a}\\
\mathbf{if}\;t \leq -5.8 \cdot 10^{+158}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -4.5 \cdot 10^{+96}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -2.1 \cdot 10^{+73}:\\
\;\;\;\;y \cdot \frac{t}{-a}\\
\mathbf{elif}\;t \leq 2.55 \cdot 10^{+103}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -5.80000000000000048e158 or 2.5500000000000001e103 < t Initial program 85.9%
+-commutative85.9%
associate-/l*89.6%
fma-define89.6%
Simplified89.6%
fma-undefine89.6%
associate-*r/85.9%
*-commutative85.9%
associate-/l*97.5%
Applied egg-rr97.5%
Taylor expanded in z around 0 78.5%
associate-*l/82.3%
*-commutative82.3%
neg-mul-182.3%
sub-neg82.3%
*-commutative82.3%
associate-*l/78.5%
associate-*r/88.2%
Simplified88.2%
Taylor expanded in x around 0 61.8%
mul-1-neg61.8%
associate-*r/70.2%
distribute-rgt-neg-in70.2%
distribute-neg-frac70.2%
Simplified70.2%
if -5.80000000000000048e158 < t < -4.49999999999999957e96 or -2.1000000000000001e73 < t < 2.5500000000000001e103Initial program 95.4%
associate-/l*94.5%
Simplified94.5%
Taylor expanded in z around inf 87.1%
if -4.49999999999999957e96 < t < -2.1000000000000001e73Initial program 99.7%
+-commutative99.7%
associate-/l*100.0%
fma-define100.0%
Simplified100.0%
fma-undefine100.0%
associate-*r/99.7%
*-commutative99.7%
associate-/l*99.7%
Applied egg-rr99.7%
Taylor expanded in z around 0 99.7%
associate-*l/100.0%
*-commutative100.0%
neg-mul-1100.0%
sub-neg100.0%
*-commutative100.0%
associate-*l/99.7%
associate-*r/99.7%
Simplified99.7%
Taylor expanded in x around 0 99.7%
mul-1-neg99.7%
associate-*l/100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
Final simplification82.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* t (/ y (- a)))))
(if (<= t -4.5e+159)
t_1
(if (<= t -2.8e+95)
(+ x (* y (/ z a)))
(if (<= t -1.65e+72)
(* y (/ t (- a)))
(if (<= t 3.4e+102) (+ x (/ (* z y) a)) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t * (y / -a);
double tmp;
if (t <= -4.5e+159) {
tmp = t_1;
} else if (t <= -2.8e+95) {
tmp = x + (y * (z / a));
} else if (t <= -1.65e+72) {
tmp = y * (t / -a);
} else if (t <= 3.4e+102) {
tmp = x + ((z * y) / a);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = t * (y / -a)
if (t <= (-4.5d+159)) then
tmp = t_1
else if (t <= (-2.8d+95)) then
tmp = x + (y * (z / a))
else if (t <= (-1.65d+72)) then
tmp = y * (t / -a)
else if (t <= 3.4d+102) then
tmp = x + ((z * y) / a)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t * (y / -a);
double tmp;
if (t <= -4.5e+159) {
tmp = t_1;
} else if (t <= -2.8e+95) {
tmp = x + (y * (z / a));
} else if (t <= -1.65e+72) {
tmp = y * (t / -a);
} else if (t <= 3.4e+102) {
tmp = x + ((z * y) / a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t * (y / -a) tmp = 0 if t <= -4.5e+159: tmp = t_1 elif t <= -2.8e+95: tmp = x + (y * (z / a)) elif t <= -1.65e+72: tmp = y * (t / -a) elif t <= 3.4e+102: tmp = x + ((z * y) / a) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(t * Float64(y / Float64(-a))) tmp = 0.0 if (t <= -4.5e+159) tmp = t_1; elseif (t <= -2.8e+95) tmp = Float64(x + Float64(y * Float64(z / a))); elseif (t <= -1.65e+72) tmp = Float64(y * Float64(t / Float64(-a))); elseif (t <= 3.4e+102) tmp = Float64(x + Float64(Float64(z * y) / a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t * (y / -a); tmp = 0.0; if (t <= -4.5e+159) tmp = t_1; elseif (t <= -2.8e+95) tmp = x + (y * (z / a)); elseif (t <= -1.65e+72) tmp = y * (t / -a); elseif (t <= 3.4e+102) tmp = x + ((z * y) / a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(y / (-a)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.5e+159], t$95$1, If[LessEqual[t, -2.8e+95], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.65e+72], N[(y * N[(t / (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.4e+102], N[(x + N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{y}{-a}\\
\mathbf{if}\;t \leq -4.5 \cdot 10^{+159}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -2.8 \cdot 10^{+95}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\mathbf{elif}\;t \leq -1.65 \cdot 10^{+72}:\\
\;\;\;\;y \cdot \frac{t}{-a}\\
\mathbf{elif}\;t \leq 3.4 \cdot 10^{+102}:\\
\;\;\;\;x + \frac{z \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.50000000000000026e159 or 3.4e102 < t Initial program 85.9%
+-commutative85.9%
associate-/l*89.6%
fma-define89.6%
Simplified89.6%
fma-undefine89.6%
associate-*r/85.9%
*-commutative85.9%
associate-/l*97.5%
Applied egg-rr97.5%
Taylor expanded in z around 0 78.5%
associate-*l/82.3%
*-commutative82.3%
neg-mul-182.3%
sub-neg82.3%
*-commutative82.3%
associate-*l/78.5%
associate-*r/88.2%
Simplified88.2%
Taylor expanded in x around 0 61.8%
mul-1-neg61.8%
associate-*r/70.2%
distribute-rgt-neg-in70.2%
distribute-neg-frac70.2%
Simplified70.2%
if -4.50000000000000026e159 < t < -2.7999999999999998e95Initial program 86.4%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around 0 68.7%
+-commutative68.7%
associate-/l*75.3%
Simplified75.3%
if -2.7999999999999998e95 < t < -1.65e72Initial program 99.7%
+-commutative99.7%
associate-/l*100.0%
fma-define100.0%
Simplified100.0%
fma-undefine100.0%
associate-*r/99.7%
*-commutative99.7%
associate-/l*99.7%
Applied egg-rr99.7%
Taylor expanded in z around 0 99.7%
associate-*l/100.0%
*-commutative100.0%
neg-mul-1100.0%
sub-neg100.0%
*-commutative100.0%
associate-*l/99.7%
associate-*r/99.7%
Simplified99.7%
Taylor expanded in x around 0 99.7%
mul-1-neg99.7%
associate-*l/100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
if -1.65e72 < t < 3.4e102Initial program 96.2%
associate-/l*94.0%
Simplified94.0%
Taylor expanded in z around inf 88.7%
Final simplification82.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* t (/ y (- a)))))
(if (<= t -5.3e+157)
t_1
(if (<= t -1.1e+99)
(+ x (* y (/ z a)))
(if (<= t -2.15e+73)
(* y (/ t (- a)))
(if (<= t 7.1e+121) (+ x (* z (/ y a))) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t * (y / -a);
double tmp;
if (t <= -5.3e+157) {
tmp = t_1;
} else if (t <= -1.1e+99) {
tmp = x + (y * (z / a));
} else if (t <= -2.15e+73) {
tmp = y * (t / -a);
} else if (t <= 7.1e+121) {
tmp = x + (z * (y / a));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = t * (y / -a)
if (t <= (-5.3d+157)) then
tmp = t_1
else if (t <= (-1.1d+99)) then
tmp = x + (y * (z / a))
else if (t <= (-2.15d+73)) then
tmp = y * (t / -a)
else if (t <= 7.1d+121) then
tmp = x + (z * (y / a))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t * (y / -a);
double tmp;
if (t <= -5.3e+157) {
tmp = t_1;
} else if (t <= -1.1e+99) {
tmp = x + (y * (z / a));
} else if (t <= -2.15e+73) {
tmp = y * (t / -a);
} else if (t <= 7.1e+121) {
tmp = x + (z * (y / a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t * (y / -a) tmp = 0 if t <= -5.3e+157: tmp = t_1 elif t <= -1.1e+99: tmp = x + (y * (z / a)) elif t <= -2.15e+73: tmp = y * (t / -a) elif t <= 7.1e+121: tmp = x + (z * (y / a)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(t * Float64(y / Float64(-a))) tmp = 0.0 if (t <= -5.3e+157) tmp = t_1; elseif (t <= -1.1e+99) tmp = Float64(x + Float64(y * Float64(z / a))); elseif (t <= -2.15e+73) tmp = Float64(y * Float64(t / Float64(-a))); elseif (t <= 7.1e+121) tmp = Float64(x + Float64(z * Float64(y / a))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t * (y / -a); tmp = 0.0; if (t <= -5.3e+157) tmp = t_1; elseif (t <= -1.1e+99) tmp = x + (y * (z / a)); elseif (t <= -2.15e+73) tmp = y * (t / -a); elseif (t <= 7.1e+121) tmp = x + (z * (y / a)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(y / (-a)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.3e+157], t$95$1, If[LessEqual[t, -1.1e+99], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -2.15e+73], N[(y * N[(t / (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.1e+121], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{y}{-a}\\
\mathbf{if}\;t \leq -5.3 \cdot 10^{+157}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.1 \cdot 10^{+99}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\mathbf{elif}\;t \leq -2.15 \cdot 10^{+73}:\\
\;\;\;\;y \cdot \frac{t}{-a}\\
\mathbf{elif}\;t \leq 7.1 \cdot 10^{+121}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -5.2999999999999998e157 or 7.10000000000000023e121 < t Initial program 87.6%
+-commutative87.6%
associate-/l*89.1%
fma-define89.1%
Simplified89.1%
fma-undefine89.1%
associate-*r/87.6%
*-commutative87.6%
associate-/l*97.4%
Applied egg-rr97.4%
Taylor expanded in z around 0 79.8%
associate-*l/82.6%
*-commutative82.6%
neg-mul-182.6%
sub-neg82.6%
*-commutative82.6%
associate-*l/79.8%
associate-*r/88.8%
Simplified88.8%
Taylor expanded in x around 0 63.5%
mul-1-neg63.5%
associate-*r/71.1%
distribute-rgt-neg-in71.1%
distribute-neg-frac71.1%
Simplified71.1%
if -5.2999999999999998e157 < t < -1.09999999999999989e99Initial program 86.4%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in t around 0 68.7%
+-commutative68.7%
associate-/l*75.3%
Simplified75.3%
if -1.09999999999999989e99 < t < -2.15000000000000007e73Initial program 99.7%
+-commutative99.7%
associate-/l*100.0%
fma-define100.0%
Simplified100.0%
fma-undefine100.0%
associate-*r/99.7%
*-commutative99.7%
associate-/l*99.7%
Applied egg-rr99.7%
Taylor expanded in z around 0 99.7%
associate-*l/100.0%
*-commutative100.0%
neg-mul-1100.0%
sub-neg100.0%
*-commutative100.0%
associate-*l/99.7%
associate-*r/99.7%
Simplified99.7%
Taylor expanded in x around 0 99.7%
mul-1-neg99.7%
associate-*l/100.0%
distribute-rgt-neg-in100.0%
Simplified100.0%
if -2.15000000000000007e73 < t < 7.10000000000000023e121Initial program 95.1%
+-commutative95.1%
associate-/l*94.2%
fma-define94.2%
Simplified94.2%
fma-undefine94.2%
associate-*r/95.1%
*-commutative95.1%
associate-/l*97.5%
Applied egg-rr97.5%
Taylor expanded in z around inf 87.8%
associate-*l/89.6%
*-commutative89.6%
Simplified89.6%
Final simplification83.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.7e+39) (not (<= t 3.4e+31))) (- x (* t (/ y a))) (+ x (/ z (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.7e+39) || !(t <= 3.4e+31)) {
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 <= (-3.7d+39)) .or. (.not. (t <= 3.4d+31))) 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 <= -3.7e+39) || !(t <= 3.4e+31)) {
tmp = x - (t * (y / a));
} else {
tmp = x + (z / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.7e+39) or not (t <= 3.4e+31): 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 <= -3.7e+39) || !(t <= 3.4e+31)) tmp = Float64(x - Float64(t * Float64(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 <= -3.7e+39) || ~((t <= 3.4e+31))) tmp = x - (t * (y / a)); else tmp = x + (z / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.7e+39], N[Not[LessEqual[t, 3.4e+31]], $MachinePrecision]], N[(x - N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.7 \cdot 10^{+39} \lor \neg \left(t \leq 3.4 \cdot 10^{+31}\right):\\
\;\;\;\;x - t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z}{\frac{a}{y}}\\
\end{array}
\end{array}
if t < -3.70000000000000012e39 or 3.3999999999999998e31 < t Initial program 87.7%
+-commutative87.7%
associate-/l*92.5%
fma-define92.5%
Simplified92.5%
fma-undefine92.5%
associate-*r/87.7%
*-commutative87.7%
associate-/l*97.7%
Applied egg-rr97.7%
Taylor expanded in z around 0 78.5%
associate-*l/81.7%
*-commutative81.7%
neg-mul-181.7%
sub-neg81.7%
*-commutative81.7%
associate-*l/78.5%
associate-*r/86.2%
Simplified86.2%
if -3.70000000000000012e39 < t < 3.3999999999999998e31Initial program 97.0%
+-commutative97.0%
associate-/l*93.7%
fma-define93.7%
Simplified93.7%
fma-undefine93.7%
associate-*r/97.0%
*-commutative97.0%
associate-/l*97.0%
Applied egg-rr97.0%
Taylor expanded in z around inf 92.0%
associate-*l/92.7%
*-commutative92.7%
Simplified92.7%
clear-num92.6%
un-div-inv92.7%
Applied egg-rr92.7%
Final simplification89.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.8e+67) (not (<= t 1.04e+102))) (* t (/ y (- a))) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.8e+67) || !(t <= 1.04e+102)) {
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 ((t <= (-2.8d+67)) .or. (.not. (t <= 1.04d+102))) 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 ((t <= -2.8e+67) || !(t <= 1.04e+102)) {
tmp = t * (y / -a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.8e+67) or not (t <= 1.04e+102): tmp = t * (y / -a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.8e+67) || !(t <= 1.04e+102)) tmp = Float64(t * Float64(y / Float64(-a))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.8e+67) || ~((t <= 1.04e+102))) tmp = t * (y / -a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.8e+67], N[Not[LessEqual[t, 1.04e+102]], $MachinePrecision]], N[(t * N[(y / (-a)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.8 \cdot 10^{+67} \lor \neg \left(t \leq 1.04 \cdot 10^{+102}\right):\\
\;\;\;\;t \cdot \frac{y}{-a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -2.7999999999999998e67 or 1.04e102 < t Initial program 86.8%
+-commutative86.8%
associate-/l*91.7%
fma-define91.7%
Simplified91.7%
fma-undefine91.7%
associate-*r/86.8%
*-commutative86.8%
associate-/l*97.2%
Applied egg-rr97.2%
Taylor expanded in z around 0 79.1%
associate-*l/83.1%
*-commutative83.1%
neg-mul-183.1%
sub-neg83.1%
*-commutative83.1%
associate-*l/79.1%
associate-*r/87.8%
Simplified87.8%
Taylor expanded in x around 0 59.9%
mul-1-neg59.9%
associate-*r/66.6%
distribute-rgt-neg-in66.6%
distribute-neg-frac66.6%
Simplified66.6%
if -2.7999999999999998e67 < t < 1.04e102Initial program 96.2%
associate-/l*94.0%
Simplified94.0%
Taylor expanded in x around inf 54.5%
Final simplification59.3%
(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(y * Float64(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[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a}
\end{array}
Initial program 92.5%
associate-/l*93.1%
Simplified93.1%
Final simplification93.1%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ a (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / (a / (z - t)));
}
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 / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / (a / (z - t)));
}
def code(x, y, z, t, a): return x + (y / (a / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(a / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / (a / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{a}{z - t}}
\end{array}
Initial program 92.5%
associate-/l*93.1%
Simplified93.1%
clear-num92.9%
un-div-inv93.5%
Applied egg-rr93.5%
Final simplification93.5%
(FPCore (x y z t a) :precision binary64 (+ (* (- z t) (/ y a)) x))
double code(double x, double y, double z, double t, double a) {
return ((z - t) * (y / a)) + 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 = ((z - t) * (y / a)) + x
end function
public static double code(double x, double y, double z, double t, double a) {
return ((z - t) * (y / a)) + x;
}
def code(x, y, z, t, a): return ((z - t) * (y / a)) + x
function code(x, y, z, t, a) return Float64(Float64(Float64(z - t) * Float64(y / a)) + x) end
function tmp = code(x, y, z, t, a) tmp = ((z - t) * (y / a)) + x; end
code[x_, y_, z_, t_, a_] := N[(N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\left(z - t\right) \cdot \frac{y}{a} + x
\end{array}
Initial program 92.5%
+-commutative92.5%
associate-/l*93.1%
fma-define93.1%
Simplified93.1%
fma-undefine93.1%
associate-*r/92.5%
*-commutative92.5%
associate-/l*97.4%
Applied egg-rr97.4%
Final simplification97.4%
(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 92.5%
associate-/l*93.1%
Simplified93.1%
Taylor expanded in x around inf 42.2%
Final simplification42.2%
(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 2024079
(FPCore (x y z t a)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, E"
: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)))