
(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 12 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 91.8%
associate-/l*95.3%
Simplified95.3%
Taylor expanded in y around 0 91.8%
associate-*l/98.0%
*-commutative98.0%
Simplified98.0%
clear-num98.0%
un-div-inv98.4%
Applied egg-rr98.4%
Final simplification98.4%
(FPCore (x y z t a)
:precision binary64
(if (or (<= y -1.8e+31)
(not
(or (<= y -2.4e-26) (and (not (<= y -1.6e-156)) (<= y 3.3e-26)))))
(* y (/ (- t z) a))
x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.8e+31) || !((y <= -2.4e-26) || (!(y <= -1.6e-156) && (y <= 3.3e-26)))) {
tmp = y * ((t - z) / a);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((y <= (-1.8d+31)) .or. (.not. (y <= (-2.4d-26)) .or. (.not. (y <= (-1.6d-156))) .and. (y <= 3.3d-26))) then
tmp = y * ((t - z) / a)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.8e+31) || !((y <= -2.4e-26) || (!(y <= -1.6e-156) && (y <= 3.3e-26)))) {
tmp = y * ((t - z) / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -1.8e+31) or not ((y <= -2.4e-26) or (not (y <= -1.6e-156) and (y <= 3.3e-26))): tmp = y * ((t - z) / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -1.8e+31) || !((y <= -2.4e-26) || (!(y <= -1.6e-156) && (y <= 3.3e-26)))) tmp = Float64(y * Float64(Float64(t - z) / a)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -1.8e+31) || ~(((y <= -2.4e-26) || (~((y <= -1.6e-156)) && (y <= 3.3e-26))))) tmp = y * ((t - z) / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -1.8e+31], N[Not[Or[LessEqual[y, -2.4e-26], And[N[Not[LessEqual[y, -1.6e-156]], $MachinePrecision], LessEqual[y, 3.3e-26]]]], $MachinePrecision]], N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.8 \cdot 10^{+31} \lor \neg \left(y \leq -2.4 \cdot 10^{-26} \lor \neg \left(y \leq -1.6 \cdot 10^{-156}\right) \land y \leq 3.3 \cdot 10^{-26}\right):\\
\;\;\;\;y \cdot \frac{t - z}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.79999999999999998e31 or -2.4000000000000001e-26 < y < -1.59999999999999991e-156 or 3.2999999999999998e-26 < y Initial program 87.7%
associate-/l*99.2%
Simplified99.2%
Taylor expanded in x around 0 66.6%
mul-1-neg66.6%
distribute-frac-neg266.6%
sub-neg66.6%
+-commutative66.6%
neg-sub066.6%
associate--r-66.6%
neg-sub066.6%
associate-*r/77.0%
distribute-neg-frac77.0%
distribute-neg-frac277.0%
remove-double-neg77.0%
Simplified77.0%
if -1.79999999999999998e31 < y < -2.4000000000000001e-26 or -1.59999999999999991e-156 < y < 3.2999999999999998e-26Initial program 99.8%
associate-/l*87.8%
Simplified87.8%
Taylor expanded in x around inf 72.0%
Final simplification75.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* t (/ y a))))
(if (<= t -2.4e+60)
t_1
(if (<= t 2.25e-237)
x
(if (<= t 2.8e-111) (* (/ y a) (- z)) (if (<= t 1.05e+27) x t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t * (y / a);
double tmp;
if (t <= -2.4e+60) {
tmp = t_1;
} else if (t <= 2.25e-237) {
tmp = x;
} else if (t <= 2.8e-111) {
tmp = (y / a) * -z;
} else if (t <= 1.05e+27) {
tmp = x;
} 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 <= (-2.4d+60)) then
tmp = t_1
else if (t <= 2.25d-237) then
tmp = x
else if (t <= 2.8d-111) then
tmp = (y / a) * -z
else if (t <= 1.05d+27) then
tmp = x
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 <= -2.4e+60) {
tmp = t_1;
} else if (t <= 2.25e-237) {
tmp = x;
} else if (t <= 2.8e-111) {
tmp = (y / a) * -z;
} else if (t <= 1.05e+27) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t * (y / a) tmp = 0 if t <= -2.4e+60: tmp = t_1 elif t <= 2.25e-237: tmp = x elif t <= 2.8e-111: tmp = (y / a) * -z elif t <= 1.05e+27: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(t * Float64(y / a)) tmp = 0.0 if (t <= -2.4e+60) tmp = t_1; elseif (t <= 2.25e-237) tmp = x; elseif (t <= 2.8e-111) tmp = Float64(Float64(y / a) * Float64(-z)); elseif (t <= 1.05e+27) tmp = x; 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 <= -2.4e+60) tmp = t_1; elseif (t <= 2.25e-237) tmp = x; elseif (t <= 2.8e-111) tmp = (y / a) * -z; elseif (t <= 1.05e+27) tmp = x; 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, -2.4e+60], t$95$1, If[LessEqual[t, 2.25e-237], x, If[LessEqual[t, 2.8e-111], N[(N[(y / a), $MachinePrecision] * (-z)), $MachinePrecision], If[LessEqual[t, 1.05e+27], x, t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{y}{a}\\
\mathbf{if}\;t \leq -2.4 \cdot 10^{+60}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.25 \cdot 10^{-237}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 2.8 \cdot 10^{-111}:\\
\;\;\;\;\frac{y}{a} \cdot \left(-z\right)\\
\mathbf{elif}\;t \leq 1.05 \cdot 10^{+27}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.4e60 or 1.04999999999999997e27 < t Initial program 87.6%
associate-/l*90.5%
Simplified90.5%
Taylor expanded in y around 0 87.6%
associate-*l/98.1%
*-commutative98.1%
Simplified98.1%
Taylor expanded in t around inf 59.4%
associate-*r/66.5%
Simplified66.5%
if -2.4e60 < t < 2.25000000000000005e-237 or 2.79999999999999995e-111 < t < 1.04999999999999997e27Initial program 96.6%
associate-/l*99.1%
Simplified99.1%
Taylor expanded in x around inf 58.9%
if 2.25000000000000005e-237 < t < 2.79999999999999995e-111Initial program 87.2%
associate-/l*99.6%
Simplified99.6%
Taylor expanded in y around 0 87.2%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around inf 52.5%
associate-*l/65.3%
associate-*r*65.3%
*-commutative65.3%
associate-*r/65.3%
neg-mul-165.3%
Simplified65.3%
Final simplification62.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* t (/ y a))))
(if (<= t -4e+59)
t_1
(if (<= t 2.6e-238)
x
(if (<= t 1.85e-146) (* (/ z a) (- y)) (if (<= t 2.1e+25) x t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t * (y / a);
double tmp;
if (t <= -4e+59) {
tmp = t_1;
} else if (t <= 2.6e-238) {
tmp = x;
} else if (t <= 1.85e-146) {
tmp = (z / a) * -y;
} else if (t <= 2.1e+25) {
tmp = x;
} 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 <= (-4d+59)) then
tmp = t_1
else if (t <= 2.6d-238) then
tmp = x
else if (t <= 1.85d-146) then
tmp = (z / a) * -y
else if (t <= 2.1d+25) then
tmp = x
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 <= -4e+59) {
tmp = t_1;
} else if (t <= 2.6e-238) {
tmp = x;
} else if (t <= 1.85e-146) {
tmp = (z / a) * -y;
} else if (t <= 2.1e+25) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t * (y / a) tmp = 0 if t <= -4e+59: tmp = t_1 elif t <= 2.6e-238: tmp = x elif t <= 1.85e-146: tmp = (z / a) * -y elif t <= 2.1e+25: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(t * Float64(y / a)) tmp = 0.0 if (t <= -4e+59) tmp = t_1; elseif (t <= 2.6e-238) tmp = x; elseif (t <= 1.85e-146) tmp = Float64(Float64(z / a) * Float64(-y)); elseif (t <= 2.1e+25) tmp = x; 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 <= -4e+59) tmp = t_1; elseif (t <= 2.6e-238) tmp = x; elseif (t <= 1.85e-146) tmp = (z / a) * -y; elseif (t <= 2.1e+25) tmp = x; 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, -4e+59], t$95$1, If[LessEqual[t, 2.6e-238], x, If[LessEqual[t, 1.85e-146], N[(N[(z / a), $MachinePrecision] * (-y)), $MachinePrecision], If[LessEqual[t, 2.1e+25], x, t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \frac{y}{a}\\
\mathbf{if}\;t \leq -4 \cdot 10^{+59}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{-238}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 1.85 \cdot 10^{-146}:\\
\;\;\;\;\frac{z}{a} \cdot \left(-y\right)\\
\mathbf{elif}\;t \leq 2.1 \cdot 10^{+25}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.99999999999999989e59 or 2.0999999999999999e25 < t Initial program 87.6%
associate-/l*90.5%
Simplified90.5%
Taylor expanded in y around 0 87.6%
associate-*l/98.1%
*-commutative98.1%
Simplified98.1%
Taylor expanded in t around inf 59.4%
associate-*r/66.5%
Simplified66.5%
if -3.99999999999999989e59 < t < 2.6000000000000001e-238 or 1.84999999999999993e-146 < t < 2.0999999999999999e25Initial program 96.7%
associate-/l*99.1%
Simplified99.1%
Taylor expanded in x around inf 58.7%
if 2.6000000000000001e-238 < t < 1.84999999999999993e-146Initial program 84.5%
associate-/l*99.6%
Simplified99.6%
Taylor expanded in z around inf 52.9%
mul-1-neg52.9%
associate-/l*68.0%
distribute-rgt-neg-in68.0%
distribute-neg-frac268.0%
Simplified68.0%
Final simplification62.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -1.1e+167) (not (<= y 1.58e+65))) (* y (/ (- t z) a)) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.1e+167) || !(y <= 1.58e+65)) {
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 <= (-1.1d+167)) .or. (.not. (y <= 1.58d+65))) 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 <= -1.1e+167) || !(y <= 1.58e+65)) {
tmp = y * ((t - z) / a);
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -1.1e+167) or not (y <= 1.58e+65): 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 <= -1.1e+167) || !(y <= 1.58e+65)) tmp = Float64(y * Float64(Float64(t - z) / a)); else tmp = Float64(x + Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -1.1e+167) || ~((y <= 1.58e+65))) tmp = y * ((t - z) / a); else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -1.1e+167], N[Not[LessEqual[y, 1.58e+65]], $MachinePrecision]], N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{+167} \lor \neg \left(y \leq 1.58 \cdot 10^{+65}\right):\\
\;\;\;\;y \cdot \frac{t - z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if y < -1.10000000000000002e167 or 1.5800000000000001e65 < y Initial program 81.2%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around 0 68.7%
mul-1-neg68.7%
distribute-frac-neg268.7%
sub-neg68.7%
+-commutative68.7%
neg-sub068.7%
associate--r-68.7%
neg-sub068.7%
associate-*r/85.0%
distribute-neg-frac85.0%
distribute-neg-frac285.0%
remove-double-neg85.0%
Simplified85.0%
if -1.10000000000000002e167 < y < 1.5800000000000001e65Initial program 97.1%
associate-/l*93.1%
Simplified93.1%
Taylor expanded in z around 0 83.9%
associate-*r/83.9%
mul-1-neg83.9%
distribute-lft-neg-out83.9%
*-commutative83.9%
associate-/l*81.1%
distribute-neg-frac81.1%
distribute-neg-frac281.1%
Simplified81.1%
*-commutative81.1%
distribute-frac-neg281.1%
cancel-sign-sub81.1%
add-sqr-sqrt43.0%
sqrt-unprod60.4%
sqr-neg60.4%
sqrt-unprod23.1%
add-sqr-sqrt50.5%
*-commutative50.5%
+-commutative50.5%
*-commutative50.5%
div-inv50.5%
associate-*l*51.9%
add-sqr-sqrt24.0%
sqrt-unprod61.8%
sqr-neg61.8%
sqrt-unprod45.4%
add-sqr-sqrt85.1%
associate-/r/85.1%
clear-num85.1%
Applied egg-rr85.1%
Final simplification85.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -4e+79) (not (<= y 1.42e+66))) (* y (/ (- t z) a)) (+ x (/ (* t y) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -4e+79) || !(y <= 1.42e+66)) {
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 <= (-4d+79)) .or. (.not. (y <= 1.42d+66))) 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 <= -4e+79) || !(y <= 1.42e+66)) {
tmp = y * ((t - z) / a);
} else {
tmp = x + ((t * y) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -4e+79) or not (y <= 1.42e+66): 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 <= -4e+79) || !(y <= 1.42e+66)) 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 <= -4e+79) || ~((y <= 1.42e+66))) tmp = y * ((t - z) / a); else tmp = x + ((t * y) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -4e+79], N[Not[LessEqual[y, 1.42e+66]], $MachinePrecision]], 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 -4 \cdot 10^{+79} \lor \neg \left(y \leq 1.42 \cdot 10^{+66}\right):\\
\;\;\;\;y \cdot \frac{t - z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\end{array}
\end{array}
if y < -3.99999999999999987e79 or 1.4200000000000001e66 < y Initial program 80.6%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in x around 0 67.1%
mul-1-neg67.1%
distribute-frac-neg267.1%
sub-neg67.1%
+-commutative67.1%
neg-sub067.1%
associate--r-67.1%
neg-sub067.1%
associate-*r/83.6%
distribute-neg-frac83.6%
distribute-neg-frac283.6%
remove-double-neg83.6%
Simplified83.6%
if -3.99999999999999987e79 < y < 1.4200000000000001e66Initial program 99.8%
sub-neg99.8%
distribute-frac-neg299.8%
+-commutative99.8%
associate-/l*92.1%
fma-define92.1%
distribute-frac-neg292.1%
distribute-neg-frac92.1%
sub-neg92.1%
distribute-neg-in92.1%
remove-double-neg92.1%
+-commutative92.1%
sub-neg92.1%
Simplified92.1%
Taylor expanded in z around 0 86.1%
Final simplification85.1%
(FPCore (x y z t a) :precision binary64 (if (<= t -6e-23) (+ x (* t (/ y a))) (if (<= t 3e+67) (- x (* z (/ y a))) (+ x (/ t (/ a y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -6e-23) {
tmp = x + (t * (y / a));
} else if (t <= 3e+67) {
tmp = x - (z * (y / a));
} else {
tmp = x + (t / (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 <= (-6d-23)) then
tmp = x + (t * (y / a))
else if (t <= 3d+67) then
tmp = x - (z * (y / a))
else
tmp = x + (t / (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 <= -6e-23) {
tmp = x + (t * (y / a));
} else if (t <= 3e+67) {
tmp = x - (z * (y / a));
} else {
tmp = x + (t / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -6e-23: tmp = x + (t * (y / a)) elif t <= 3e+67: tmp = x - (z * (y / a)) else: tmp = x + (t / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -6e-23) tmp = Float64(x + Float64(t * Float64(y / a))); elseif (t <= 3e+67) tmp = Float64(x - Float64(z * Float64(y / a))); else tmp = Float64(x + Float64(t / Float64(a / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -6e-23) tmp = x + (t * (y / a)); elseif (t <= 3e+67) tmp = x - (z * (y / a)); else tmp = x + (t / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -6e-23], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3e+67], N[(x - N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6 \cdot 10^{-23}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{elif}\;t \leq 3 \cdot 10^{+67}:\\
\;\;\;\;x - z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if t < -6.00000000000000006e-23Initial program 90.8%
associate-/l*93.2%
Simplified93.2%
Taylor expanded in z around 0 81.3%
associate-*r/81.3%
mul-1-neg81.3%
distribute-lft-neg-out81.3%
*-commutative81.3%
associate-/l*82.4%
distribute-neg-frac82.4%
distribute-neg-frac282.4%
Simplified82.4%
*-commutative82.4%
distribute-frac-neg282.4%
cancel-sign-sub82.4%
add-sqr-sqrt43.2%
sqrt-unprod42.5%
sqr-neg42.5%
sqrt-unprod7.3%
add-sqr-sqrt25.8%
*-commutative25.8%
+-commutative25.8%
*-commutative25.8%
div-inv25.8%
associate-*l*27.2%
add-sqr-sqrt8.6%
sqrt-unprod43.9%
sqr-neg43.9%
sqrt-unprod46.0%
add-sqr-sqrt86.5%
associate-/r/86.6%
clear-num86.6%
Applied egg-rr86.6%
if -6.00000000000000006e-23 < t < 3.0000000000000001e67Initial program 94.3%
associate-/l*98.5%
Simplified98.5%
Taylor expanded in y around 0 94.3%
associate-*l/98.6%
*-commutative98.6%
Simplified98.6%
clear-num98.5%
un-div-inv99.2%
Applied egg-rr99.2%
Taylor expanded in z around inf 87.1%
*-commutative87.1%
associate-*r/92.6%
Simplified92.6%
if 3.0000000000000001e67 < t Initial program 86.2%
associate-/l*89.7%
Simplified89.7%
Taylor expanded in z around 0 84.4%
associate-*r/84.4%
mul-1-neg84.4%
distribute-lft-neg-out84.4%
*-commutative84.4%
associate-/l*89.7%
distribute-neg-frac89.7%
distribute-neg-frac289.7%
Simplified89.7%
*-commutative89.7%
distribute-frac-neg289.7%
cancel-sign-sub89.7%
add-sqr-sqrt54.2%
sqrt-unprod54.9%
sqr-neg54.9%
sqrt-unprod8.5%
add-sqr-sqrt23.4%
*-commutative23.4%
+-commutative23.4%
*-commutative23.4%
div-inv23.4%
associate-*l*26.4%
add-sqr-sqrt9.6%
sqrt-unprod58.1%
sqr-neg58.1%
sqrt-unprod58.4%
add-sqr-sqrt95.9%
associate-/r/95.8%
clear-num95.9%
Applied egg-rr95.9%
clear-num95.8%
div-inv95.9%
Applied egg-rr95.9%
Final simplification91.6%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.22e-23) (+ x (* t (/ y a))) (if (<= t 3e+56) (- x (* y (/ z a))) (+ x (/ t (/ a y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.22e-23) {
tmp = x + (t * (y / a));
} else if (t <= 3e+56) {
tmp = x - (y * (z / a));
} else {
tmp = x + (t / (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 <= (-2.22d-23)) then
tmp = x + (t * (y / a))
else if (t <= 3d+56) then
tmp = x - (y * (z / a))
else
tmp = x + (t / (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 <= -2.22e-23) {
tmp = x + (t * (y / a));
} else if (t <= 3e+56) {
tmp = x - (y * (z / a));
} else {
tmp = x + (t / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -2.22e-23: tmp = x + (t * (y / a)) elif t <= 3e+56: tmp = x - (y * (z / a)) else: tmp = x + (t / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.22e-23) tmp = Float64(x + Float64(t * Float64(y / a))); elseif (t <= 3e+56) tmp = Float64(x - Float64(y * Float64(z / a))); else tmp = Float64(x + Float64(t / Float64(a / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -2.22e-23) tmp = x + (t * (y / a)); elseif (t <= 3e+56) tmp = x - (y * (z / a)); else tmp = x + (t / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.22e-23], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3e+56], N[(x - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.22 \cdot 10^{-23}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\mathbf{elif}\;t \leq 3 \cdot 10^{+56}:\\
\;\;\;\;x - y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if t < -2.22e-23Initial program 90.8%
associate-/l*93.2%
Simplified93.2%
Taylor expanded in z around 0 81.3%
associate-*r/81.3%
mul-1-neg81.3%
distribute-lft-neg-out81.3%
*-commutative81.3%
associate-/l*82.4%
distribute-neg-frac82.4%
distribute-neg-frac282.4%
Simplified82.4%
*-commutative82.4%
distribute-frac-neg282.4%
cancel-sign-sub82.4%
add-sqr-sqrt43.2%
sqrt-unprod42.5%
sqr-neg42.5%
sqrt-unprod7.3%
add-sqr-sqrt25.8%
*-commutative25.8%
+-commutative25.8%
*-commutative25.8%
div-inv25.8%
associate-*l*27.2%
add-sqr-sqrt8.6%
sqrt-unprod43.9%
sqr-neg43.9%
sqrt-unprod46.0%
add-sqr-sqrt86.5%
associate-/r/86.6%
clear-num86.6%
Applied egg-rr86.6%
if -2.22e-23 < t < 3.00000000000000006e56Initial program 94.3%
associate-/l*98.5%
Simplified98.5%
Taylor expanded in z around inf 87.1%
associate-/l*91.2%
Simplified91.2%
if 3.00000000000000006e56 < t Initial program 86.2%
associate-/l*89.7%
Simplified89.7%
Taylor expanded in z around 0 84.4%
associate-*r/84.4%
mul-1-neg84.4%
distribute-lft-neg-out84.4%
*-commutative84.4%
associate-/l*89.7%
distribute-neg-frac89.7%
distribute-neg-frac289.7%
Simplified89.7%
*-commutative89.7%
distribute-frac-neg289.7%
cancel-sign-sub89.7%
add-sqr-sqrt54.2%
sqrt-unprod54.9%
sqr-neg54.9%
sqrt-unprod8.5%
add-sqr-sqrt23.4%
*-commutative23.4%
+-commutative23.4%
*-commutative23.4%
div-inv23.4%
associate-*l*26.4%
add-sqr-sqrt9.6%
sqrt-unprod58.1%
sqr-neg58.1%
sqrt-unprod58.4%
add-sqr-sqrt95.9%
associate-/r/95.8%
clear-num95.9%
Applied egg-rr95.9%
clear-num95.8%
div-inv95.9%
Applied egg-rr95.9%
Final simplification90.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -5e+67) (not (<= t 8e+26))) (* t (/ y a)) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5e+67) || !(t <= 8e+26)) {
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 <= (-5d+67)) .or. (.not. (t <= 8d+26))) 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 <= -5e+67) || !(t <= 8e+26)) {
tmp = t * (y / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -5e+67) or not (t <= 8e+26): tmp = t * (y / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -5e+67) || !(t <= 8e+26)) 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 ((t <= -5e+67) || ~((t <= 8e+26))) tmp = t * (y / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -5e+67], N[Not[LessEqual[t, 8e+26]], $MachinePrecision]], N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{+67} \lor \neg \left(t \leq 8 \cdot 10^{+26}\right):\\
\;\;\;\;t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -4.99999999999999976e67 or 8.00000000000000038e26 < t Initial program 87.6%
associate-/l*90.5%
Simplified90.5%
Taylor expanded in y around 0 87.6%
associate-*l/98.1%
*-commutative98.1%
Simplified98.1%
Taylor expanded in t around inf 59.4%
associate-*r/66.5%
Simplified66.5%
if -4.99999999999999976e67 < t < 8.00000000000000038e26Initial program 95.2%
associate-/l*99.2%
Simplified99.2%
Taylor expanded in x around inf 55.3%
Final simplification60.3%
(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 91.8%
associate-/l*95.3%
Simplified95.3%
Taylor expanded in y around 0 91.8%
associate-*l/98.0%
*-commutative98.0%
Simplified98.0%
Final simplification98.0%
(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 91.8%
associate-/l*95.3%
Simplified95.3%
Final simplification95.3%
(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 91.8%
associate-/l*95.3%
Simplified95.3%
Taylor expanded in x around inf 40.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ a (- z t))))
(if (< y -1.0761266216389975e-10)
(- x (/ 1.0 (/ t_1 y)))
(if (< y 2.894426862792089e-49)
(- x (/ (* y (- z t)) a))
(- x (/ y t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a / (z - t);
double tmp;
if (y < -1.0761266216389975e-10) {
tmp = x - (1.0 / (t_1 / y));
} else if (y < 2.894426862792089e-49) {
tmp = x - ((y * (z - t)) / a);
} else {
tmp = x - (y / t_1);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = a / (z - t)
if (y < (-1.0761266216389975d-10)) then
tmp = x - (1.0d0 / (t_1 / y))
else if (y < 2.894426862792089d-49) then
tmp = x - ((y * (z - t)) / a)
else
tmp = x - (y / t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = a / (z - t);
double tmp;
if (y < -1.0761266216389975e-10) {
tmp = x - (1.0 / (t_1 / y));
} else if (y < 2.894426862792089e-49) {
tmp = x - ((y * (z - t)) / a);
} else {
tmp = x - (y / t_1);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a / (z - t) tmp = 0 if y < -1.0761266216389975e-10: tmp = x - (1.0 / (t_1 / y)) elif y < 2.894426862792089e-49: tmp = x - ((y * (z - t)) / a) else: tmp = x - (y / t_1) return tmp
function code(x, y, z, t, a) t_1 = Float64(a / Float64(z - t)) tmp = 0.0 if (y < -1.0761266216389975e-10) tmp = Float64(x - Float64(1.0 / Float64(t_1 / y))); elseif (y < 2.894426862792089e-49) tmp = Float64(x - Float64(Float64(y * Float64(z - t)) / a)); else tmp = Float64(x - Float64(y / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a / (z - t); tmp = 0.0; if (y < -1.0761266216389975e-10) tmp = x - (1.0 / (t_1 / y)); elseif (y < 2.894426862792089e-49) tmp = x - ((y * (z - t)) / a); else tmp = x - (y / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[Less[y, -1.0761266216389975e-10], N[(x - N[(1.0 / N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Less[y, 2.894426862792089e-49], N[(x - N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a}{z - t}\\
\mathbf{if}\;y < -1.0761266216389975 \cdot 10^{-10}:\\
\;\;\;\;x - \frac{1}{\frac{t\_1}{y}}\\
\mathbf{elif}\;y < 2.894426862792089 \cdot 10^{-49}:\\
\;\;\;\;x - \frac{y \cdot \left(z - t\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{t\_1}\\
\end{array}
\end{array}
herbie shell --seed 2024100
(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)))