
(FPCore (x y z t) :precision binary64 (* (/ (- x y) (- z y)) t))
double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((x - y) / (z - y)) * t
end function
public static double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * t;
}
def code(x, y, z, t): return ((x - y) / (z - y)) * t
function code(x, y, z, t) return Float64(Float64(Float64(x - y) / Float64(z - y)) * t) end
function tmp = code(x, y, z, t) tmp = ((x - y) / (z - y)) * t; end
code[x_, y_, z_, t_] := N[(N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{z - y} \cdot t
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (* (/ (- x y) (- z y)) t))
double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((x - y) / (z - y)) * t
end function
public static double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * t;
}
def code(x, y, z, t): return ((x - y) / (z - y)) * t
function code(x, y, z, t) return Float64(Float64(Float64(x - y) / Float64(z - y)) * t) end
function tmp = code(x, y, z, t) tmp = ((x - y) / (z - y)) * t; end
code[x_, y_, z_, t_] := N[(N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{z - y} \cdot t
\end{array}
(FPCore (x y z t) :precision binary64 (/ t (/ (- z y) (- x y))))
double code(double x, double y, double z, double t) {
return t / ((z - y) / (x - y));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = t / ((z - y) / (x - y))
end function
public static double code(double x, double y, double z, double t) {
return t / ((z - y) / (x - y));
}
def code(x, y, z, t): return t / ((z - y) / (x - y))
function code(x, y, z, t) return Float64(t / Float64(Float64(z - y) / Float64(x - y))) end
function tmp = code(x, y, z, t) tmp = t / ((z - y) / (x - y)); end
code[x_, y_, z_, t_] := N[(t / N[(N[(z - y), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{t}{\frac{z - y}{x - y}}
\end{array}
Initial program 97.6%
associate-*l/85.3%
associate-*r/82.8%
Simplified82.8%
associate-*r/85.3%
associate-*l/97.6%
*-commutative97.6%
clear-num97.5%
un-div-inv97.6%
Applied egg-rr97.6%
Final simplification97.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- x y) (/ t (- z y)))))
(if (<= t -1.2e-117)
t_1
(if (<= t 1.05e-238)
(/ (* t x) (- z y))
(if (<= t 3.2e-171) (* t (/ y (- y z))) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (x - y) * (t / (z - y));
double tmp;
if (t <= -1.2e-117) {
tmp = t_1;
} else if (t <= 1.05e-238) {
tmp = (t * x) / (z - y);
} else if (t <= 3.2e-171) {
tmp = t * (y / (y - z));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (x - y) * (t / (z - y))
if (t <= (-1.2d-117)) then
tmp = t_1
else if (t <= 1.05d-238) then
tmp = (t * x) / (z - y)
else if (t <= 3.2d-171) then
tmp = t * (y / (y - z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x - y) * (t / (z - y));
double tmp;
if (t <= -1.2e-117) {
tmp = t_1;
} else if (t <= 1.05e-238) {
tmp = (t * x) / (z - y);
} else if (t <= 3.2e-171) {
tmp = t * (y / (y - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x - y) * (t / (z - y)) tmp = 0 if t <= -1.2e-117: tmp = t_1 elif t <= 1.05e-238: tmp = (t * x) / (z - y) elif t <= 3.2e-171: tmp = t * (y / (y - z)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x - y) * Float64(t / Float64(z - y))) tmp = 0.0 if (t <= -1.2e-117) tmp = t_1; elseif (t <= 1.05e-238) tmp = Float64(Float64(t * x) / Float64(z - y)); elseif (t <= 3.2e-171) tmp = Float64(t * Float64(y / Float64(y - z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x - y) * (t / (z - y)); tmp = 0.0; if (t <= -1.2e-117) tmp = t_1; elseif (t <= 1.05e-238) tmp = (t * x) / (z - y); elseif (t <= 3.2e-171) tmp = t * (y / (y - z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - y), $MachinePrecision] * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.2e-117], t$95$1, If[LessEqual[t, 1.05e-238], N[(N[(t * x), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.2e-171], N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x - y\right) \cdot \frac{t}{z - y}\\
\mathbf{if}\;t \leq -1.2 \cdot 10^{-117}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 1.05 \cdot 10^{-238}:\\
\;\;\;\;\frac{t \cdot x}{z - y}\\
\mathbf{elif}\;t \leq 3.2 \cdot 10^{-171}:\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -1.20000000000000007e-117 or 3.2000000000000001e-171 < t Initial program 98.3%
associate-*l/79.9%
associate-*r/92.1%
Simplified92.1%
if -1.20000000000000007e-117 < t < 1.0500000000000001e-238Initial program 94.4%
associate-*l/99.9%
associate-*r/56.6%
Simplified56.6%
Taylor expanded in x around inf 81.6%
if 1.0500000000000001e-238 < t < 3.2000000000000001e-171Initial program 100.0%
Taylor expanded in x around 0 88.0%
neg-mul-188.0%
distribute-neg-frac88.0%
Simplified88.0%
frac-2neg88.0%
div-inv87.6%
remove-double-neg87.6%
sub-neg87.6%
distribute-neg-in87.6%
remove-double-neg87.6%
Applied egg-rr87.6%
associate-*r/88.0%
*-rgt-identity88.0%
+-commutative88.0%
unsub-neg88.0%
Simplified88.0%
Final simplification89.7%
(FPCore (x y z t)
:precision binary64
(if (<= y -9.5e+126)
t
(if (<= y -2.25e-13)
(/ (- y) (/ z t))
(if (<= y -1.85e-78)
(* x (/ (- t) y))
(if (<= y 4.2e+58) (/ t (/ z x)) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -9.5e+126) {
tmp = t;
} else if (y <= -2.25e-13) {
tmp = -y / (z / t);
} else if (y <= -1.85e-78) {
tmp = x * (-t / y);
} else if (y <= 4.2e+58) {
tmp = t / (z / x);
} else {
tmp = t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-9.5d+126)) then
tmp = t
else if (y <= (-2.25d-13)) then
tmp = -y / (z / t)
else if (y <= (-1.85d-78)) then
tmp = x * (-t / y)
else if (y <= 4.2d+58) then
tmp = t / (z / x)
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -9.5e+126) {
tmp = t;
} else if (y <= -2.25e-13) {
tmp = -y / (z / t);
} else if (y <= -1.85e-78) {
tmp = x * (-t / y);
} else if (y <= 4.2e+58) {
tmp = t / (z / x);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -9.5e+126: tmp = t elif y <= -2.25e-13: tmp = -y / (z / t) elif y <= -1.85e-78: tmp = x * (-t / y) elif y <= 4.2e+58: tmp = t / (z / x) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -9.5e+126) tmp = t; elseif (y <= -2.25e-13) tmp = Float64(Float64(-y) / Float64(z / t)); elseif (y <= -1.85e-78) tmp = Float64(x * Float64(Float64(-t) / y)); elseif (y <= 4.2e+58) tmp = Float64(t / Float64(z / x)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -9.5e+126) tmp = t; elseif (y <= -2.25e-13) tmp = -y / (z / t); elseif (y <= -1.85e-78) tmp = x * (-t / y); elseif (y <= 4.2e+58) tmp = t / (z / x); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -9.5e+126], t, If[LessEqual[y, -2.25e-13], N[((-y) / N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.85e-78], N[(x * N[((-t) / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.2e+58], N[(t / N[(z / x), $MachinePrecision]), $MachinePrecision], t]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.5 \cdot 10^{+126}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq -2.25 \cdot 10^{-13}:\\
\;\;\;\;\frac{-y}{\frac{z}{t}}\\
\mathbf{elif}\;y \leq -1.85 \cdot 10^{-78}:\\
\;\;\;\;x \cdot \frac{-t}{y}\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{+58}:\\
\;\;\;\;\frac{t}{\frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -9.49999999999999951e126 or 4.20000000000000024e58 < y Initial program 99.9%
associate-*l/68.0%
associate-*r/69.8%
Simplified69.8%
Taylor expanded in y around inf 66.0%
if -9.49999999999999951e126 < y < -2.25e-13Initial program 99.8%
Taylor expanded in x around 0 59.4%
neg-mul-159.4%
distribute-neg-frac59.4%
Simplified59.4%
Taylor expanded in y around 0 51.0%
mul-1-neg51.0%
associate-/l*51.0%
Simplified51.0%
if -2.25e-13 < y < -1.85000000000000003e-78Initial program 99.7%
associate-*l/99.8%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in x around inf 58.9%
associate-/l*58.7%
associate-/r/58.9%
Applied egg-rr58.9%
Taylor expanded in z around 0 44.6%
associate-*r/44.6%
neg-mul-144.6%
Simplified44.6%
if -1.85000000000000003e-78 < y < 4.20000000000000024e58Initial program 94.8%
associate-*l/97.6%
associate-*r/89.9%
Simplified89.9%
Taylor expanded in y around 0 68.6%
associate-/l*68.6%
Simplified68.6%
Final simplification64.5%
(FPCore (x y z t)
:precision binary64
(if (<= y -6.2e+126)
t
(if (<= y -9e-25)
(* t (/ (- y) z))
(if (<= y -7.6e-79)
(* x (/ (- t) y))
(if (<= y 7.2e+57) (/ t (/ z x)) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.2e+126) {
tmp = t;
} else if (y <= -9e-25) {
tmp = t * (-y / z);
} else if (y <= -7.6e-79) {
tmp = x * (-t / y);
} else if (y <= 7.2e+57) {
tmp = t / (z / x);
} else {
tmp = t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-6.2d+126)) then
tmp = t
else if (y <= (-9d-25)) then
tmp = t * (-y / z)
else if (y <= (-7.6d-79)) then
tmp = x * (-t / y)
else if (y <= 7.2d+57) then
tmp = t / (z / x)
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.2e+126) {
tmp = t;
} else if (y <= -9e-25) {
tmp = t * (-y / z);
} else if (y <= -7.6e-79) {
tmp = x * (-t / y);
} else if (y <= 7.2e+57) {
tmp = t / (z / x);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -6.2e+126: tmp = t elif y <= -9e-25: tmp = t * (-y / z) elif y <= -7.6e-79: tmp = x * (-t / y) elif y <= 7.2e+57: tmp = t / (z / x) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -6.2e+126) tmp = t; elseif (y <= -9e-25) tmp = Float64(t * Float64(Float64(-y) / z)); elseif (y <= -7.6e-79) tmp = Float64(x * Float64(Float64(-t) / y)); elseif (y <= 7.2e+57) tmp = Float64(t / Float64(z / x)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -6.2e+126) tmp = t; elseif (y <= -9e-25) tmp = t * (-y / z); elseif (y <= -7.6e-79) tmp = x * (-t / y); elseif (y <= 7.2e+57) tmp = t / (z / x); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -6.2e+126], t, If[LessEqual[y, -9e-25], N[(t * N[((-y) / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -7.6e-79], N[(x * N[((-t) / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.2e+57], N[(t / N[(z / x), $MachinePrecision]), $MachinePrecision], t]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.2 \cdot 10^{+126}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq -9 \cdot 10^{-25}:\\
\;\;\;\;t \cdot \frac{-y}{z}\\
\mathbf{elif}\;y \leq -7.6 \cdot 10^{-79}:\\
\;\;\;\;x \cdot \frac{-t}{y}\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{+57}:\\
\;\;\;\;\frac{t}{\frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -6.2e126 or 7.2000000000000005e57 < y Initial program 99.9%
associate-*l/68.0%
associate-*r/69.8%
Simplified69.8%
Taylor expanded in y around inf 66.0%
if -6.2e126 < y < -9.0000000000000002e-25Initial program 99.8%
Taylor expanded in x around 0 59.4%
neg-mul-159.4%
distribute-neg-frac59.4%
Simplified59.4%
Taylor expanded in y around 0 51.1%
mul-1-neg51.1%
distribute-neg-frac51.1%
Simplified51.1%
if -9.0000000000000002e-25 < y < -7.6000000000000002e-79Initial program 99.7%
associate-*l/99.8%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in x around inf 58.9%
associate-/l*58.7%
associate-/r/58.9%
Applied egg-rr58.9%
Taylor expanded in z around 0 44.6%
associate-*r/44.6%
neg-mul-144.6%
Simplified44.6%
if -7.6000000000000002e-79 < y < 7.2000000000000005e57Initial program 94.8%
associate-*l/97.6%
associate-*r/89.9%
Simplified89.9%
Taylor expanded in y around 0 68.6%
associate-/l*68.6%
Simplified68.6%
Final simplification64.5%
(FPCore (x y z t) :precision binary64 (if (or (<= x -3.4e-132) (not (<= x 2.4e+34))) (* t (/ x (- z y))) (* t (/ y (- y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.4e-132) || !(x <= 2.4e+34)) {
tmp = t * (x / (z - y));
} else {
tmp = t * (y / (y - z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-3.4d-132)) .or. (.not. (x <= 2.4d+34))) then
tmp = t * (x / (z - y))
else
tmp = t * (y / (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.4e-132) || !(x <= 2.4e+34)) {
tmp = t * (x / (z - y));
} else {
tmp = t * (y / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -3.4e-132) or not (x <= 2.4e+34): tmp = t * (x / (z - y)) else: tmp = t * (y / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -3.4e-132) || !(x <= 2.4e+34)) tmp = Float64(t * Float64(x / Float64(z - y))); else tmp = Float64(t * Float64(y / Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -3.4e-132) || ~((x <= 2.4e+34))) tmp = t * (x / (z - y)); else tmp = t * (y / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -3.4e-132], N[Not[LessEqual[x, 2.4e+34]], $MachinePrecision]], N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.4 \cdot 10^{-132} \lor \neg \left(x \leq 2.4 \cdot 10^{+34}\right):\\
\;\;\;\;t \cdot \frac{x}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\end{array}
\end{array}
if x < -3.39999999999999983e-132 or 2.39999999999999987e34 < x Initial program 97.1%
Taylor expanded in x around inf 77.0%
if -3.39999999999999983e-132 < x < 2.39999999999999987e34Initial program 98.2%
Taylor expanded in x around 0 85.1%
neg-mul-185.1%
distribute-neg-frac85.1%
Simplified85.1%
frac-2neg85.1%
div-inv84.9%
remove-double-neg84.9%
sub-neg84.9%
distribute-neg-in84.9%
remove-double-neg84.9%
Applied egg-rr84.9%
associate-*r/85.1%
*-rgt-identity85.1%
+-commutative85.1%
unsub-neg85.1%
Simplified85.1%
Final simplification80.6%
(FPCore (x y z t) :precision binary64 (if (or (<= x -3.4e-132) (not (<= x 1e+33))) (/ t (/ (- z y) x)) (* t (/ y (- y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.4e-132) || !(x <= 1e+33)) {
tmp = t / ((z - y) / x);
} else {
tmp = t * (y / (y - z));
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-3.4d-132)) .or. (.not. (x <= 1d+33))) then
tmp = t / ((z - y) / x)
else
tmp = t * (y / (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.4e-132) || !(x <= 1e+33)) {
tmp = t / ((z - y) / x);
} else {
tmp = t * (y / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -3.4e-132) or not (x <= 1e+33): tmp = t / ((z - y) / x) else: tmp = t * (y / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -3.4e-132) || !(x <= 1e+33)) tmp = Float64(t / Float64(Float64(z - y) / x)); else tmp = Float64(t * Float64(y / Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -3.4e-132) || ~((x <= 1e+33))) tmp = t / ((z - y) / x); else tmp = t * (y / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -3.4e-132], N[Not[LessEqual[x, 1e+33]], $MachinePrecision]], N[(t / N[(N[(z - y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.4 \cdot 10^{-132} \lor \neg \left(x \leq 10^{+33}\right):\\
\;\;\;\;\frac{t}{\frac{z - y}{x}}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\end{array}
\end{array}
if x < -3.39999999999999983e-132 or 9.9999999999999995e32 < x Initial program 97.1%
associate-*l/86.5%
associate-*r/79.8%
Simplified79.8%
associate-*r/86.5%
associate-*l/97.1%
*-commutative97.1%
clear-num97.0%
un-div-inv97.2%
Applied egg-rr97.2%
Taylor expanded in x around inf 77.1%
if -3.39999999999999983e-132 < x < 9.9999999999999995e32Initial program 98.2%
Taylor expanded in x around 0 85.1%
neg-mul-185.1%
distribute-neg-frac85.1%
Simplified85.1%
frac-2neg85.1%
div-inv84.9%
remove-double-neg84.9%
sub-neg84.9%
distribute-neg-in84.9%
remove-double-neg84.9%
Applied egg-rr84.9%
associate-*r/85.1%
*-rgt-identity85.1%
+-commutative85.1%
unsub-neg85.1%
Simplified85.1%
Final simplification80.6%
(FPCore (x y z t) :precision binary64 (if (<= y -7.5e+126) t (if (<= y 1.5e+58) (* x (/ t (- z y))) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.5e+126) {
tmp = t;
} else if (y <= 1.5e+58) {
tmp = x * (t / (z - y));
} else {
tmp = t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-7.5d+126)) then
tmp = t
else if (y <= 1.5d+58) then
tmp = x * (t / (z - y))
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.5e+126) {
tmp = t;
} else if (y <= 1.5e+58) {
tmp = x * (t / (z - y));
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -7.5e+126: tmp = t elif y <= 1.5e+58: tmp = x * (t / (z - y)) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -7.5e+126) tmp = t; elseif (y <= 1.5e+58) tmp = Float64(x * Float64(t / Float64(z - y))); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -7.5e+126) tmp = t; elseif (y <= 1.5e+58) tmp = x * (t / (z - y)); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -7.5e+126], t, If[LessEqual[y, 1.5e+58], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.5 \cdot 10^{+126}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{+58}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -7.5000000000000006e126 or 1.5000000000000001e58 < y Initial program 99.9%
associate-*l/68.0%
associate-*r/69.8%
Simplified69.8%
Taylor expanded in y around inf 66.0%
if -7.5000000000000006e126 < y < 1.5000000000000001e58Initial program 96.1%
associate-*l/96.3%
associate-*r/91.2%
Simplified91.2%
Taylor expanded in x around inf 73.5%
associate-*l/68.7%
*-commutative68.7%
Simplified68.7%
Final simplification67.6%
(FPCore (x y z t) :precision binary64 (if (<= y -7e+126) t (if (<= y 4.8e+58) (* (- x y) (/ t z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7e+126) {
tmp = t;
} else if (y <= 4.8e+58) {
tmp = (x - y) * (t / z);
} else {
tmp = t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-7d+126)) then
tmp = t
else if (y <= 4.8d+58) then
tmp = (x - y) * (t / z)
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7e+126) {
tmp = t;
} else if (y <= 4.8e+58) {
tmp = (x - y) * (t / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -7e+126: tmp = t elif y <= 4.8e+58: tmp = (x - y) * (t / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -7e+126) tmp = t; elseif (y <= 4.8e+58) tmp = Float64(Float64(x - y) * Float64(t / z)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -7e+126) tmp = t; elseif (y <= 4.8e+58) tmp = (x - y) * (t / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -7e+126], t, If[LessEqual[y, 4.8e+58], N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7 \cdot 10^{+126}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{+58}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -7.0000000000000005e126 or 4.8e58 < y Initial program 99.9%
associate-*l/68.0%
associate-*r/69.8%
Simplified69.8%
Taylor expanded in y around inf 66.0%
if -7.0000000000000005e126 < y < 4.8e58Initial program 96.1%
associate-*l/96.3%
associate-*r/91.2%
Simplified91.2%
Taylor expanded in z around inf 69.4%
Final simplification68.1%
(FPCore (x y z t) :precision binary64 (if (<= y -4.4e+145) t (if (<= y 1.9e+119) (* t (/ x (- z y))) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.4e+145) {
tmp = t;
} else if (y <= 1.9e+119) {
tmp = t * (x / (z - y));
} else {
tmp = t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-4.4d+145)) then
tmp = t
else if (y <= 1.9d+119) then
tmp = t * (x / (z - y))
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.4e+145) {
tmp = t;
} else if (y <= 1.9e+119) {
tmp = t * (x / (z - y));
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -4.4e+145: tmp = t elif y <= 1.9e+119: tmp = t * (x / (z - y)) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -4.4e+145) tmp = t; elseif (y <= 1.9e+119) tmp = Float64(t * Float64(x / Float64(z - y))); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -4.4e+145) tmp = t; elseif (y <= 1.9e+119) tmp = t * (x / (z - y)); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -4.4e+145], t, If[LessEqual[y, 1.9e+119], N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.4 \cdot 10^{+145}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{+119}:\\
\;\;\;\;t \cdot \frac{x}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -4.40000000000000017e145 or 1.89999999999999995e119 < y Initial program 99.9%
associate-*l/62.3%
associate-*r/70.5%
Simplified70.5%
Taylor expanded in y around inf 70.7%
if -4.40000000000000017e145 < y < 1.89999999999999995e119Initial program 96.5%
Taylor expanded in x around inf 70.8%
Final simplification70.7%
(FPCore (x y z t) :precision binary64 (if (<= x -3.4e-132) (/ (* t x) (- z y)) (if (<= x 8e+32) (* t (/ y (- y z))) (/ t (/ (- z y) x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -3.4e-132) {
tmp = (t * x) / (z - y);
} else if (x <= 8e+32) {
tmp = t * (y / (y - z));
} else {
tmp = t / ((z - y) / x);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= (-3.4d-132)) then
tmp = (t * x) / (z - y)
else if (x <= 8d+32) then
tmp = t * (y / (y - z))
else
tmp = t / ((z - y) / x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -3.4e-132) {
tmp = (t * x) / (z - y);
} else if (x <= 8e+32) {
tmp = t * (y / (y - z));
} else {
tmp = t / ((z - y) / x);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -3.4e-132: tmp = (t * x) / (z - y) elif x <= 8e+32: tmp = t * (y / (y - z)) else: tmp = t / ((z - y) / x) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -3.4e-132) tmp = Float64(Float64(t * x) / Float64(z - y)); elseif (x <= 8e+32) tmp = Float64(t * Float64(y / Float64(y - z))); else tmp = Float64(t / Float64(Float64(z - y) / x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -3.4e-132) tmp = (t * x) / (z - y); elseif (x <= 8e+32) tmp = t * (y / (y - z)); else tmp = t / ((z - y) / x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -3.4e-132], N[(N[(t * x), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8e+32], N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t / N[(N[(z - y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.4 \cdot 10^{-132}:\\
\;\;\;\;\frac{t \cdot x}{z - y}\\
\mathbf{elif}\;x \leq 8 \cdot 10^{+32}:\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{\frac{z - y}{x}}\\
\end{array}
\end{array}
if x < -3.39999999999999983e-132Initial program 97.3%
associate-*l/89.3%
associate-*r/77.3%
Simplified77.3%
Taylor expanded in x around inf 77.0%
if -3.39999999999999983e-132 < x < 8.00000000000000043e32Initial program 98.2%
Taylor expanded in x around 0 85.1%
neg-mul-185.1%
distribute-neg-frac85.1%
Simplified85.1%
frac-2neg85.1%
div-inv84.9%
remove-double-neg84.9%
sub-neg84.9%
distribute-neg-in84.9%
remove-double-neg84.9%
Applied egg-rr84.9%
associate-*r/85.1%
*-rgt-identity85.1%
+-commutative85.1%
unsub-neg85.1%
Simplified85.1%
if 8.00000000000000043e32 < x Initial program 96.9%
associate-*l/83.5%
associate-*r/82.5%
Simplified82.5%
associate-*r/83.5%
associate-*l/96.9%
*-commutative96.9%
clear-num96.9%
un-div-inv97.0%
Applied egg-rr97.0%
Taylor expanded in x around inf 78.2%
Final simplification80.9%
(FPCore (x y z t) :precision binary64 (if (<= y -7.5e+126) t (if (<= y 1.55e+58) (* x (/ t z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.5e+126) {
tmp = t;
} else if (y <= 1.55e+58) {
tmp = x * (t / z);
} else {
tmp = t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-7.5d+126)) then
tmp = t
else if (y <= 1.55d+58) then
tmp = x * (t / z)
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.5e+126) {
tmp = t;
} else if (y <= 1.55e+58) {
tmp = x * (t / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -7.5e+126: tmp = t elif y <= 1.55e+58: tmp = x * (t / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -7.5e+126) tmp = t; elseif (y <= 1.55e+58) tmp = Float64(x * Float64(t / z)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -7.5e+126) tmp = t; elseif (y <= 1.55e+58) tmp = x * (t / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -7.5e+126], t, If[LessEqual[y, 1.55e+58], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.5 \cdot 10^{+126}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 1.55 \cdot 10^{+58}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -7.5000000000000006e126 or 1.55e58 < y Initial program 99.9%
associate-*l/68.0%
associate-*r/69.8%
Simplified69.8%
Taylor expanded in y around inf 66.0%
if -7.5000000000000006e126 < y < 1.55e58Initial program 96.1%
associate-*l/96.3%
associate-*r/91.2%
Simplified91.2%
associate-*r/96.3%
associate-*l/96.1%
*-commutative96.1%
clear-num95.9%
un-div-inv96.1%
Applied egg-rr96.1%
Taylor expanded in y around 0 58.8%
associate-*l/54.5%
*-commutative54.5%
Simplified54.5%
Final simplification59.0%
(FPCore (x y z t) :precision binary64 (if (<= y -6.8e+127) t (if (<= y 2.3e+58) (* t (/ x z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.8e+127) {
tmp = t;
} else if (y <= 2.3e+58) {
tmp = t * (x / z);
} else {
tmp = t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-6.8d+127)) then
tmp = t
else if (y <= 2.3d+58) then
tmp = t * (x / z)
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.8e+127) {
tmp = t;
} else if (y <= 2.3e+58) {
tmp = t * (x / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -6.8e+127: tmp = t elif y <= 2.3e+58: tmp = t * (x / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -6.8e+127) tmp = t; elseif (y <= 2.3e+58) tmp = Float64(t * Float64(x / z)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -6.8e+127) tmp = t; elseif (y <= 2.3e+58) tmp = t * (x / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -6.8e+127], t, If[LessEqual[y, 2.3e+58], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.8 \cdot 10^{+127}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{+58}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -6.79999999999999955e127 or 2.30000000000000002e58 < y Initial program 99.9%
associate-*l/67.4%
associate-*r/70.1%
Simplified70.1%
Taylor expanded in y around inf 66.3%
if -6.79999999999999955e127 < y < 2.30000000000000002e58Initial program 96.1%
Taylor expanded in y around 0 59.9%
Final simplification62.4%
(FPCore (x y z t) :precision binary64 (if (<= y -3.5e+129) t (if (<= y 1.55e+58) (/ t (/ z x)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.5e+129) {
tmp = t;
} else if (y <= 1.55e+58) {
tmp = t / (z / x);
} else {
tmp = t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= (-3.5d+129)) then
tmp = t
else if (y <= 1.55d+58) then
tmp = t / (z / x)
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.5e+129) {
tmp = t;
} else if (y <= 1.55e+58) {
tmp = t / (z / x);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.5e+129: tmp = t elif y <= 1.55e+58: tmp = t / (z / x) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.5e+129) tmp = t; elseif (y <= 1.55e+58) tmp = Float64(t / Float64(z / x)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -3.5e+129) tmp = t; elseif (y <= 1.55e+58) tmp = t / (z / x); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.5e+129], t, If[LessEqual[y, 1.55e+58], N[(t / N[(z / x), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.5 \cdot 10^{+129}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 1.55 \cdot 10^{+58}:\\
\;\;\;\;\frac{t}{\frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -3.4999999999999998e129 or 1.55e58 < y Initial program 99.9%
associate-*l/67.4%
associate-*r/70.1%
Simplified70.1%
Taylor expanded in y around inf 66.3%
if -3.4999999999999998e129 < y < 1.55e58Initial program 96.1%
associate-*l/96.4%
associate-*r/90.7%
Simplified90.7%
Taylor expanded in y around 0 58.7%
associate-/l*59.9%
Simplified59.9%
Final simplification62.4%
(FPCore (x y z t) :precision binary64 (* t (/ (- x y) (- z y))))
double code(double x, double y, double z, double t) {
return t * ((x - y) / (z - y));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = t * ((x - y) / (z - y))
end function
public static double code(double x, double y, double z, double t) {
return t * ((x - y) / (z - y));
}
def code(x, y, z, t): return t * ((x - y) / (z - y))
function code(x, y, z, t) return Float64(t * Float64(Float64(x - y) / Float64(z - y))) end
function tmp = code(x, y, z, t) tmp = t * ((x - y) / (z - y)); end
code[x_, y_, z_, t_] := N[(t * N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
t \cdot \frac{x - y}{z - y}
\end{array}
Initial program 97.6%
Final simplification97.6%
(FPCore (x y z t) :precision binary64 t)
double code(double x, double y, double z, double t) {
return t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = t
end function
public static double code(double x, double y, double z, double t) {
return t;
}
def code(x, y, z, t): return t
function code(x, y, z, t) return t end
function tmp = code(x, y, z, t) tmp = t; end
code[x_, y_, z_, t_] := t
\begin{array}{l}
\\
t
\end{array}
Initial program 97.6%
associate-*l/85.3%
associate-*r/82.8%
Simplified82.8%
Taylor expanded in y around inf 32.8%
Final simplification32.8%
(FPCore (x y z t) :precision binary64 (/ t (/ (- z y) (- x y))))
double code(double x, double y, double z, double t) {
return t / ((z - y) / (x - y));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = t / ((z - y) / (x - y))
end function
public static double code(double x, double y, double z, double t) {
return t / ((z - y) / (x - y));
}
def code(x, y, z, t): return t / ((z - y) / (x - y))
function code(x, y, z, t) return Float64(t / Float64(Float64(z - y) / Float64(x - y))) end
function tmp = code(x, y, z, t) tmp = t / ((z - y) / (x - y)); end
code[x_, y_, z_, t_] := N[(t / N[(N[(z - y), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{t}{\frac{z - y}{x - y}}
\end{array}
herbie shell --seed 2023196
(FPCore (x y z t)
:name "Numeric.Signal.Multichannel:$cput from hsignal-0.2.7.1"
:precision binary64
:herbie-target
(/ t (/ (- z y) (- x y)))
(* (/ (- x y) (- z y)) t))