
(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 14 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 (<= y -1.9e+95) (+ x (/ y (/ a (- z t)))) (if (<= y 1.6e-121) (+ x (/ (* y (- z t)) a)) (fma y (/ (- z t) a) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.9e+95) {
tmp = x + (y / (a / (z - t)));
} else if (y <= 1.6e-121) {
tmp = x + ((y * (z - t)) / a);
} else {
tmp = fma(y, ((z - t) / a), x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.9e+95) tmp = Float64(x + Float64(y / Float64(a / Float64(z - t)))); elseif (y <= 1.6e-121) tmp = Float64(x + Float64(Float64(y * Float64(z - t)) / a)); else tmp = fma(y, Float64(Float64(z - t) / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.9e+95], N[(x + N[(y / N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.6e-121], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.9 \cdot 10^{+95}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z - t}}\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{-121}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{a}, x\right)\\
\end{array}
\end{array}
if y < -1.9e95Initial program 74.2%
associate-/l*99.8%
Simplified99.8%
clear-num99.7%
un-div-inv99.8%
Applied egg-rr99.8%
if -1.9e95 < y < 1.60000000000000009e-121Initial program 99.9%
if 1.60000000000000009e-121 < y Initial program 94.0%
+-commutative94.0%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t a)
:precision binary64
(if (<= a -3.6e-31)
x
(if (<= a 1.85e-240)
(/ (* y z) a)
(if (<= a 1.15e+42) (/ (- y) (/ a t)) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.6e-31) {
tmp = x;
} else if (a <= 1.85e-240) {
tmp = (y * z) / a;
} else if (a <= 1.15e+42) {
tmp = -y / (a / 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 <= (-3.6d-31)) then
tmp = x
else if (a <= 1.85d-240) then
tmp = (y * z) / a
else if (a <= 1.15d+42) then
tmp = -y / (a / 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 <= -3.6e-31) {
tmp = x;
} else if (a <= 1.85e-240) {
tmp = (y * z) / a;
} else if (a <= 1.15e+42) {
tmp = -y / (a / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -3.6e-31: tmp = x elif a <= 1.85e-240: tmp = (y * z) / a elif a <= 1.15e+42: tmp = -y / (a / t) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3.6e-31) tmp = x; elseif (a <= 1.85e-240) tmp = Float64(Float64(y * z) / a); elseif (a <= 1.15e+42) tmp = Float64(Float64(-y) / Float64(a / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -3.6e-31) tmp = x; elseif (a <= 1.85e-240) tmp = (y * z) / a; elseif (a <= 1.15e+42) tmp = -y / (a / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3.6e-31], x, If[LessEqual[a, 1.85e-240], N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[a, 1.15e+42], N[((-y) / N[(a / t), $MachinePrecision]), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.6 \cdot 10^{-31}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.85 \cdot 10^{-240}:\\
\;\;\;\;\frac{y \cdot z}{a}\\
\mathbf{elif}\;a \leq 1.15 \cdot 10^{+42}:\\
\;\;\;\;\frac{-y}{\frac{a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -3.60000000000000004e-31 or 1.15e42 < a Initial program 87.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around inf 63.8%
if -3.60000000000000004e-31 < a < 1.8500000000000001e-240Initial program 99.9%
associate-/l*83.5%
Simplified83.5%
Taylor expanded in y around inf 74.2%
associate--l+74.2%
div-sub78.2%
Simplified78.2%
Taylor expanded in z around inf 50.0%
*-commutative50.0%
associate-*l/54.2%
Applied egg-rr54.2%
if 1.8500000000000001e-240 < a < 1.15e42Initial program 99.8%
associate-/l*95.0%
Simplified95.0%
Taylor expanded in y around inf 88.0%
associate--l+88.0%
div-sub89.9%
Simplified89.9%
Taylor expanded in t around inf 51.5%
mul-1-neg51.5%
distribute-neg-frac251.5%
Simplified51.5%
distribute-frac-neg251.5%
distribute-rgt-neg-out51.5%
clear-num51.5%
un-div-inv52.3%
Applied egg-rr52.3%
Final simplification58.5%
(FPCore (x y z t a)
:precision binary64
(if (<= a -5.8e-32)
x
(if (<= a 2.2e-263)
(/ (* y z) a)
(if (<= a 1.05e+43) (/ (* y (- t)) a) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -5.8e-32) {
tmp = x;
} else if (a <= 2.2e-263) {
tmp = (y * z) / a;
} else if (a <= 1.05e+43) {
tmp = (y * -t) / 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 <= (-5.8d-32)) then
tmp = x
else if (a <= 2.2d-263) then
tmp = (y * z) / a
else if (a <= 1.05d+43) then
tmp = (y * -t) / 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 <= -5.8e-32) {
tmp = x;
} else if (a <= 2.2e-263) {
tmp = (y * z) / a;
} else if (a <= 1.05e+43) {
tmp = (y * -t) / a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -5.8e-32: tmp = x elif a <= 2.2e-263: tmp = (y * z) / a elif a <= 1.05e+43: tmp = (y * -t) / a else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -5.8e-32) tmp = x; elseif (a <= 2.2e-263) tmp = Float64(Float64(y * z) / a); elseif (a <= 1.05e+43) tmp = Float64(Float64(y * Float64(-t)) / a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -5.8e-32) tmp = x; elseif (a <= 2.2e-263) tmp = (y * z) / a; elseif (a <= 1.05e+43) tmp = (y * -t) / a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -5.8e-32], x, If[LessEqual[a, 2.2e-263], N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[a, 1.05e+43], N[(N[(y * (-t)), $MachinePrecision] / a), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.8 \cdot 10^{-32}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 2.2 \cdot 10^{-263}:\\
\;\;\;\;\frac{y \cdot z}{a}\\
\mathbf{elif}\;a \leq 1.05 \cdot 10^{+43}:\\
\;\;\;\;\frac{y \cdot \left(-t\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -5.79999999999999991e-32 or 1.05000000000000001e43 < a Initial program 87.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around inf 63.8%
if -5.79999999999999991e-32 < a < 2.2e-263Initial program 99.9%
associate-/l*83.8%
Simplified83.8%
Taylor expanded in y around inf 75.5%
associate--l+75.5%
div-sub78.3%
Simplified78.3%
Taylor expanded in z around inf 50.0%
*-commutative50.0%
associate-*l/54.4%
Applied egg-rr54.4%
if 2.2e-263 < a < 1.05000000000000001e43Initial program 99.8%
associate-/l*93.8%
Simplified93.8%
Taylor expanded in y around inf 85.6%
associate--l+85.6%
div-sub89.1%
Simplified89.1%
Taylor expanded in t around inf 49.9%
mul-1-neg49.9%
distribute-neg-frac249.9%
Simplified49.9%
*-commutative49.9%
distribute-frac-neg249.9%
distribute-frac-neg49.9%
associate-*l/53.0%
Applied egg-rr53.0%
Final simplification58.7%
(FPCore (x y z t a) :precision binary64 (if (<= y -5e+95) (+ x (/ y (/ a (- z t)))) (if (<= y 1.6e-121) (+ x (/ (* y (- z t)) a)) (+ x (* y (/ (- z t) a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -5e+95) {
tmp = x + (y / (a / (z - t)));
} else if (y <= 1.6e-121) {
tmp = x + ((y * (z - t)) / 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 (y <= (-5d+95)) then
tmp = x + (y / (a / (z - t)))
else if (y <= 1.6d-121) then
tmp = x + ((y * (z - t)) / 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 (y <= -5e+95) {
tmp = x + (y / (a / (z - t)));
} else if (y <= 1.6e-121) {
tmp = x + ((y * (z - t)) / a);
} else {
tmp = x + (y * ((z - t) / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -5e+95: tmp = x + (y / (a / (z - t))) elif y <= 1.6e-121: tmp = x + ((y * (z - t)) / a) else: tmp = x + (y * ((z - t) / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -5e+95) tmp = Float64(x + Float64(y / Float64(a / Float64(z - t)))); elseif (y <= 1.6e-121) tmp = Float64(x + Float64(Float64(y * Float64(z - t)) / 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 (y <= -5e+95) tmp = x + (y / (a / (z - t))); elseif (y <= 1.6e-121) tmp = x + ((y * (z - t)) / a); else tmp = x + (y * ((z - t) / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -5e+95], N[(x + N[(y / N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.6e-121], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $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}\;y \leq -5 \cdot 10^{+95}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z - t}}\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{-121}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z - t}{a}\\
\end{array}
\end{array}
if y < -5.00000000000000025e95Initial program 74.2%
associate-/l*99.8%
Simplified99.8%
clear-num99.7%
un-div-inv99.8%
Applied egg-rr99.8%
if -5.00000000000000025e95 < y < 1.60000000000000009e-121Initial program 99.9%
if 1.60000000000000009e-121 < y Initial program 94.0%
associate-/l*99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -108000000000.0) (not (<= y 1.35e+189))) (* y (/ (- z t) a)) (+ x (/ (* y z) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -108000000000.0) || !(y <= 1.35e+189)) {
tmp = y * ((z - t) / a);
} else {
tmp = x + ((y * z) / a);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((y <= (-108000000000.0d0)) .or. (.not. (y <= 1.35d+189))) then
tmp = y * ((z - t) / a)
else
tmp = x + ((y * z) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -108000000000.0) || !(y <= 1.35e+189)) {
tmp = y * ((z - t) / a);
} else {
tmp = x + ((y * z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -108000000000.0) or not (y <= 1.35e+189): tmp = y * ((z - t) / a) else: tmp = x + ((y * z) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -108000000000.0) || !(y <= 1.35e+189)) tmp = Float64(y * Float64(Float64(z - t) / a)); else tmp = Float64(x + Float64(Float64(y * z) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -108000000000.0) || ~((y <= 1.35e+189))) tmp = y * ((z - t) / a); else tmp = x + ((y * z) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -108000000000.0], N[Not[LessEqual[y, 1.35e+189]], $MachinePrecision]], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -108000000000 \lor \neg \left(y \leq 1.35 \cdot 10^{+189}\right):\\
\;\;\;\;y \cdot \frac{z - t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\end{array}
\end{array}
if y < -1.08e11 or 1.34999999999999997e189 < y Initial program 85.5%
associate-/l*99.8%
Simplified99.8%
Taylor expanded in y around inf 96.2%
associate--l+96.2%
div-sub99.8%
Simplified99.8%
Taylor expanded in x around 0 80.9%
div-sub84.5%
Simplified84.5%
if -1.08e11 < y < 1.34999999999999997e189Initial program 98.2%
associate-/l*91.2%
Simplified91.2%
Taylor expanded in z around inf 79.1%
Final simplification80.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.4e+32) (not (<= t 6.8e-7))) (- x (* t (/ y a))) (+ x (/ y (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.4e+32) || !(t <= 6.8e-7)) {
tmp = x - (t * (y / a));
} else {
tmp = x + (y / (a / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-3.4d+32)) .or. (.not. (t <= 6.8d-7))) then
tmp = x - (t * (y / a))
else
tmp = x + (y / (a / z))
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.4e+32) || !(t <= 6.8e-7)) {
tmp = x - (t * (y / a));
} else {
tmp = x + (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.4e+32) or not (t <= 6.8e-7): tmp = x - (t * (y / a)) else: tmp = x + (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.4e+32) || !(t <= 6.8e-7)) tmp = Float64(x - Float64(t * Float64(y / a))); else tmp = Float64(x + Float64(y / Float64(a / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -3.4e+32) || ~((t <= 6.8e-7))) tmp = x - (t * (y / a)); else tmp = x + (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.4e+32], N[Not[LessEqual[t, 6.8e-7]], $MachinePrecision]], N[(x - N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.4 \cdot 10^{+32} \lor \neg \left(t \leq 6.8 \cdot 10^{-7}\right):\\
\;\;\;\;x - t \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -3.39999999999999979e32 or 6.79999999999999948e-7 < t Initial program 91.5%
associate-/l*90.8%
Simplified90.8%
Taylor expanded in z around 0 82.2%
mul-1-neg82.2%
unsub-neg82.2%
*-commutative82.2%
associate-/l*82.1%
Simplified82.1%
Taylor expanded in y around 0 82.2%
associate-/l*86.4%
Simplified86.4%
if -3.39999999999999979e32 < t < 6.79999999999999948e-7Initial program 96.0%
associate-/l*96.6%
Simplified96.6%
Taylor expanded in t around 0 88.7%
+-commutative88.7%
associate-/l*89.3%
Simplified89.3%
clear-num42.0%
un-div-inv43.2%
Applied egg-rr90.5%
Final simplification88.7%
(FPCore (x y z t a) :precision binary64 (if (<= a -9.2e+114) x (if (<= a 2.4e+62) (* y (/ (- z t) a)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -9.2e+114) {
tmp = x;
} else if (a <= 2.4e+62) {
tmp = y * ((z - t) / 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 <= (-9.2d+114)) then
tmp = x
else if (a <= 2.4d+62) then
tmp = y * ((z - t) / 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 <= -9.2e+114) {
tmp = x;
} else if (a <= 2.4e+62) {
tmp = y * ((z - t) / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -9.2e+114: tmp = x elif a <= 2.4e+62: tmp = y * ((z - t) / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -9.2e+114) tmp = x; elseif (a <= 2.4e+62) tmp = Float64(y * Float64(Float64(z - t) / a)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -9.2e+114) tmp = x; elseif (a <= 2.4e+62) tmp = y * ((z - t) / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -9.2e+114], x, If[LessEqual[a, 2.4e+62], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9.2 \cdot 10^{+114}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 2.4 \cdot 10^{+62}:\\
\;\;\;\;y \cdot \frac{z - t}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -9.2000000000000001e114 or 2.4e62 < a Initial program 86.4%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around inf 69.6%
if -9.2000000000000001e114 < a < 2.4e62Initial program 99.2%
associate-/l*90.0%
Simplified90.0%
Taylor expanded in y around inf 81.0%
associate--l+81.0%
div-sub83.8%
Simplified83.8%
Taylor expanded in x around 0 70.1%
div-sub72.8%
Simplified72.8%
Final simplification71.5%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.4e+74) (* y (/ (- z t) a)) (if (<= t 7.2e+201) (+ x (* z (/ y a))) (/ (* y (- t)) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.4e+74) {
tmp = y * ((z - t) / a);
} else if (t <= 7.2e+201) {
tmp = x + (z * (y / a));
} else {
tmp = (y * -t) / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-1.4d+74)) then
tmp = y * ((z - t) / a)
else if (t <= 7.2d+201) then
tmp = x + (z * (y / a))
else
tmp = (y * -t) / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.4e+74) {
tmp = y * ((z - t) / a);
} else if (t <= 7.2e+201) {
tmp = x + (z * (y / a));
} else {
tmp = (y * -t) / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.4e+74: tmp = y * ((z - t) / a) elif t <= 7.2e+201: tmp = x + (z * (y / a)) else: tmp = (y * -t) / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.4e+74) tmp = Float64(y * Float64(Float64(z - t) / a)); elseif (t <= 7.2e+201) tmp = Float64(x + Float64(z * Float64(y / a))); else tmp = Float64(Float64(y * Float64(-t)) / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.4e+74) tmp = y * ((z - t) / a); elseif (t <= 7.2e+201) tmp = x + (z * (y / a)); else tmp = (y * -t) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.4e+74], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 7.2e+201], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * (-t)), $MachinePrecision] / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.4 \cdot 10^{+74}:\\
\;\;\;\;y \cdot \frac{z - t}{a}\\
\mathbf{elif}\;t \leq 7.2 \cdot 10^{+201}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \left(-t\right)}{a}\\
\end{array}
\end{array}
if t < -1.40000000000000001e74Initial program 88.4%
associate-/l*94.2%
Simplified94.2%
Taylor expanded in y around inf 80.4%
associate--l+80.4%
div-sub88.6%
Simplified88.6%
Taylor expanded in x around 0 65.2%
div-sub73.4%
Simplified73.4%
if -1.40000000000000001e74 < t < 7.19999999999999951e201Initial program 95.4%
associate-/l*94.5%
Simplified94.5%
Taylor expanded in t around 0 81.8%
+-commutative81.8%
associate-/l*80.7%
Simplified80.7%
clear-num36.1%
un-div-inv37.0%
Applied egg-rr81.6%
associate-/r/83.7%
Applied egg-rr83.7%
if 7.19999999999999951e201 < t Initial program 94.4%
associate-/l*89.4%
Simplified89.4%
Taylor expanded in y around inf 89.3%
associate--l+89.3%
div-sub89.3%
Simplified89.3%
Taylor expanded in t around inf 70.5%
mul-1-neg70.5%
distribute-neg-frac270.5%
Simplified70.5%
*-commutative70.5%
distribute-frac-neg270.5%
distribute-frac-neg70.5%
associate-*l/81.0%
Applied egg-rr81.0%
Final simplification81.5%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.75e+74) (* y (/ (- z t) a)) (if (<= t 1.4e+199) (+ x (/ z (/ a y))) (/ (* y (- t)) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.75e+74) {
tmp = y * ((z - t) / a);
} else if (t <= 1.4e+199) {
tmp = x + (z / (a / y));
} else {
tmp = (y * -t) / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-1.75d+74)) then
tmp = y * ((z - t) / a)
else if (t <= 1.4d+199) then
tmp = x + (z / (a / y))
else
tmp = (y * -t) / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.75e+74) {
tmp = y * ((z - t) / a);
} else if (t <= 1.4e+199) {
tmp = x + (z / (a / y));
} else {
tmp = (y * -t) / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.75e+74: tmp = y * ((z - t) / a) elif t <= 1.4e+199: tmp = x + (z / (a / y)) else: tmp = (y * -t) / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.75e+74) tmp = Float64(y * Float64(Float64(z - t) / a)); elseif (t <= 1.4e+199) tmp = Float64(x + Float64(z / Float64(a / y))); else tmp = Float64(Float64(y * Float64(-t)) / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.75e+74) tmp = y * ((z - t) / a); elseif (t <= 1.4e+199) tmp = x + (z / (a / y)); else tmp = (y * -t) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.75e+74], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.4e+199], N[(x + N[(z / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * (-t)), $MachinePrecision] / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.75 \cdot 10^{+74}:\\
\;\;\;\;y \cdot \frac{z - t}{a}\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{+199}:\\
\;\;\;\;x + \frac{z}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \left(-t\right)}{a}\\
\end{array}
\end{array}
if t < -1.75000000000000007e74Initial program 88.4%
associate-/l*94.2%
Simplified94.2%
Taylor expanded in y around inf 80.4%
associate--l+80.4%
div-sub88.6%
Simplified88.6%
Taylor expanded in x around 0 65.2%
div-sub73.4%
Simplified73.4%
if -1.75000000000000007e74 < t < 1.40000000000000005e199Initial program 95.4%
associate-/l*94.5%
Simplified94.5%
Taylor expanded in t around 0 81.8%
+-commutative81.8%
associate-/l*80.7%
Simplified80.7%
clear-num36.1%
un-div-inv37.0%
Applied egg-rr81.6%
associate-/r/83.7%
Applied egg-rr83.7%
*-commutative83.7%
clear-num83.7%
un-div-inv84.1%
Applied egg-rr84.1%
if 1.40000000000000005e199 < t Initial program 94.4%
associate-/l*89.4%
Simplified89.4%
Taylor expanded in y around inf 89.3%
associate--l+89.3%
div-sub89.3%
Simplified89.3%
Taylor expanded in t around inf 70.5%
mul-1-neg70.5%
distribute-neg-frac270.5%
Simplified70.5%
*-commutative70.5%
distribute-frac-neg270.5%
distribute-frac-neg70.5%
associate-*l/81.0%
Applied egg-rr81.0%
Final simplification81.8%
(FPCore (x y z t a) :precision binary64 (if (<= x -1.3e-43) x (if (<= x 1.9e+41) (* y (/ z a)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -1.3e-43) {
tmp = x;
} else if (x <= 1.9e+41) {
tmp = y * (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 (x <= (-1.3d-43)) then
tmp = x
else if (x <= 1.9d+41) then
tmp = y * (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 (x <= -1.3e-43) {
tmp = x;
} else if (x <= 1.9e+41) {
tmp = y * (z / a);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -1.3e-43: tmp = x elif x <= 1.9e+41: tmp = y * (z / a) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -1.3e-43) tmp = x; elseif (x <= 1.9e+41) tmp = Float64(y * Float64(z / a)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -1.3e-43) tmp = x; elseif (x <= 1.9e+41) tmp = y * (z / a); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -1.3e-43], x, If[LessEqual[x, 1.9e+41], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.3 \cdot 10^{-43}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{+41}:\\
\;\;\;\;y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.3e-43 or 1.9000000000000001e41 < x Initial program 91.4%
associate-/l*94.6%
Simplified94.6%
Taylor expanded in x around inf 65.1%
if -1.3e-43 < x < 1.9000000000000001e41Initial program 96.3%
associate-/l*93.6%
Simplified93.6%
Taylor expanded in y around inf 91.2%
associate--l+91.2%
div-sub93.6%
Simplified93.6%
Taylor expanded in z around inf 45.5%
Final simplification54.7%
(FPCore (x y z t a) :precision binary64 (if (<= x -1.9e-43) x (if (<= x 2.7e+41) (/ y (/ a z)) x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -1.9e-43) {
tmp = x;
} else if (x <= 2.7e+41) {
tmp = y / (a / z);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (x <= (-1.9d-43)) then
tmp = x
else if (x <= 2.7d+41) then
tmp = y / (a / z)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -1.9e-43) {
tmp = x;
} else if (x <= 2.7e+41) {
tmp = y / (a / z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -1.9e-43: tmp = x elif x <= 2.7e+41: tmp = y / (a / z) else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -1.9e-43) tmp = x; elseif (x <= 2.7e+41) tmp = Float64(y / Float64(a / z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -1.9e-43) tmp = x; elseif (x <= 2.7e+41) tmp = y / (a / z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -1.9e-43], x, If[LessEqual[x, 2.7e+41], N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.9 \cdot 10^{-43}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2.7 \cdot 10^{+41}:\\
\;\;\;\;\frac{y}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.89999999999999985e-43 or 2.7e41 < x Initial program 91.4%
associate-/l*94.6%
Simplified94.6%
Taylor expanded in x around inf 65.1%
if -1.89999999999999985e-43 < x < 2.7e41Initial program 96.3%
associate-/l*93.6%
Simplified93.6%
Taylor expanded in y around inf 91.2%
associate--l+91.2%
div-sub93.6%
Simplified93.6%
Taylor expanded in z around inf 45.5%
clear-num45.4%
un-div-inv46.7%
Applied egg-rr46.7%
Final simplification55.4%
(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 94.0%
associate-/l*94.0%
Simplified94.0%
Final simplification94.0%
(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 94.0%
associate-/l*94.0%
Simplified94.0%
clear-num94.0%
un-div-inv95.0%
Applied egg-rr95.0%
Final simplification95.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 94.0%
associate-/l*94.0%
Simplified94.0%
Taylor expanded in x around inf 39.9%
Final simplification39.9%
(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 2024089
(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)))