
(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 (let* ((t_1 (/ (* y (- z t)) a)) (t_2 (* (/ y a) (- z t)))) (if (<= t_1 -2e+257) t_2 (if (<= t_1 4e+274) (+ x t_1) t_2))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / a;
double t_2 = (y / a) * (z - t);
double tmp;
if (t_1 <= -2e+257) {
tmp = t_2;
} else if (t_1 <= 4e+274) {
tmp = x + 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 = (y * (z - t)) / a
t_2 = (y / a) * (z - t)
if (t_1 <= (-2d+257)) then
tmp = t_2
else if (t_1 <= 4d+274) then
tmp = x + 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 = (y * (z - t)) / a;
double t_2 = (y / a) * (z - t);
double tmp;
if (t_1 <= -2e+257) {
tmp = t_2;
} else if (t_1 <= 4e+274) {
tmp = x + t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (z - t)) / a t_2 = (y / a) * (z - t) tmp = 0 if t_1 <= -2e+257: tmp = t_2 elif t_1 <= 4e+274: tmp = x + t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(z - t)) / a) t_2 = Float64(Float64(y / a) * Float64(z - t)) tmp = 0.0 if (t_1 <= -2e+257) tmp = t_2; elseif (t_1 <= 4e+274) tmp = Float64(x + t_1); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * (z - t)) / a; t_2 = (y / a) * (z - t); tmp = 0.0; if (t_1 <= -2e+257) tmp = t_2; elseif (t_1 <= 4e+274) tmp = x + t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y / a), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+257], t$95$2, If[LessEqual[t$95$1, 4e+274], N[(x + t$95$1), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{a}\\
t_2 := \frac{y}{a} \cdot \left(z - t\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+257}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+274}:\\
\;\;\;\;x + t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) a) < -2.00000000000000006e257 or 3.99999999999999969e274 < (/.f64 (*.f64 y (-.f64 z t)) a) Initial program 74.2%
*-commutativeN/A
associate-/l*N/A
cancel-sign-subN/A
sub0-negN/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
sub-negN/A
*-commutativeN/A
--lowering--.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6474.2%
Simplified74.2%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6499.9%
Applied egg-rr99.9%
associate-/r/N/A
--lowering--.f64N/A
associate-/r/N/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f6499.9%
Applied egg-rr99.9%
Taylor expanded in x around 0
associate-*r/N/A
neg-mul-1N/A
sub-negN/A
mul-1-negN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
distribute-neg-inN/A
sub-negN/A
div-subN/A
distribute-lft-neg-inN/A
neg-mul-1N/A
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
associate-*r/N/A
distribute-rgt-out--N/A
sub-negN/A
mul-1-negN/A
distribute-lft-inN/A
mul-1-negN/A
Simplified93.4%
if -2.00000000000000006e257 < (/.f64 (*.f64 y (-.f64 z t)) a) < 3.99999999999999969e274Initial program 99.2%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (* y (- z t)) a)) (t_2 (* (/ y a) (- z t)))) (if (<= t_1 -1e+32) t_2 (if (<= t_1 1e+58) (+ x (/ (* z y) a)) t_2))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / a;
double t_2 = (y / a) * (z - t);
double tmp;
if (t_1 <= -1e+32) {
tmp = t_2;
} else if (t_1 <= 1e+58) {
tmp = x + ((z * y) / a);
} 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 = (y * (z - t)) / a
t_2 = (y / a) * (z - t)
if (t_1 <= (-1d+32)) then
tmp = t_2
else if (t_1 <= 1d+58) then
tmp = x + ((z * y) / a)
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 = (y * (z - t)) / a;
double t_2 = (y / a) * (z - t);
double tmp;
if (t_1 <= -1e+32) {
tmp = t_2;
} else if (t_1 <= 1e+58) {
tmp = x + ((z * y) / a);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (z - t)) / a t_2 = (y / a) * (z - t) tmp = 0 if t_1 <= -1e+32: tmp = t_2 elif t_1 <= 1e+58: tmp = x + ((z * y) / a) else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(z - t)) / a) t_2 = Float64(Float64(y / a) * Float64(z - t)) tmp = 0.0 if (t_1 <= -1e+32) tmp = t_2; elseif (t_1 <= 1e+58) tmp = Float64(x + Float64(Float64(z * y) / a)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * (z - t)) / a; t_2 = (y / a) * (z - t); tmp = 0.0; if (t_1 <= -1e+32) tmp = t_2; elseif (t_1 <= 1e+58) tmp = x + ((z * y) / a); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y / a), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+32], t$95$2, If[LessEqual[t$95$1, 1e+58], N[(x + N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{a}\\
t_2 := \frac{y}{a} \cdot \left(z - t\right)\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+32}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{+58}:\\
\;\;\;\;x + \frac{z \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) a) < -1.00000000000000005e32 or 9.99999999999999944e57 < (/.f64 (*.f64 y (-.f64 z t)) a) Initial program 84.9%
*-commutativeN/A
associate-/l*N/A
cancel-sign-subN/A
sub0-negN/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
sub-negN/A
*-commutativeN/A
--lowering--.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6484.9%
Simplified84.9%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6497.3%
Applied egg-rr97.3%
associate-/r/N/A
--lowering--.f64N/A
associate-/r/N/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f6497.5%
Applied egg-rr97.5%
Taylor expanded in x around 0
associate-*r/N/A
neg-mul-1N/A
sub-negN/A
mul-1-negN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
distribute-neg-inN/A
sub-negN/A
div-subN/A
distribute-lft-neg-inN/A
neg-mul-1N/A
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
associate-*r/N/A
distribute-rgt-out--N/A
sub-negN/A
mul-1-negN/A
distribute-lft-inN/A
mul-1-negN/A
Simplified86.5%
if -1.00000000000000005e32 < (/.f64 (*.f64 y (-.f64 z t)) a) < 9.99999999999999944e57Initial program 99.0%
*-commutativeN/A
associate-/l*N/A
cancel-sign-subN/A
sub0-negN/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
sub-negN/A
*-commutativeN/A
--lowering--.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6499.0%
Simplified99.0%
Taylor expanded in t around 0
sub-negN/A
mul-1-negN/A
remove-double-negN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6490.6%
Simplified90.6%
Final simplification88.2%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (/ y a) (- z t)))) (if (<= t -7.2e+225) t_1 (if (<= t 4.4e+60) (+ x (* z (/ y a))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y / a) * (z - t);
double tmp;
if (t <= -7.2e+225) {
tmp = t_1;
} else if (t <= 4.4e+60) {
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 = (y / a) * (z - t)
if (t <= (-7.2d+225)) then
tmp = t_1
else if (t <= 4.4d+60) 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 = (y / a) * (z - t);
double tmp;
if (t <= -7.2e+225) {
tmp = t_1;
} else if (t <= 4.4e+60) {
tmp = x + (z * (y / a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y / a) * (z - t) tmp = 0 if t <= -7.2e+225: tmp = t_1 elif t <= 4.4e+60: tmp = x + (z * (y / a)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y / a) * Float64(z - t)) tmp = 0.0 if (t <= -7.2e+225) tmp = t_1; elseif (t <= 4.4e+60) 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 = (y / a) * (z - t); tmp = 0.0; if (t <= -7.2e+225) tmp = t_1; elseif (t <= 4.4e+60) 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[(N[(y / a), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -7.2e+225], t$95$1, If[LessEqual[t, 4.4e+60], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{a} \cdot \left(z - t\right)\\
\mathbf{if}\;t \leq -7.2 \cdot 10^{+225}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.4 \cdot 10^{+60}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -7.1999999999999996e225 or 4.39999999999999992e60 < t Initial program 85.9%
*-commutativeN/A
associate-/l*N/A
cancel-sign-subN/A
sub0-negN/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
sub-negN/A
*-commutativeN/A
--lowering--.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6485.9%
Simplified85.9%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6497.9%
Applied egg-rr97.9%
associate-/r/N/A
--lowering--.f64N/A
associate-/r/N/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f6497.7%
Applied egg-rr97.7%
Taylor expanded in x around 0
associate-*r/N/A
neg-mul-1N/A
sub-negN/A
mul-1-negN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
distribute-neg-inN/A
sub-negN/A
div-subN/A
distribute-lft-neg-inN/A
neg-mul-1N/A
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
associate-*r/N/A
distribute-rgt-out--N/A
sub-negN/A
mul-1-negN/A
distribute-lft-inN/A
mul-1-negN/A
Simplified82.3%
if -7.1999999999999996e225 < t < 4.39999999999999992e60Initial program 92.4%
*-commutativeN/A
associate-/l*N/A
cancel-sign-subN/A
sub0-negN/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
sub-negN/A
*-commutativeN/A
--lowering--.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6492.4%
Simplified92.4%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6496.7%
Applied egg-rr96.7%
associate-/r/N/A
--lowering--.f64N/A
associate-/r/N/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f6497.0%
Applied egg-rr97.0%
Taylor expanded in t around 0
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-*r/N/A
*-lowering-*.f64N/A
/-lowering-/.f6482.8%
Simplified82.8%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.36e+90) x (if (<= a 1.65e+107) (* (/ y a) (- z t)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.36e+90) {
tmp = x;
} else if (a <= 1.65e+107) {
tmp = (y / a) * (z - t);
} 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 <= (-1.36d+90)) then
tmp = x
else if (a <= 1.65d+107) then
tmp = (y / a) * (z - t)
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 <= -1.36e+90) {
tmp = x;
} else if (a <= 1.65e+107) {
tmp = (y / a) * (z - t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.36e+90: tmp = x elif a <= 1.65e+107: tmp = (y / a) * (z - t) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.36e+90) tmp = x; elseif (a <= 1.65e+107) tmp = Float64(Float64(y / a) * Float64(z - t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.36e+90) tmp = x; elseif (a <= 1.65e+107) tmp = (y / a) * (z - t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.36e+90], x, If[LessEqual[a, 1.65e+107], N[(N[(y / a), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.36 \cdot 10^{+90}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.65 \cdot 10^{+107}:\\
\;\;\;\;\frac{y}{a} \cdot \left(z - t\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.3600000000000001e90 or 1.65000000000000016e107 < a Initial program 77.8%
*-commutativeN/A
associate-/l*N/A
cancel-sign-subN/A
sub0-negN/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
sub-negN/A
*-commutativeN/A
--lowering--.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6477.8%
Simplified77.8%
Taylor expanded in x around inf
Simplified68.2%
if -1.3600000000000001e90 < a < 1.65000000000000016e107Initial program 97.1%
*-commutativeN/A
associate-/l*N/A
cancel-sign-subN/A
sub0-negN/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
sub-negN/A
*-commutativeN/A
--lowering--.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6497.1%
Simplified97.1%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6497.5%
Applied egg-rr97.5%
associate-/r/N/A
--lowering--.f64N/A
associate-/r/N/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f6497.8%
Applied egg-rr97.8%
Taylor expanded in x around 0
associate-*r/N/A
neg-mul-1N/A
sub-negN/A
mul-1-negN/A
distribute-rgt-inN/A
associate-*r*N/A
*-commutativeN/A
distribute-neg-inN/A
sub-negN/A
div-subN/A
distribute-lft-neg-inN/A
neg-mul-1N/A
associate-*r/N/A
*-commutativeN/A
associate-*r*N/A
associate-*r/N/A
distribute-rgt-out--N/A
sub-negN/A
mul-1-negN/A
distribute-lft-inN/A
mul-1-negN/A
Simplified75.5%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.3e+35) x (if (<= a 4.4e-62) (/ (* z y) a) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.3e+35) {
tmp = x;
} else if (a <= 4.4e-62) {
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 (a <= (-2.3d+35)) then
tmp = x
else if (a <= 4.4d-62) 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 (a <= -2.3e+35) {
tmp = x;
} else if (a <= 4.4e-62) {
tmp = (z * y) / a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.3e+35: tmp = x elif a <= 4.4e-62: tmp = (z * y) / a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.3e+35) tmp = x; elseif (a <= 4.4e-62) tmp = Float64(Float64(z * y) / a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -2.3e+35) tmp = x; elseif (a <= 4.4e-62) tmp = (z * y) / a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.3e+35], x, If[LessEqual[a, 4.4e-62], N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.3 \cdot 10^{+35}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 4.4 \cdot 10^{-62}:\\
\;\;\;\;\frac{z \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -2.2999999999999998e35 or 4.40000000000000035e-62 < a Initial program 83.5%
*-commutativeN/A
associate-/l*N/A
cancel-sign-subN/A
sub0-negN/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
sub-negN/A
*-commutativeN/A
--lowering--.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6483.5%
Simplified83.5%
Taylor expanded in x around inf
Simplified56.0%
if -2.2999999999999998e35 < a < 4.40000000000000035e-62Initial program 99.0%
*-commutativeN/A
associate-/l*N/A
cancel-sign-subN/A
sub0-negN/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
sub-negN/A
*-commutativeN/A
--lowering--.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6499.0%
Simplified99.0%
Taylor expanded in z around inf
/-lowering-/.f64N/A
*-lowering-*.f6454.1%
Simplified54.1%
Final simplification55.1%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.2e+32) x (if (<= a 5.5e-62) (/ z (/ a y)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.2e+32) {
tmp = x;
} else if (a <= 5.5e-62) {
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 (a <= (-1.2d+32)) then
tmp = x
else if (a <= 5.5d-62) 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 (a <= -1.2e+32) {
tmp = x;
} else if (a <= 5.5e-62) {
tmp = z / (a / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.2e+32: tmp = x elif a <= 5.5e-62: tmp = z / (a / y) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.2e+32) tmp = x; elseif (a <= 5.5e-62) tmp = 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 (a <= -1.2e+32) tmp = x; elseif (a <= 5.5e-62) tmp = z / (a / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.2e+32], x, If[LessEqual[a, 5.5e-62], N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.2 \cdot 10^{+32}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 5.5 \cdot 10^{-62}:\\
\;\;\;\;\frac{z}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.19999999999999996e32 or 5.50000000000000022e-62 < a Initial program 83.5%
*-commutativeN/A
associate-/l*N/A
cancel-sign-subN/A
sub0-negN/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
sub-negN/A
*-commutativeN/A
--lowering--.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6483.5%
Simplified83.5%
Taylor expanded in x around inf
Simplified56.0%
if -1.19999999999999996e32 < a < 5.50000000000000022e-62Initial program 99.0%
*-commutativeN/A
associate-/l*N/A
cancel-sign-subN/A
sub0-negN/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
sub-negN/A
*-commutativeN/A
--lowering--.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6499.0%
Simplified99.0%
Taylor expanded in z around inf
/-lowering-/.f64N/A
*-lowering-*.f6454.1%
Simplified54.1%
clear-numN/A
associate-/r*N/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f6453.1%
Applied egg-rr53.1%
(FPCore (x y z t a) :precision binary64 (if (<= a -2.5e+32) x (if (<= a 1.05e-61) (* z (/ y a)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.5e+32) {
tmp = x;
} else if (a <= 1.05e-61) {
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 (a <= (-2.5d+32)) then
tmp = x
else if (a <= 1.05d-61) 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 (a <= -2.5e+32) {
tmp = x;
} else if (a <= 1.05e-61) {
tmp = z * (y / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.5e+32: tmp = x elif a <= 1.05e-61: tmp = z * (y / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.5e+32) tmp = x; elseif (a <= 1.05e-61) tmp = Float64(z * Float64(y / a)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -2.5e+32) tmp = x; elseif (a <= 1.05e-61) tmp = z * (y / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.5e+32], x, If[LessEqual[a, 1.05e-61], N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.5 \cdot 10^{+32}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.05 \cdot 10^{-61}:\\
\;\;\;\;z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -2.4999999999999999e32 or 1.05e-61 < a Initial program 83.5%
*-commutativeN/A
associate-/l*N/A
cancel-sign-subN/A
sub0-negN/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
sub-negN/A
*-commutativeN/A
--lowering--.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6483.5%
Simplified83.5%
Taylor expanded in x around inf
Simplified56.0%
if -2.4999999999999999e32 < a < 1.05e-61Initial program 99.0%
*-commutativeN/A
associate-/l*N/A
cancel-sign-subN/A
sub0-negN/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
sub-negN/A
*-commutativeN/A
--lowering--.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6499.0%
Simplified99.0%
Taylor expanded in z around inf
/-lowering-/.f64N/A
*-lowering-*.f6454.1%
Simplified54.1%
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6452.8%
Applied egg-rr52.8%
(FPCore (x y z t a) :precision binary64 (+ x (/ (- z t) (/ a y))))
double code(double x, double y, double z, double t, double a) {
return x + ((z - t) / (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 + ((z - t) / (a / y))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((z - t) / (a / y));
}
def code(x, y, z, t, a): return x + ((z - t) / (a / y))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(z - t) / Float64(a / y))) end
function tmp = code(x, y, z, t, a) tmp = x + ((z - t) / (a / y)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(z - t), $MachinePrecision] / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{z - t}{\frac{a}{y}}
\end{array}
Initial program 90.7%
*-commutativeN/A
associate-/l*N/A
cancel-sign-subN/A
sub0-negN/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
sub-negN/A
*-commutativeN/A
--lowering--.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6490.7%
Simplified90.7%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6497.0%
Applied egg-rr97.0%
associate-/r/N/A
--lowering--.f64N/A
associate-/r/N/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f6497.1%
Applied egg-rr97.1%
Final simplification97.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(Float64(y / 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[(N[(y / a), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{a} \cdot \left(z - t\right)
\end{array}
Initial program 90.7%
*-commutativeN/A
associate-/l*N/A
cancel-sign-subN/A
sub0-negN/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
sub-negN/A
*-commutativeN/A
--lowering--.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6490.7%
Simplified90.7%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6497.0%
Applied egg-rr97.0%
Final simplification97.0%
(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 90.7%
*-commutativeN/A
associate-/l*N/A
cancel-sign-subN/A
sub0-negN/A
associate-+l-N/A
neg-sub0N/A
+-commutativeN/A
sub-negN/A
*-commutativeN/A
--lowering--.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6490.7%
Simplified90.7%
Taylor expanded in x around inf
Simplified38.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ a (- z t))))
(if (< y -1.0761266216389975e-10)
(+ x (/ 1.0 (/ t_1 y)))
(if (< y 2.894426862792089e-49)
(+ x (/ (* y (- z t)) a))
(+ x (/ y t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a / (z - t);
double tmp;
if (y < -1.0761266216389975e-10) {
tmp = x + (1.0 / (t_1 / y));
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) / a);
} else {
tmp = x + (y / t_1);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = a / (z - t)
if (y < (-1.0761266216389975d-10)) then
tmp = x + (1.0d0 / (t_1 / y))
else if (y < 2.894426862792089d-49) then
tmp = x + ((y * (z - t)) / a)
else
tmp = x + (y / t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = a / (z - t);
double tmp;
if (y < -1.0761266216389975e-10) {
tmp = x + (1.0 / (t_1 / y));
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) / a);
} else {
tmp = x + (y / t_1);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a / (z - t) tmp = 0 if y < -1.0761266216389975e-10: tmp = x + (1.0 / (t_1 / y)) elif y < 2.894426862792089e-49: tmp = x + ((y * (z - t)) / a) else: tmp = x + (y / t_1) return tmp
function code(x, y, z, t, a) t_1 = Float64(a / Float64(z - t)) tmp = 0.0 if (y < -1.0761266216389975e-10) tmp = Float64(x + Float64(1.0 / Float64(t_1 / y))); elseif (y < 2.894426862792089e-49) tmp = Float64(x + Float64(Float64(y * Float64(z - t)) / a)); else tmp = Float64(x + Float64(y / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a / (z - t); tmp = 0.0; if (y < -1.0761266216389975e-10) tmp = x + (1.0 / (t_1 / y)); elseif (y < 2.894426862792089e-49) tmp = x + ((y * (z - t)) / a); else tmp = x + (y / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[Less[y, -1.0761266216389975e-10], N[(x + N[(1.0 / N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Less[y, 2.894426862792089e-49], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a}{z - t}\\
\mathbf{if}\;y < -1.0761266216389975 \cdot 10^{-10}:\\
\;\;\;\;x + \frac{1}{\frac{t\_1}{y}}\\
\mathbf{elif}\;y < 2.894426862792089 \cdot 10^{-49}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{t\_1}\\
\end{array}
\end{array}
herbie shell --seed 2024149
(FPCore (x y z t a)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, E"
:precision binary64
:alt
(! :herbie-platform default (if (< y -430450648655599/4000000000000000000000000) (+ x (/ 1 (/ (/ a (- z t)) y))) (if (< y 2894426862792089/10000000000000000000000000000000000000000000000000000000000000000) (+ x (/ (* y (- z t)) a)) (+ x (/ y (/ a (- z t)))))))
(+ x (/ (* y (- z t)) a)))