
(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 9 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 (* (/ 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 93.0%
sub-negN/A
+-lowering-+.f64N/A
distribute-neg-fracN/A
distribute-rgt-neg-inN/A
associate-*l/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f6497.5%
Simplified97.5%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ x (/ (* y t) a)))) (if (<= t -1.65e+53) t_1 (if (<= t 1.55e+38) (- x (/ (* y z) a)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y * t) / a);
double tmp;
if (t <= -1.65e+53) {
tmp = t_1;
} else if (t <= 1.55e+38) {
tmp = x - ((y * z) / 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 = x + ((y * t) / a)
if (t <= (-1.65d+53)) then
tmp = t_1
else if (t <= 1.55d+38) then
tmp = x - ((y * z) / 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 = x + ((y * t) / a);
double tmp;
if (t <= -1.65e+53) {
tmp = t_1;
} else if (t <= 1.55e+38) {
tmp = x - ((y * z) / a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((y * t) / a) tmp = 0 if t <= -1.65e+53: tmp = t_1 elif t <= 1.55e+38: tmp = x - ((y * z) / a) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y * t) / a)) tmp = 0.0 if (t <= -1.65e+53) tmp = t_1; elseif (t <= 1.55e+38) tmp = Float64(x - Float64(Float64(y * z) / a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((y * t) / a); tmp = 0.0; if (t <= -1.65e+53) tmp = t_1; elseif (t <= 1.55e+38) tmp = x - ((y * z) / a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.65e+53], t$95$1, If[LessEqual[t, 1.55e+38], N[(x - N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y \cdot t}{a}\\
\mathbf{if}\;t \leq -1.65 \cdot 10^{+53}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.55 \cdot 10^{+38}:\\
\;\;\;\;x - \frac{y \cdot z}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.6500000000000001e53 or 1.55000000000000009e38 < t Initial program 91.0%
*-commutativeN/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f6497.0%
Applied egg-rr97.0%
Taylor expanded in z around 0
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6481.7%
Simplified81.7%
if -1.6500000000000001e53 < t < 1.55000000000000009e38Initial program 94.4%
Taylor expanded in z around inf
*-lowering-*.f6487.9%
Simplified87.9%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ x (/ (* y t) a)))) (if (<= t -5.5e+52) t_1 (if (<= t 2.2e+81) (- x (/ y (/ a z))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y * t) / a);
double tmp;
if (t <= -5.5e+52) {
tmp = t_1;
} else if (t <= 2.2e+81) {
tmp = x - (y / (a / z));
} 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 = x + ((y * t) / a)
if (t <= (-5.5d+52)) then
tmp = t_1
else if (t <= 2.2d+81) then
tmp = x - (y / (a / z))
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 = x + ((y * t) / a);
double tmp;
if (t <= -5.5e+52) {
tmp = t_1;
} else if (t <= 2.2e+81) {
tmp = x - (y / (a / z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((y * t) / a) tmp = 0 if t <= -5.5e+52: tmp = t_1 elif t <= 2.2e+81: tmp = x - (y / (a / z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y * t) / a)) tmp = 0.0 if (t <= -5.5e+52) tmp = t_1; elseif (t <= 2.2e+81) tmp = Float64(x - Float64(y / Float64(a / z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((y * t) / a); tmp = 0.0; if (t <= -5.5e+52) tmp = t_1; elseif (t <= 2.2e+81) tmp = x - (y / (a / z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.5e+52], t$95$1, If[LessEqual[t, 2.2e+81], N[(x - N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y \cdot t}{a}\\
\mathbf{if}\;t \leq -5.5 \cdot 10^{+52}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.2 \cdot 10^{+81}:\\
\;\;\;\;x - \frac{y}{\frac{a}{z}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -5.49999999999999996e52 or 2.19999999999999987e81 < t Initial program 93.0%
*-commutativeN/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f6496.8%
Applied egg-rr96.8%
Taylor expanded in z around 0
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6482.8%
Simplified82.8%
if -5.49999999999999996e52 < t < 2.19999999999999987e81Initial program 93.1%
sub-negN/A
+-lowering-+.f64N/A
distribute-neg-fracN/A
distribute-rgt-neg-inN/A
associate-*l/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f6498.0%
Simplified98.0%
Taylor expanded in t around 0
mul-1-negN/A
sub-negN/A
--lowering--.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6486.6%
Simplified86.6%
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6486.8%
Applied egg-rr86.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ x (/ (* y t) a)))) (if (<= t -3.6e+52) t_1 (if (<= t 6.8e+80) (- x (* y (/ z a))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y * t) / a);
double tmp;
if (t <= -3.6e+52) {
tmp = t_1;
} else if (t <= 6.8e+80) {
tmp = x - (y * (z / 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 = x + ((y * t) / a)
if (t <= (-3.6d+52)) then
tmp = t_1
else if (t <= 6.8d+80) then
tmp = x - (y * (z / 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 = x + ((y * t) / a);
double tmp;
if (t <= -3.6e+52) {
tmp = t_1;
} else if (t <= 6.8e+80) {
tmp = x - (y * (z / a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + ((y * t) / a) tmp = 0 if t <= -3.6e+52: tmp = t_1 elif t <= 6.8e+80: tmp = x - (y * (z / a)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y * t) / a)) tmp = 0.0 if (t <= -3.6e+52) tmp = t_1; elseif (t <= 6.8e+80) tmp = Float64(x - Float64(y * Float64(z / a))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + ((y * t) / a); tmp = 0.0; if (t <= -3.6e+52) tmp = t_1; elseif (t <= 6.8e+80) tmp = x - (y * (z / a)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.6e+52], t$95$1, If[LessEqual[t, 6.8e+80], N[(x - N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y \cdot t}{a}\\
\mathbf{if}\;t \leq -3.6 \cdot 10^{+52}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 6.8 \cdot 10^{+80}:\\
\;\;\;\;x - y \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.6e52 or 6.79999999999999984e80 < t Initial program 93.0%
*-commutativeN/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f6496.8%
Applied egg-rr96.8%
Taylor expanded in z around 0
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6482.8%
Simplified82.8%
if -3.6e52 < t < 6.79999999999999984e80Initial program 93.1%
sub-negN/A
+-lowering-+.f64N/A
distribute-neg-fracN/A
distribute-rgt-neg-inN/A
associate-*l/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f6498.0%
Simplified98.0%
Taylor expanded in t around 0
mul-1-negN/A
sub-negN/A
--lowering--.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6486.6%
Simplified86.6%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (/ y a) (- t z)))) (if (<= y -4e-75) t_1 (if (<= y 3.6e-43) (+ x (/ (* y t) a)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y / a) * (t - z);
double tmp;
if (y <= -4e-75) {
tmp = t_1;
} else if (y <= 3.6e-43) {
tmp = x + ((y * t) / 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) * (t - z)
if (y <= (-4d-75)) then
tmp = t_1
else if (y <= 3.6d-43) then
tmp = x + ((y * t) / 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) * (t - z);
double tmp;
if (y <= -4e-75) {
tmp = t_1;
} else if (y <= 3.6e-43) {
tmp = x + ((y * t) / a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y / a) * (t - z) tmp = 0 if y <= -4e-75: tmp = t_1 elif y <= 3.6e-43: tmp = x + ((y * t) / a) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y / a) * Float64(t - z)) tmp = 0.0 if (y <= -4e-75) tmp = t_1; elseif (y <= 3.6e-43) tmp = Float64(x + Float64(Float64(y * t) / a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y / a) * (t - z); tmp = 0.0; if (y <= -4e-75) tmp = t_1; elseif (y <= 3.6e-43) tmp = x + ((y * t) / 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[(t - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4e-75], t$95$1, If[LessEqual[y, 3.6e-43], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{a} \cdot \left(t - z\right)\\
\mathbf{if}\;y \leq -4 \cdot 10^{-75}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.6 \cdot 10^{-43}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.9999999999999998e-75 or 3.5999999999999999e-43 < y Initial program 89.7%
sub-negN/A
+-lowering-+.f64N/A
distribute-neg-fracN/A
distribute-rgt-neg-inN/A
associate-*l/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f6498.5%
Simplified98.5%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f6482.6%
Simplified82.6%
if -3.9999999999999998e-75 < y < 3.5999999999999999e-43Initial program 98.4%
*-commutativeN/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f6496.0%
Applied egg-rr96.0%
Taylor expanded in z around 0
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6480.6%
Simplified80.6%
Final simplification81.9%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (/ y a) (- t z)))) (if (<= y -3.2e-75) t_1 (if (<= y 5.3e-43) (+ x (* y (/ t a))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y / a) * (t - z);
double tmp;
if (y <= -3.2e-75) {
tmp = t_1;
} else if (y <= 5.3e-43) {
tmp = x + (y * (t / 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) * (t - z)
if (y <= (-3.2d-75)) then
tmp = t_1
else if (y <= 5.3d-43) then
tmp = x + (y * (t / 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) * (t - z);
double tmp;
if (y <= -3.2e-75) {
tmp = t_1;
} else if (y <= 5.3e-43) {
tmp = x + (y * (t / a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y / a) * (t - z) tmp = 0 if y <= -3.2e-75: tmp = t_1 elif y <= 5.3e-43: tmp = x + (y * (t / a)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y / a) * Float64(t - z)) tmp = 0.0 if (y <= -3.2e-75) tmp = t_1; elseif (y <= 5.3e-43) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y / a) * (t - z); tmp = 0.0; if (y <= -3.2e-75) tmp = t_1; elseif (y <= 5.3e-43) tmp = x + (y * (t / 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[(t - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.2e-75], t$95$1, If[LessEqual[y, 5.3e-43], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{a} \cdot \left(t - z\right)\\
\mathbf{if}\;y \leq -3.2 \cdot 10^{-75}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 5.3 \cdot 10^{-43}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.19999999999999977e-75 or 5.3000000000000003e-43 < y Initial program 89.7%
sub-negN/A
+-lowering-+.f64N/A
distribute-neg-fracN/A
distribute-rgt-neg-inN/A
associate-*l/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f6498.5%
Simplified98.5%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f6482.6%
Simplified82.6%
if -3.19999999999999977e-75 < y < 5.3000000000000003e-43Initial program 98.4%
sub-negN/A
+-lowering-+.f64N/A
distribute-neg-fracN/A
distribute-rgt-neg-inN/A
associate-*l/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f6496.0%
Simplified96.0%
Taylor expanded in z around 0
+-lowering-+.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6470.2%
Simplified70.2%
Final simplification77.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (/ y a) (- t z)))) (if (<= y -1.1e-75) t_1 (if (<= y 3.8e-43) x t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y / a) * (t - z);
double tmp;
if (y <= -1.1e-75) {
tmp = t_1;
} else if (y <= 3.8e-43) {
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 = (y / a) * (t - z)
if (y <= (-1.1d-75)) then
tmp = t_1
else if (y <= 3.8d-43) 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 = (y / a) * (t - z);
double tmp;
if (y <= -1.1e-75) {
tmp = t_1;
} else if (y <= 3.8e-43) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y / a) * (t - z) tmp = 0 if y <= -1.1e-75: tmp = t_1 elif y <= 3.8e-43: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y / a) * Float64(t - z)) tmp = 0.0 if (y <= -1.1e-75) tmp = t_1; elseif (y <= 3.8e-43) tmp = x; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y / a) * (t - z); tmp = 0.0; if (y <= -1.1e-75) tmp = t_1; elseif (y <= 3.8e-43) tmp = x; 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[(t - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.1e-75], t$95$1, If[LessEqual[y, 3.8e-43], x, t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{a} \cdot \left(t - z\right)\\
\mathbf{if}\;y \leq -1.1 \cdot 10^{-75}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{-43}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.10000000000000003e-75 or 3.7999999999999997e-43 < y Initial program 89.7%
sub-negN/A
+-lowering-+.f64N/A
distribute-neg-fracN/A
distribute-rgt-neg-inN/A
associate-*l/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f6498.5%
Simplified98.5%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f6482.6%
Simplified82.6%
if -1.10000000000000003e-75 < y < 3.7999999999999997e-43Initial program 98.4%
sub-negN/A
+-lowering-+.f64N/A
distribute-neg-fracN/A
distribute-rgt-neg-inN/A
associate-*l/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f6496.0%
Simplified96.0%
Taylor expanded in x around inf
Simplified64.8%
Final simplification75.7%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (/ y a) t))) (if (<= y -4e-75) t_1 (if (<= y 6.5e+47) x t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y / a) * t;
double tmp;
if (y <= -4e-75) {
tmp = t_1;
} else if (y <= 6.5e+47) {
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 = (y / a) * t
if (y <= (-4d-75)) then
tmp = t_1
else if (y <= 6.5d+47) 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 = (y / a) * t;
double tmp;
if (y <= -4e-75) {
tmp = t_1;
} else if (y <= 6.5e+47) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y / a) * t tmp = 0 if y <= -4e-75: tmp = t_1 elif y <= 6.5e+47: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y / a) * t) tmp = 0.0 if (y <= -4e-75) tmp = t_1; elseif (y <= 6.5e+47) tmp = x; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y / a) * t; tmp = 0.0; if (y <= -4e-75) tmp = t_1; elseif (y <= 6.5e+47) tmp = x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y / a), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[y, -4e-75], t$95$1, If[LessEqual[y, 6.5e+47], x, t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{a} \cdot t\\
\mathbf{if}\;y \leq -4 \cdot 10^{-75}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{+47}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.9999999999999998e-75 or 6.49999999999999988e47 < y Initial program 87.8%
sub-negN/A
+-lowering-+.f64N/A
distribute-neg-fracN/A
distribute-rgt-neg-inN/A
associate-*l/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f6498.2%
Simplified98.2%
Taylor expanded in x around 0
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f6485.2%
Simplified85.2%
Taylor expanded in t around inf
Simplified42.1%
if -3.9999999999999998e-75 < y < 6.49999999999999988e47Initial program 98.7%
sub-negN/A
+-lowering-+.f64N/A
distribute-neg-fracN/A
distribute-rgt-neg-inN/A
associate-*l/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f6496.8%
Simplified96.8%
Taylor expanded in x around inf
Simplified58.5%
Final simplification50.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 93.0%
sub-negN/A
+-lowering-+.f64N/A
distribute-neg-fracN/A
distribute-rgt-neg-inN/A
associate-*l/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sub-negN/A
+-commutativeN/A
distribute-neg-inN/A
unsub-negN/A
remove-double-negN/A
--lowering--.f6497.5%
Simplified97.5%
Taylor expanded in x around inf
Simplified36.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ a (- z t))))
(if (< y -1.0761266216389975e-10)
(- x (/ 1.0 (/ t_1 y)))
(if (< y 2.894426862792089e-49)
(- x (/ (* y (- z t)) a))
(- x (/ y t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a / (z - t);
double tmp;
if (y < -1.0761266216389975e-10) {
tmp = x - (1.0 / (t_1 / y));
} else if (y < 2.894426862792089e-49) {
tmp = x - ((y * (z - t)) / a);
} else {
tmp = x - (y / t_1);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = a / (z - t)
if (y < (-1.0761266216389975d-10)) then
tmp = x - (1.0d0 / (t_1 / y))
else if (y < 2.894426862792089d-49) then
tmp = x - ((y * (z - t)) / a)
else
tmp = x - (y / t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = a / (z - t);
double tmp;
if (y < -1.0761266216389975e-10) {
tmp = x - (1.0 / (t_1 / y));
} else if (y < 2.894426862792089e-49) {
tmp = x - ((y * (z - t)) / a);
} else {
tmp = x - (y / t_1);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a / (z - t) tmp = 0 if y < -1.0761266216389975e-10: tmp = x - (1.0 / (t_1 / y)) elif y < 2.894426862792089e-49: tmp = x - ((y * (z - t)) / a) else: tmp = x - (y / t_1) return tmp
function code(x, y, z, t, a) t_1 = Float64(a / Float64(z - t)) tmp = 0.0 if (y < -1.0761266216389975e-10) tmp = Float64(x - Float64(1.0 / Float64(t_1 / y))); elseif (y < 2.894426862792089e-49) tmp = Float64(x - Float64(Float64(y * Float64(z - t)) / a)); else tmp = Float64(x - Float64(y / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a / (z - t); tmp = 0.0; if (y < -1.0761266216389975e-10) tmp = x - (1.0 / (t_1 / y)); elseif (y < 2.894426862792089e-49) tmp = x - ((y * (z - t)) / a); else tmp = x - (y / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[Less[y, -1.0761266216389975e-10], N[(x - N[(1.0 / N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Less[y, 2.894426862792089e-49], N[(x - N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a}{z - t}\\
\mathbf{if}\;y < -1.0761266216389975 \cdot 10^{-10}:\\
\;\;\;\;x - \frac{1}{\frac{t\_1}{y}}\\
\mathbf{elif}\;y < 2.894426862792089 \cdot 10^{-49}:\\
\;\;\;\;x - \frac{y \cdot \left(z - t\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y}{t\_1}\\
\end{array}
\end{array}
herbie shell --seed 2024158
(FPCore (x y z t a)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, F"
: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)))