
(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 11 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.3%
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6497.5%
Applied egg-rr97.5%
(FPCore (x y z t) :precision binary64 (if (<= y -2.5e+225) t (if (<= y 3.05e+156) (* (- x y) (/ t (- z y))) (* t (- 1.0 (/ x y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.5e+225) {
tmp = t;
} else if (y <= 3.05e+156) {
tmp = (x - y) * (t / (z - y));
} else {
tmp = t * (1.0 - (x / y));
}
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 <= (-2.5d+225)) then
tmp = t
else if (y <= 3.05d+156) then
tmp = (x - y) * (t / (z - y))
else
tmp = t * (1.0d0 - (x / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.5e+225) {
tmp = t;
} else if (y <= 3.05e+156) {
tmp = (x - y) * (t / (z - y));
} else {
tmp = t * (1.0 - (x / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.5e+225: tmp = t elif y <= 3.05e+156: tmp = (x - y) * (t / (z - y)) else: tmp = t * (1.0 - (x / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.5e+225) tmp = t; elseif (y <= 3.05e+156) tmp = Float64(Float64(x - y) * Float64(t / Float64(z - y))); else tmp = Float64(t * Float64(1.0 - Float64(x / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -2.5e+225) tmp = t; elseif (y <= 3.05e+156) tmp = (x - y) * (t / (z - y)); else tmp = t * (1.0 - (x / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.5e+225], t, If[LessEqual[y, 3.05e+156], N[(N[(x - y), $MachinePrecision] * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.5 \cdot 10^{+225}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 3.05 \cdot 10^{+156}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\
\end{array}
\end{array}
if y < -2.4999999999999999e225Initial program 100.0%
Taylor expanded in y around inf
Simplified100.0%
if -2.4999999999999999e225 < y < 3.0500000000000001e156Initial program 96.5%
associate-*l/N/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6491.3%
Applied egg-rr91.3%
if 3.0500000000000001e156 < y Initial program 100.0%
Taylor expanded in y around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-lowering-+.f64N/A
associate-*r/N/A
distribute-lft-out--N/A
/-lowering-/.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f6497.2%
Simplified97.2%
Taylor expanded in z around 0
--lowering--.f64N/A
/-lowering-/.f6497.3%
Simplified97.3%
Final simplification92.8%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* t (- 1.0 (/ x y))))) (if (<= y -5.8e-28) t_1 (if (<= y 5e-60) (/ t (/ (- z y) x)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = t * (1.0 - (x / y));
double tmp;
if (y <= -5.8e-28) {
tmp = t_1;
} else if (y <= 5e-60) {
tmp = t / ((z - y) / x);
} 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 = t * (1.0d0 - (x / y))
if (y <= (-5.8d-28)) then
tmp = t_1
else if (y <= 5d-60) then
tmp = t / ((z - y) / x)
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 = t * (1.0 - (x / y));
double tmp;
if (y <= -5.8e-28) {
tmp = t_1;
} else if (y <= 5e-60) {
tmp = t / ((z - y) / x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = t * (1.0 - (x / y)) tmp = 0 if y <= -5.8e-28: tmp = t_1 elif y <= 5e-60: tmp = t / ((z - y) / x) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(1.0 - Float64(x / y))) tmp = 0.0 if (y <= -5.8e-28) tmp = t_1; elseif (y <= 5e-60) tmp = Float64(t / Float64(Float64(z - y) / x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t * (1.0 - (x / y)); tmp = 0.0; if (y <= -5.8e-28) tmp = t_1; elseif (y <= 5e-60) tmp = t / ((z - y) / x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.8e-28], t$95$1, If[LessEqual[y, 5e-60], N[(t / N[(N[(z - y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{if}\;y \leq -5.8 \cdot 10^{-28}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 5 \cdot 10^{-60}:\\
\;\;\;\;\frac{t}{\frac{z - y}{x}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -5.80000000000000026e-28 or 5.0000000000000001e-60 < y Initial program 99.8%
Taylor expanded in y around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-lowering-+.f64N/A
associate-*r/N/A
distribute-lft-out--N/A
/-lowering-/.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f6476.6%
Simplified76.6%
Taylor expanded in z around 0
--lowering--.f64N/A
/-lowering-/.f6477.1%
Simplified77.1%
if -5.80000000000000026e-28 < y < 5.0000000000000001e-60Initial program 93.7%
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f6494.1%
Applied egg-rr94.1%
Taylor expanded in x around inf
/-lowering-/.f64N/A
--lowering--.f6478.6%
Simplified78.6%
Final simplification77.7%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* t (- 1.0 (/ x y))))) (if (<= y -1.3e-32) t_1 (if (<= y 6.6e+39) (* t (/ (- x y) z)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = t * (1.0 - (x / y));
double tmp;
if (y <= -1.3e-32) {
tmp = t_1;
} else if (y <= 6.6e+39) {
tmp = t * ((x - 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 = t * (1.0d0 - (x / y))
if (y <= (-1.3d-32)) then
tmp = t_1
else if (y <= 6.6d+39) then
tmp = t * ((x - 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 = t * (1.0 - (x / y));
double tmp;
if (y <= -1.3e-32) {
tmp = t_1;
} else if (y <= 6.6e+39) {
tmp = t * ((x - y) / z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = t * (1.0 - (x / y)) tmp = 0 if y <= -1.3e-32: tmp = t_1 elif y <= 6.6e+39: tmp = t * ((x - y) / z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(1.0 - Float64(x / y))) tmp = 0.0 if (y <= -1.3e-32) tmp = t_1; elseif (y <= 6.6e+39) tmp = Float64(t * Float64(Float64(x - y) / z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t * (1.0 - (x / y)); tmp = 0.0; if (y <= -1.3e-32) tmp = t_1; elseif (y <= 6.6e+39) tmp = t * ((x - y) / z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.3e-32], t$95$1, If[LessEqual[y, 6.6e+39], N[(t * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{if}\;y \leq -1.3 \cdot 10^{-32}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 6.6 \cdot 10^{+39}:\\
\;\;\;\;t \cdot \frac{x - y}{z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.2999999999999999e-32 or 6.60000000000000042e39 < y Initial program 99.8%
Taylor expanded in y around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-lowering-+.f64N/A
associate-*r/N/A
distribute-lft-out--N/A
/-lowering-/.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f6481.9%
Simplified81.9%
Taylor expanded in z around 0
--lowering--.f64N/A
/-lowering-/.f6482.2%
Simplified82.2%
if -1.2999999999999999e-32 < y < 6.60000000000000042e39Initial program 94.7%
Taylor expanded in z around inf
/-lowering-/.f64N/A
--lowering--.f6473.0%
Simplified73.0%
Final simplification77.6%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* t (- 1.0 (/ x y))))) (if (<= y -3.2e-27) t_1 (if (<= y 1.2e-57) (* t (/ x (- z y))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = t * (1.0 - (x / y));
double tmp;
if (y <= -3.2e-27) {
tmp = t_1;
} else if (y <= 1.2e-57) {
tmp = t * (x / (z - y));
} 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 = t * (1.0d0 - (x / y))
if (y <= (-3.2d-27)) then
tmp = t_1
else if (y <= 1.2d-57) then
tmp = t * (x / (z - y))
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 = t * (1.0 - (x / y));
double tmp;
if (y <= -3.2e-27) {
tmp = t_1;
} else if (y <= 1.2e-57) {
tmp = t * (x / (z - y));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = t * (1.0 - (x / y)) tmp = 0 if y <= -3.2e-27: tmp = t_1 elif y <= 1.2e-57: tmp = t * (x / (z - y)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(1.0 - Float64(x / y))) tmp = 0.0 if (y <= -3.2e-27) tmp = t_1; elseif (y <= 1.2e-57) tmp = Float64(t * Float64(x / Float64(z - y))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t * (1.0 - (x / y)); tmp = 0.0; if (y <= -3.2e-27) tmp = t_1; elseif (y <= 1.2e-57) tmp = t * (x / (z - y)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.2e-27], t$95$1, If[LessEqual[y, 1.2e-57], N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{if}\;y \leq -3.2 \cdot 10^{-27}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{-57}:\\
\;\;\;\;t \cdot \frac{x}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.19999999999999991e-27 or 1.20000000000000003e-57 < y Initial program 99.8%
Taylor expanded in y around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-lowering-+.f64N/A
associate-*r/N/A
distribute-lft-out--N/A
/-lowering-/.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f6476.6%
Simplified76.6%
Taylor expanded in z around 0
--lowering--.f64N/A
/-lowering-/.f6477.1%
Simplified77.1%
if -3.19999999999999991e-27 < y < 1.20000000000000003e-57Initial program 93.7%
Taylor expanded in x around inf
/-lowering-/.f64N/A
--lowering--.f6478.0%
Simplified78.0%
Final simplification77.4%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* t (- 1.0 (/ x y))))) (if (<= y -5e-33) t_1 (if (<= y 1.55e-63) (/ t (/ z x)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = t * (1.0 - (x / y));
double tmp;
if (y <= -5e-33) {
tmp = t_1;
} else if (y <= 1.55e-63) {
tmp = t / (z / x);
} 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 = t * (1.0d0 - (x / y))
if (y <= (-5d-33)) then
tmp = t_1
else if (y <= 1.55d-63) then
tmp = t / (z / x)
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 = t * (1.0 - (x / y));
double tmp;
if (y <= -5e-33) {
tmp = t_1;
} else if (y <= 1.55e-63) {
tmp = t / (z / x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = t * (1.0 - (x / y)) tmp = 0 if y <= -5e-33: tmp = t_1 elif y <= 1.55e-63: tmp = t / (z / x) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(t * Float64(1.0 - Float64(x / y))) tmp = 0.0 if (y <= -5e-33) tmp = t_1; elseif (y <= 1.55e-63) tmp = Float64(t / Float64(z / x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t * (1.0 - (x / y)); tmp = 0.0; if (y <= -5e-33) tmp = t_1; elseif (y <= 1.55e-63) tmp = t / (z / x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5e-33], t$95$1, If[LessEqual[y, 1.55e-63], N[(t / N[(z / x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{if}\;y \leq -5 \cdot 10^{-33}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.55 \cdot 10^{-63}:\\
\;\;\;\;\frac{t}{\frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -5.00000000000000028e-33 or 1.54999999999999992e-63 < y Initial program 99.8%
Taylor expanded in y around inf
associate--l+N/A
distribute-lft-out--N/A
div-subN/A
+-lowering-+.f64N/A
associate-*r/N/A
distribute-lft-out--N/A
/-lowering-/.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f6476.8%
Simplified76.8%
Taylor expanded in z around 0
--lowering--.f64N/A
/-lowering-/.f6477.2%
Simplified77.2%
if -5.00000000000000028e-33 < y < 1.54999999999999992e-63Initial program 93.7%
Taylor expanded in y around 0
/-lowering-/.f6466.4%
Simplified66.4%
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6466.4%
Applied egg-rr66.4%
Final simplification72.7%
(FPCore (x y z t) :precision binary64 (if (<= y -7.8e-32) t (if (<= y 3.9e-55) (/ t (/ z x)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.8e-32) {
tmp = t;
} else if (y <= 3.9e-55) {
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 <= (-7.8d-32)) then
tmp = t
else if (y <= 3.9d-55) 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 <= -7.8e-32) {
tmp = t;
} else if (y <= 3.9e-55) {
tmp = t / (z / x);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -7.8e-32: tmp = t elif y <= 3.9e-55: tmp = t / (z / x) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -7.8e-32) tmp = t; elseif (y <= 3.9e-55) 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 <= -7.8e-32) tmp = t; elseif (y <= 3.9e-55) tmp = t / (z / x); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -7.8e-32], t, If[LessEqual[y, 3.9e-55], N[(t / N[(z / x), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.8 \cdot 10^{-32}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 3.9 \cdot 10^{-55}:\\
\;\;\;\;\frac{t}{\frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -7.8000000000000003e-32 or 3.9e-55 < y Initial program 99.8%
Taylor expanded in y around inf
Simplified62.0%
if -7.8000000000000003e-32 < y < 3.9e-55Initial program 93.7%
Taylor expanded in y around 0
/-lowering-/.f6465.8%
Simplified65.8%
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6465.8%
Applied egg-rr65.8%
(FPCore (x y z t) :precision binary64 (if (<= y -2.8e-31) t (if (<= y 1.22e-52) (* t (/ x z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -2.8e-31) {
tmp = t;
} else if (y <= 1.22e-52) {
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 <= (-2.8d-31)) then
tmp = t
else if (y <= 1.22d-52) 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 <= -2.8e-31) {
tmp = t;
} else if (y <= 1.22e-52) {
tmp = t * (x / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -2.8e-31: tmp = t elif y <= 1.22e-52: tmp = t * (x / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -2.8e-31) tmp = t; elseif (y <= 1.22e-52) 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 <= -2.8e-31) tmp = t; elseif (y <= 1.22e-52) tmp = t * (x / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -2.8e-31], t, If[LessEqual[y, 1.22e-52], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{-31}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 1.22 \cdot 10^{-52}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -2.7999999999999999e-31 or 1.22e-52 < y Initial program 99.8%
Taylor expanded in y around inf
Simplified62.0%
if -2.7999999999999999e-31 < y < 1.22e-52Initial program 93.7%
Taylor expanded in y around 0
/-lowering-/.f6465.8%
Simplified65.8%
Final simplification63.6%
(FPCore (x y z t) :precision binary64 (if (<= y -5.5e-33) t (if (<= y 3.3e-55) (* x (/ t z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.5e-33) {
tmp = t;
} else if (y <= 3.3e-55) {
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 <= (-5.5d-33)) then
tmp = t
else if (y <= 3.3d-55) 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 <= -5.5e-33) {
tmp = t;
} else if (y <= 3.3e-55) {
tmp = x * (t / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -5.5e-33: tmp = t elif y <= 3.3e-55: tmp = x * (t / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -5.5e-33) tmp = t; elseif (y <= 3.3e-55) 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 <= -5.5e-33) tmp = t; elseif (y <= 3.3e-55) tmp = x * (t / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -5.5e-33], t, If[LessEqual[y, 3.3e-55], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.5 \cdot 10^{-33}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 3.3 \cdot 10^{-55}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -5.5e-33 or 3.2999999999999999e-55 < y Initial program 99.8%
Taylor expanded in y around inf
Simplified62.0%
if -5.5e-33 < y < 3.2999999999999999e-55Initial program 93.7%
Taylor expanded in y around 0
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6463.0%
Simplified63.0%
(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.3%
Final simplification97.3%
(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.3%
Taylor expanded in y around inf
Simplified39.7%
(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 2024138
(FPCore (x y z t)
:name "Numeric.Signal.Multichannel:$cput from hsignal-0.2.7.1"
:precision binary64
:alt
(! :herbie-platform default (/ t (/ (- z y) (- x y))))
(* (/ (- x y) (- z y)) t))