
(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 12 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 98.3%
associate-*l/79.9%
associate-*r/82.9%
Simplified82.9%
associate-*r/79.9%
associate-*l/98.3%
*-commutative98.3%
clear-num98.4%
un-div-inv98.6%
Applied egg-rr98.6%
Final simplification98.6%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.35e+20)
t
(if (<= y 0.95)
(* x (/ t (- z y)))
(if (<= y 9e+65)
t
(if (<= y 5.8e+99)
(* y (/ (- t) z))
(if (<= y 1.95e+111) (/ (* t x) z) t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.35e+20) {
tmp = t;
} else if (y <= 0.95) {
tmp = x * (t / (z - y));
} else if (y <= 9e+65) {
tmp = t;
} else if (y <= 5.8e+99) {
tmp = y * (-t / z);
} else if (y <= 1.95e+111) {
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 <= (-1.35d+20)) then
tmp = t
else if (y <= 0.95d0) then
tmp = x * (t / (z - y))
else if (y <= 9d+65) then
tmp = t
else if (y <= 5.8d+99) then
tmp = y * (-t / z)
else if (y <= 1.95d+111) 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 <= -1.35e+20) {
tmp = t;
} else if (y <= 0.95) {
tmp = x * (t / (z - y));
} else if (y <= 9e+65) {
tmp = t;
} else if (y <= 5.8e+99) {
tmp = y * (-t / z);
} else if (y <= 1.95e+111) {
tmp = (t * x) / z;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.35e+20: tmp = t elif y <= 0.95: tmp = x * (t / (z - y)) elif y <= 9e+65: tmp = t elif y <= 5.8e+99: tmp = y * (-t / z) elif y <= 1.95e+111: tmp = (t * x) / z else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.35e+20) tmp = t; elseif (y <= 0.95) tmp = Float64(x * Float64(t / Float64(z - y))); elseif (y <= 9e+65) tmp = t; elseif (y <= 5.8e+99) tmp = Float64(y * Float64(Float64(-t) / z)); elseif (y <= 1.95e+111) tmp = Float64(Float64(t * x) / z); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.35e+20) tmp = t; elseif (y <= 0.95) tmp = x * (t / (z - y)); elseif (y <= 9e+65) tmp = t; elseif (y <= 5.8e+99) tmp = y * (-t / z); elseif (y <= 1.95e+111) tmp = (t * x) / z; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.35e+20], t, If[LessEqual[y, 0.95], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9e+65], t, If[LessEqual[y, 5.8e+99], N[(y * N[((-t) / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.95e+111], N[(N[(t * x), $MachinePrecision] / z), $MachinePrecision], t]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.35 \cdot 10^{+20}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 0.95:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{elif}\;y \leq 9 \cdot 10^{+65}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 5.8 \cdot 10^{+99}:\\
\;\;\;\;y \cdot \frac{-t}{z}\\
\mathbf{elif}\;y \leq 1.95 \cdot 10^{+111}:\\
\;\;\;\;\frac{t \cdot x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.35e20 or 0.94999999999999996 < y < 9e65 or 1.9499999999999999e111 < y Initial program 99.8%
associate-*l/66.9%
associate-*r/75.5%
Simplified75.5%
Taylor expanded in y around inf 68.6%
if -1.35e20 < y < 0.94999999999999996Initial program 96.6%
associate-*l/92.6%
associate-*r/91.1%
Simplified91.1%
Taylor expanded in x around inf 74.4%
associate-*l/73.5%
*-commutative73.5%
Simplified73.5%
if 9e65 < y < 5.8000000000000004e99Initial program 99.2%
associate-*l/99.6%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in x around 0 80.8%
mul-1-neg80.8%
associate-/l*80.8%
Simplified80.8%
Taylor expanded in y around 0 63.9%
*-commutative63.9%
associate-/l*64.1%
Simplified64.1%
associate-/r/64.3%
Applied egg-rr64.3%
if 5.8000000000000004e99 < y < 1.9499999999999999e111Initial program 99.5%
associate-*l/100.0%
associate-*r/37.4%
Simplified37.4%
Taylor expanded in y around 0 68.7%
Final simplification70.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- x y) (/ t z))))
(if (<= y -9e+30)
t
(if (<= y -6.8e-184)
t_1
(if (<= y 1.9e-48) (* x (/ t (- z y))) (if (<= y 7e+93) t_1 t))))))
double code(double x, double y, double z, double t) {
double t_1 = (x - y) * (t / z);
double tmp;
if (y <= -9e+30) {
tmp = t;
} else if (y <= -6.8e-184) {
tmp = t_1;
} else if (y <= 1.9e-48) {
tmp = x * (t / (z - y));
} else if (y <= 7e+93) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (x - y) * (t / z)
if (y <= (-9d+30)) then
tmp = t
else if (y <= (-6.8d-184)) then
tmp = t_1
else if (y <= 1.9d-48) then
tmp = x * (t / (z - y))
else if (y <= 7d+93) then
tmp = t_1
else
tmp = t
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);
double tmp;
if (y <= -9e+30) {
tmp = t;
} else if (y <= -6.8e-184) {
tmp = t_1;
} else if (y <= 1.9e-48) {
tmp = x * (t / (z - y));
} else if (y <= 7e+93) {
tmp = t_1;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x - y) * (t / z) tmp = 0 if y <= -9e+30: tmp = t elif y <= -6.8e-184: tmp = t_1 elif y <= 1.9e-48: tmp = x * (t / (z - y)) elif y <= 7e+93: tmp = t_1 else: tmp = t return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x - y) * Float64(t / z)) tmp = 0.0 if (y <= -9e+30) tmp = t; elseif (y <= -6.8e-184) tmp = t_1; elseif (y <= 1.9e-48) tmp = Float64(x * Float64(t / Float64(z - y))); elseif (y <= 7e+93) tmp = t_1; else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x - y) * (t / z); tmp = 0.0; if (y <= -9e+30) tmp = t; elseif (y <= -6.8e-184) tmp = t_1; elseif (y <= 1.9e-48) tmp = x * (t / (z - y)); elseif (y <= 7e+93) tmp = t_1; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -9e+30], t, If[LessEqual[y, -6.8e-184], t$95$1, If[LessEqual[y, 1.9e-48], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7e+93], t$95$1, t]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x - y\right) \cdot \frac{t}{z}\\
\mathbf{if}\;y \leq -9 \cdot 10^{+30}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq -6.8 \cdot 10^{-184}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{-48}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{elif}\;y \leq 7 \cdot 10^{+93}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -8.9999999999999999e30 or 6.99999999999999996e93 < y Initial program 99.8%
associate-*l/64.3%
associate-*r/73.0%
Simplified73.0%
Taylor expanded in y around inf 70.8%
if -8.9999999999999999e30 < y < -6.80000000000000008e-184 or 1.90000000000000001e-48 < y < 6.99999999999999996e93Initial program 97.0%
associate-*l/94.5%
associate-*r/93.2%
Simplified93.2%
Taylor expanded in z around inf 64.7%
if -6.80000000000000008e-184 < y < 1.90000000000000001e-48Initial program 97.3%
associate-*l/91.6%
associate-*r/89.2%
Simplified89.2%
Taylor expanded in x around inf 78.2%
associate-*l/79.6%
*-commutative79.6%
Simplified79.6%
Final simplification71.5%
(FPCore (x y z t)
:precision binary64
(if (<= y -6.4e+20)
t
(if (<= y 1.16e+44)
(* t (/ x (- z y)))
(if (<= y 5.4e+93)
(* (- x y) (/ t z))
(if (<= y 1.2e+109) (/ (* t x) z) t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.4e+20) {
tmp = t;
} else if (y <= 1.16e+44) {
tmp = t * (x / (z - y));
} else if (y <= 5.4e+93) {
tmp = (x - y) * (t / z);
} else if (y <= 1.2e+109) {
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.4d+20)) then
tmp = t
else if (y <= 1.16d+44) then
tmp = t * (x / (z - y))
else if (y <= 5.4d+93) then
tmp = (x - y) * (t / z)
else if (y <= 1.2d+109) 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.4e+20) {
tmp = t;
} else if (y <= 1.16e+44) {
tmp = t * (x / (z - y));
} else if (y <= 5.4e+93) {
tmp = (x - y) * (t / z);
} else if (y <= 1.2e+109) {
tmp = (t * x) / z;
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -6.4e+20: tmp = t elif y <= 1.16e+44: tmp = t * (x / (z - y)) elif y <= 5.4e+93: tmp = (x - y) * (t / z) elif y <= 1.2e+109: tmp = (t * x) / z else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -6.4e+20) tmp = t; elseif (y <= 1.16e+44) tmp = Float64(t * Float64(x / Float64(z - y))); elseif (y <= 5.4e+93) tmp = Float64(Float64(x - y) * Float64(t / z)); elseif (y <= 1.2e+109) tmp = Float64(Float64(t * x) / z); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -6.4e+20) tmp = t; elseif (y <= 1.16e+44) tmp = t * (x / (z - y)); elseif (y <= 5.4e+93) tmp = (x - y) * (t / z); elseif (y <= 1.2e+109) tmp = (t * x) / z; else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -6.4e+20], t, If[LessEqual[y, 1.16e+44], N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.4e+93], N[(N[(x - y), $MachinePrecision] * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.2e+109], N[(N[(t * x), $MachinePrecision] / z), $MachinePrecision], t]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.4 \cdot 10^{+20}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 1.16 \cdot 10^{+44}:\\
\;\;\;\;t \cdot \frac{x}{z - y}\\
\mathbf{elif}\;y \leq 5.4 \cdot 10^{+93}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z}\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{+109}:\\
\;\;\;\;\frac{t \cdot x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -6.4e20 or 1.19999999999999994e109 < y Initial program 99.8%
associate-*l/63.2%
associate-*r/74.4%
Simplified74.4%
Taylor expanded in y around inf 71.2%
if -6.4e20 < y < 1.1600000000000001e44Initial program 96.9%
Taylor expanded in x around inf 74.5%
if 1.1600000000000001e44 < y < 5.3999999999999999e93Initial program 99.2%
associate-*l/99.4%
associate-*r/100.0%
Simplified100.0%
Taylor expanded in z around inf 63.5%
if 5.3999999999999999e93 < y < 1.19999999999999994e109Initial program 99.4%
associate-*l/100.0%
associate-*r/62.4%
Simplified62.4%
Taylor expanded in y around 0 80.8%
Final simplification72.8%
(FPCore (x y z t) :precision binary64 (if (<= y -8.2e+120) (/ t (- 1.0 (/ z y))) (if (<= y 6.8e+108) (* (- x y) (/ t (- z y))) (* t (/ (- y x) y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -8.2e+120) {
tmp = t / (1.0 - (z / y));
} else if (y <= 6.8e+108) {
tmp = (x - y) * (t / (z - y));
} else {
tmp = t * ((y - 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 <= (-8.2d+120)) then
tmp = t / (1.0d0 - (z / y))
else if (y <= 6.8d+108) then
tmp = (x - y) * (t / (z - y))
else
tmp = t * ((y - x) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -8.2e+120) {
tmp = t / (1.0 - (z / y));
} else if (y <= 6.8e+108) {
tmp = (x - y) * (t / (z - y));
} else {
tmp = t * ((y - x) / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -8.2e+120: tmp = t / (1.0 - (z / y)) elif y <= 6.8e+108: tmp = (x - y) * (t / (z - y)) else: tmp = t * ((y - x) / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -8.2e+120) tmp = Float64(t / Float64(1.0 - Float64(z / y))); elseif (y <= 6.8e+108) tmp = Float64(Float64(x - y) * Float64(t / Float64(z - y))); else tmp = Float64(t * Float64(Float64(y - x) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -8.2e+120) tmp = t / (1.0 - (z / y)); elseif (y <= 6.8e+108) tmp = (x - y) * (t / (z - y)); else tmp = t * ((y - x) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -8.2e+120], N[(t / N[(1.0 - N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.8e+108], N[(N[(x - y), $MachinePrecision] * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(y - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.2 \cdot 10^{+120}:\\
\;\;\;\;\frac{t}{1 - \frac{z}{y}}\\
\mathbf{elif}\;y \leq 6.8 \cdot 10^{+108}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y - x}{y}\\
\end{array}
\end{array}
if y < -8.2e120Initial program 99.8%
associate-*l/61.9%
associate-*r/69.4%
Simplified69.4%
associate-*r/61.9%
associate-*l/99.8%
*-commutative99.8%
clear-num99.9%
un-div-inv100.0%
Applied egg-rr100.0%
Taylor expanded in x around 0 97.5%
associate-*r/97.5%
neg-mul-197.5%
Simplified97.5%
Taylor expanded in z around 0 97.5%
mul-1-neg97.5%
unsub-neg97.5%
Simplified97.5%
if -8.2e120 < y < 6.79999999999999992e108Initial program 97.6%
associate-*l/89.8%
associate-*r/90.7%
Simplified90.7%
if 6.79999999999999992e108 < y Initial program 99.7%
Taylor expanded in z around 0 84.3%
associate-*r/84.3%
neg-mul-184.3%
neg-sub084.3%
associate--r-84.3%
neg-sub084.3%
Simplified84.3%
Final simplification90.5%
(FPCore (x y z t) :precision binary64 (if (or (<= x -8e+121) (not (<= x 2.7e+149))) (* t (/ x (- z y))) (/ t (- 1.0 (/ z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -8e+121) || !(x <= 2.7e+149)) {
tmp = t * (x / (z - y));
} else {
tmp = t / (1.0 - (z / 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 ((x <= (-8d+121)) .or. (.not. (x <= 2.7d+149))) then
tmp = t * (x / (z - y))
else
tmp = t / (1.0d0 - (z / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -8e+121) || !(x <= 2.7e+149)) {
tmp = t * (x / (z - y));
} else {
tmp = t / (1.0 - (z / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -8e+121) or not (x <= 2.7e+149): tmp = t * (x / (z - y)) else: tmp = t / (1.0 - (z / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -8e+121) || !(x <= 2.7e+149)) tmp = Float64(t * Float64(x / Float64(z - y))); else tmp = Float64(t / Float64(1.0 - Float64(z / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -8e+121) || ~((x <= 2.7e+149))) tmp = t * (x / (z - y)); else tmp = t / (1.0 - (z / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -8e+121], N[Not[LessEqual[x, 2.7e+149]], $MachinePrecision]], N[(t * N[(x / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t / N[(1.0 - N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8 \cdot 10^{+121} \lor \neg \left(x \leq 2.7 \cdot 10^{+149}\right):\\
\;\;\;\;t \cdot \frac{x}{z - y}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{1 - \frac{z}{y}}\\
\end{array}
\end{array}
if x < -8.0000000000000003e121 or 2.7000000000000001e149 < x Initial program 97.1%
Taylor expanded in x around inf 89.5%
if -8.0000000000000003e121 < x < 2.7000000000000001e149Initial program 98.8%
associate-*l/78.6%
associate-*r/83.5%
Simplified83.5%
associate-*r/78.6%
associate-*l/98.8%
*-commutative98.8%
clear-num98.8%
un-div-inv98.9%
Applied egg-rr98.9%
Taylor expanded in x around 0 77.3%
associate-*r/77.3%
neg-mul-177.3%
Simplified77.3%
Taylor expanded in z around 0 77.3%
mul-1-neg77.3%
unsub-neg77.3%
Simplified77.3%
Final simplification80.6%
(FPCore (x y z t) :precision binary64 (if (<= y -1.16e+60) t (if (<= y 4.2e+109) (* t (/ (- x y) z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.16e+60) {
tmp = t;
} else if (y <= 4.2e+109) {
tmp = t * ((x - y) / 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 <= (-1.16d+60)) then
tmp = t
else if (y <= 4.2d+109) then
tmp = t * ((x - y) / 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 <= -1.16e+60) {
tmp = t;
} else if (y <= 4.2e+109) {
tmp = t * ((x - y) / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.16e+60: tmp = t elif y <= 4.2e+109: tmp = t * ((x - y) / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.16e+60) tmp = t; elseif (y <= 4.2e+109) tmp = Float64(t * Float64(Float64(x - y) / z)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.16e+60) tmp = t; elseif (y <= 4.2e+109) tmp = t * ((x - y) / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.16e+60], t, If[LessEqual[y, 4.2e+109], N[(t * N[(N[(x - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.16 \cdot 10^{+60}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{+109}:\\
\;\;\;\;t \cdot \frac{x - y}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.15999999999999996e60 or 4.2000000000000003e109 < y Initial program 99.8%
associate-*l/60.5%
associate-*r/72.3%
Simplified72.3%
Taylor expanded in y around inf 75.5%
if -1.15999999999999996e60 < y < 4.2000000000000003e109Initial program 97.4%
Taylor expanded in z around inf 71.1%
Final simplification72.9%
(FPCore (x y z t) :precision binary64 (if (<= y -9.1e-10) t (if (<= y 0.37) (* x (/ t z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -9.1e-10) {
tmp = t;
} else if (y <= 0.37) {
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 <= (-9.1d-10)) then
tmp = t
else if (y <= 0.37d0) 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 <= -9.1e-10) {
tmp = t;
} else if (y <= 0.37) {
tmp = x * (t / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -9.1e-10: tmp = t elif y <= 0.37: tmp = x * (t / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -9.1e-10) tmp = t; elseif (y <= 0.37) 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 <= -9.1e-10) tmp = t; elseif (y <= 0.37) tmp = x * (t / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -9.1e-10], t, If[LessEqual[y, 0.37], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.1 \cdot 10^{-10}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 0.37:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -9.0999999999999996e-10 or 0.37 < y Initial program 99.8%
associate-*l/69.9%
associate-*r/76.4%
Simplified76.4%
Taylor expanded in y around inf 64.5%
if -9.0999999999999996e-10 < y < 0.37Initial program 96.6%
associate-*l/92.5%
associate-*r/90.9%
Simplified90.9%
Taylor expanded in x around inf 74.9%
associate-*l/74.1%
*-commutative74.1%
Simplified74.1%
Taylor expanded in z around inf 65.3%
Final simplification64.9%
(FPCore (x y z t) :precision binary64 (if (<= y -56000000.0) t (if (<= y 0.55) (* t (/ x z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -56000000.0) {
tmp = t;
} else if (y <= 0.55) {
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 <= (-56000000.0d0)) then
tmp = t
else if (y <= 0.55d0) 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 <= -56000000.0) {
tmp = t;
} else if (y <= 0.55) {
tmp = t * (x / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -56000000.0: tmp = t elif y <= 0.55: tmp = t * (x / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -56000000.0) tmp = t; elseif (y <= 0.55) 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 <= -56000000.0) tmp = t; elseif (y <= 0.55) tmp = t * (x / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -56000000.0], t, If[LessEqual[y, 0.55], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -56000000:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 0.55:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -5.6e7 or 0.55000000000000004 < y Initial program 99.8%
associate-*l/69.9%
associate-*r/76.4%
Simplified76.4%
Taylor expanded in y around inf 64.5%
if -5.6e7 < y < 0.55000000000000004Initial program 96.6%
Taylor expanded in y around 0 69.7%
Final simplification66.8%
(FPCore (x y z t) :precision binary64 (if (<= y -0.0022) t (if (<= y 0.29) (/ t (/ z x)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -0.0022) {
tmp = t;
} else if (y <= 0.29) {
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 <= (-0.0022d0)) then
tmp = t
else if (y <= 0.29d0) 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 <= -0.0022) {
tmp = t;
} else if (y <= 0.29) {
tmp = t / (z / x);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -0.0022: tmp = t elif y <= 0.29: tmp = t / (z / x) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -0.0022) tmp = t; elseif (y <= 0.29) 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 <= -0.0022) tmp = t; elseif (y <= 0.29) tmp = t / (z / x); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -0.0022], t, If[LessEqual[y, 0.29], N[(t / N[(z / x), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.0022:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 0.29:\\
\;\;\;\;\frac{t}{\frac{z}{x}}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -0.00220000000000000013 or 0.28999999999999998 < y Initial program 99.8%
associate-*l/69.9%
associate-*r/76.4%
Simplified76.4%
Taylor expanded in y around inf 64.5%
if -0.00220000000000000013 < y < 0.28999999999999998Initial program 96.6%
associate-*l/92.5%
associate-*r/90.9%
Simplified90.9%
Taylor expanded in y around 0 66.2%
associate-/l*70.3%
Simplified70.3%
Final simplification67.1%
(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 98.3%
Final simplification98.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 98.3%
associate-*l/79.9%
associate-*r/82.9%
Simplified82.9%
Taylor expanded in y around inf 41.7%
Final simplification41.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 2023181
(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))