
(FPCore (x y z t) :precision binary64 (+ (* (/ x y) (- z t)) t))
double code(double x, double y, double z, double t) {
return ((x / y) * (z - t)) + 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 - t)) + t
end function
public static double code(double x, double y, double z, double t) {
return ((x / y) * (z - t)) + t;
}
def code(x, y, z, t): return ((x / y) * (z - t)) + t
function code(x, y, z, t) return Float64(Float64(Float64(x / y) * Float64(z - t)) + t) end
function tmp = code(x, y, z, t) tmp = ((x / y) * (z - t)) + t; end
code[x_, y_, z_, t_] := N[(N[(N[(x / y), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} \cdot \left(z - t\right) + t
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (* (/ x y) (- z t)) t))
double code(double x, double y, double z, double t) {
return ((x / y) * (z - t)) + 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 - t)) + t
end function
public static double code(double x, double y, double z, double t) {
return ((x / y) * (z - t)) + t;
}
def code(x, y, z, t): return ((x / y) * (z - t)) + t
function code(x, y, z, t) return Float64(Float64(Float64(x / y) * Float64(z - t)) + t) end
function tmp = code(x, y, z, t) tmp = ((x / y) * (z - t)) + t; end
code[x_, y_, z_, t_] := N[(N[(N[(x / y), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} \cdot \left(z - t\right) + t
\end{array}
(FPCore (x y z t) :precision binary64 (let* ((t_1 (+ t (* (/ x y) (- z t))))) (if (<= t_1 (- INFINITY)) (+ t (/ x (/ y (* t (+ -1.0 (/ z t)))))) t_1)))
double code(double x, double y, double z, double t) {
double t_1 = t + ((x / y) * (z - t));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = t + (x / (y / (t * (-1.0 + (z / t)))));
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = t + ((x / y) * (z - t));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = t + (x / (y / (t * (-1.0 + (z / t)))));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = t + ((x / y) * (z - t)) tmp = 0 if t_1 <= -math.inf: tmp = t + (x / (y / (t * (-1.0 + (z / t))))) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(t + Float64(Float64(x / y) * Float64(z - t))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(t + Float64(x / Float64(y / Float64(t * Float64(-1.0 + Float64(z / t)))))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t + ((x / y) * (z - t)); tmp = 0.0; if (t_1 <= -Inf) tmp = t + (x / (y / (t * (-1.0 + (z / t))))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t + N[(N[(x / y), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(t + N[(x / N[(y / N[(t * N[(-1.0 + N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t + \frac{x}{y} \cdot \left(z - t\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;t + \frac{x}{\frac{y}{t \cdot \left(-1 + \frac{z}{t}\right)}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 (*.f64 (/.f64 x y) (-.f64 z t)) t) < -inf.0Initial program 90.0%
associate-*l/N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6499.9%
Applied egg-rr99.9%
Taylor expanded in t around inf
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64100.0%
Simplified100.0%
if -inf.0 < (+.f64 (*.f64 (/.f64 x y) (-.f64 z t)) t) Initial program 98.0%
Final simplification98.4%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (+ t (* (/ x y) (- z t))))) (if (<= t_1 (- INFINITY)) (/ x (/ y (- z t))) t_1)))
double code(double x, double y, double z, double t) {
double t_1 = t + ((x / y) * (z - t));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = x / (y / (z - t));
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = t + ((x / y) * (z - t));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = x / (y / (z - t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = t + ((x / y) * (z - t)) tmp = 0 if t_1 <= -math.inf: tmp = x / (y / (z - t)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(t + Float64(Float64(x / y) * Float64(z - t))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(x / Float64(y / Float64(z - t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = t + ((x / y) * (z - t)); tmp = 0.0; if (t_1 <= -Inf) tmp = x / (y / (z - t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t + N[(N[(x / y), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(x / N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t + \frac{x}{y} \cdot \left(z - t\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{x}{\frac{y}{z - t}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 (*.f64 (/.f64 x y) (-.f64 z t)) t) < -inf.0Initial program 90.0%
+-commutativeN/A
+-lowering-+.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6499.9%
Simplified99.9%
Taylor expanded in x around inf
div-subN/A
associate-/l*N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6499.9%
Simplified99.9%
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6499.9%
Applied egg-rr99.9%
if -inf.0 < (+.f64 (*.f64 (/.f64 x y) (-.f64 z t)) t) Initial program 98.0%
Final simplification98.4%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -5000.0) (/ x (/ y (- z t))) (if (<= (/ x y) 5e-7) (+ t (* (/ x y) z)) (* x (/ (- z t) y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -5000.0) {
tmp = x / (y / (z - t));
} else if ((x / y) <= 5e-7) {
tmp = t + ((x / y) * z);
} else {
tmp = x * ((z - t) / 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 / y) <= (-5000.0d0)) then
tmp = x / (y / (z - t))
else if ((x / y) <= 5d-7) then
tmp = t + ((x / y) * z)
else
tmp = x * ((z - t) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -5000.0) {
tmp = x / (y / (z - t));
} else if ((x / y) <= 5e-7) {
tmp = t + ((x / y) * z);
} else {
tmp = x * ((z - t) / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -5000.0: tmp = x / (y / (z - t)) elif (x / y) <= 5e-7: tmp = t + ((x / y) * z) else: tmp = x * ((z - t) / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -5000.0) tmp = Float64(x / Float64(y / Float64(z - t))); elseif (Float64(x / y) <= 5e-7) tmp = Float64(t + Float64(Float64(x / y) * z)); else tmp = Float64(x * Float64(Float64(z - t) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -5000.0) tmp = x / (y / (z - t)); elseif ((x / y) <= 5e-7) tmp = t + ((x / y) * z); else tmp = x * ((z - t) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -5000.0], N[(x / N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 5e-7], N[(t + N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(z - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -5000:\\
\;\;\;\;\frac{x}{\frac{y}{z - t}}\\
\mathbf{elif}\;\frac{x}{y} \leq 5 \cdot 10^{-7}:\\
\;\;\;\;t + \frac{x}{y} \cdot z\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{z - t}{y}\\
\end{array}
\end{array}
if (/.f64 x y) < -5e3Initial program 94.5%
+-commutativeN/A
+-lowering-+.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6494.8%
Simplified94.8%
Taylor expanded in x around inf
div-subN/A
associate-/l*N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6494.4%
Simplified94.4%
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6495.9%
Applied egg-rr95.9%
if -5e3 < (/.f64 x y) < 4.99999999999999977e-7Initial program 99.0%
Taylor expanded in z around inf
Simplified98.2%
if 4.99999999999999977e-7 < (/.f64 x y) Initial program 94.3%
+-commutativeN/A
+-lowering-+.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6491.9%
Simplified91.9%
Taylor expanded in x around inf
div-subN/A
associate-/l*N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6488.1%
Simplified88.1%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6490.5%
Applied egg-rr90.5%
Final simplification95.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ (- z t) y))))
(if (<= (/ x y) -5000.0)
t_1
(if (<= (/ x y) 5e-7) (+ t (* (/ x y) z)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((z - t) / y);
double tmp;
if ((x / y) <= -5000.0) {
tmp = t_1;
} else if ((x / y) <= 5e-7) {
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 = x * ((z - t) / y)
if ((x / y) <= (-5000.0d0)) then
tmp = t_1
else if ((x / y) <= 5d-7) 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 = x * ((z - t) / y);
double tmp;
if ((x / y) <= -5000.0) {
tmp = t_1;
} else if ((x / y) <= 5e-7) {
tmp = t + ((x / y) * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((z - t) / y) tmp = 0 if (x / y) <= -5000.0: tmp = t_1 elif (x / y) <= 5e-7: tmp = t + ((x / y) * z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(z - t) / y)) tmp = 0.0 if (Float64(x / y) <= -5000.0) tmp = t_1; elseif (Float64(x / y) <= 5e-7) 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 = x * ((z - t) / y); tmp = 0.0; if ((x / y) <= -5000.0) tmp = t_1; elseif ((x / y) <= 5e-7) tmp = t + ((x / y) * z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(z - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -5000.0], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 5e-7], N[(t + N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{z - t}{y}\\
\mathbf{if}\;\frac{x}{y} \leq -5000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq 5 \cdot 10^{-7}:\\
\;\;\;\;t + \frac{x}{y} \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 x y) < -5e3 or 4.99999999999999977e-7 < (/.f64 x y) Initial program 94.4%
+-commutativeN/A
+-lowering-+.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6493.4%
Simplified93.4%
Taylor expanded in x around inf
div-subN/A
associate-/l*N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6491.4%
Simplified91.4%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6493.2%
Applied egg-rr93.2%
if -5e3 < (/.f64 x y) < 4.99999999999999977e-7Initial program 99.0%
Taylor expanded in z around inf
Simplified98.2%
Final simplification95.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (/ (- z t) y))))
(if (<= (/ x y) -2e-11)
t_1
(if (<= (/ x y) 20000000000000.0) (* t (- 1.0 (/ x y))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((z - t) / y);
double tmp;
if ((x / y) <= -2e-11) {
tmp = t_1;
} else if ((x / y) <= 20000000000000.0) {
tmp = t * (1.0 - (x / 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 = x * ((z - t) / y)
if ((x / y) <= (-2d-11)) then
tmp = t_1
else if ((x / y) <= 20000000000000.0d0) then
tmp = t * (1.0d0 - (x / 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 = x * ((z - t) / y);
double tmp;
if ((x / y) <= -2e-11) {
tmp = t_1;
} else if ((x / y) <= 20000000000000.0) {
tmp = t * (1.0 - (x / y));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((z - t) / y) tmp = 0 if (x / y) <= -2e-11: tmp = t_1 elif (x / y) <= 20000000000000.0: tmp = t * (1.0 - (x / y)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(z - t) / y)) tmp = 0.0 if (Float64(x / y) <= -2e-11) tmp = t_1; elseif (Float64(x / y) <= 20000000000000.0) tmp = Float64(t * Float64(1.0 - Float64(x / y))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((z - t) / y); tmp = 0.0; if ((x / y) <= -2e-11) tmp = t_1; elseif ((x / y) <= 20000000000000.0) tmp = t * (1.0 - (x / y)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(z - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -2e-11], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 20000000000000.0], N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{z - t}{y}\\
\mathbf{if}\;\frac{x}{y} \leq -2 \cdot 10^{-11}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq 20000000000000:\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 x y) < -1.99999999999999988e-11 or 2e13 < (/.f64 x y) Initial program 94.5%
+-commutativeN/A
+-lowering-+.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6493.5%
Simplified93.5%
Taylor expanded in x around inf
div-subN/A
associate-/l*N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6492.3%
Simplified92.3%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6493.7%
Applied egg-rr93.7%
if -1.99999999999999988e-11 < (/.f64 x y) < 2e13Initial program 99.0%
+-commutativeN/A
+-lowering-+.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6491.1%
Simplified91.1%
Taylor expanded in t around inf
*-lowering-*.f64N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6470.8%
Simplified70.8%
Final simplification83.3%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -2e-11) (* (/ x y) z) (if (<= (/ x y) 1e-55) t (/ z (/ y x)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -2e-11) {
tmp = (x / y) * z;
} else if ((x / y) <= 1e-55) {
tmp = t;
} else {
tmp = 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 / y) <= (-2d-11)) then
tmp = (x / y) * z
else if ((x / y) <= 1d-55) then
tmp = t
else
tmp = 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 / y) <= -2e-11) {
tmp = (x / y) * z;
} else if ((x / y) <= 1e-55) {
tmp = t;
} else {
tmp = z / (y / x);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -2e-11: tmp = (x / y) * z elif (x / y) <= 1e-55: tmp = t else: tmp = z / (y / x) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -2e-11) tmp = Float64(Float64(x / y) * z); elseif (Float64(x / y) <= 1e-55) tmp = t; else tmp = Float64(z / Float64(y / x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -2e-11) tmp = (x / y) * z; elseif ((x / y) <= 1e-55) tmp = t; else tmp = z / (y / x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -2e-11], N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 1e-55], t, N[(z / N[(y / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -2 \cdot 10^{-11}:\\
\;\;\;\;\frac{x}{y} \cdot z\\
\mathbf{elif}\;\frac{x}{y} \leq 10^{-55}:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{\frac{y}{x}}\\
\end{array}
\end{array}
if (/.f64 x y) < -1.99999999999999988e-11Initial program 95.1%
+-commutativeN/A
+-lowering-+.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6494.1%
Simplified94.1%
Taylor expanded in t around 0
/-lowering-/.f64N/A
*-lowering-*.f6466.1%
Simplified66.1%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f6467.1%
Applied egg-rr67.1%
if -1.99999999999999988e-11 < (/.f64 x y) < 9.99999999999999995e-56Initial program 98.8%
+-commutativeN/A
+-lowering-+.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6493.2%
Simplified93.2%
Taylor expanded in x around 0
Simplified75.5%
if 9.99999999999999995e-56 < (/.f64 x y) Initial program 95.2%
+-commutativeN/A
+-lowering-+.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6489.7%
Simplified89.7%
Taylor expanded in t around 0
/-lowering-/.f64N/A
*-lowering-*.f6451.6%
Simplified51.6%
*-commutativeN/A
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6458.1%
Applied egg-rr58.1%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (/ x y) z))) (if (<= (/ x y) -2e-11) t_1 (if (<= (/ x y) 1e-55) t t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (x / y) * z;
double tmp;
if ((x / y) <= -2e-11) {
tmp = t_1;
} else if ((x / y) <= 1e-55) {
tmp = t;
} 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) * z
if ((x / y) <= (-2d-11)) then
tmp = t_1
else if ((x / y) <= 1d-55) then
tmp = t
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) * z;
double tmp;
if ((x / y) <= -2e-11) {
tmp = t_1;
} else if ((x / y) <= 1e-55) {
tmp = t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / y) * z tmp = 0 if (x / y) <= -2e-11: tmp = t_1 elif (x / y) <= 1e-55: tmp = t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / y) * z) tmp = 0.0 if (Float64(x / y) <= -2e-11) tmp = t_1; elseif (Float64(x / y) <= 1e-55) tmp = t; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / y) * z; tmp = 0.0; if ((x / y) <= -2e-11) tmp = t_1; elseif ((x / y) <= 1e-55) tmp = t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -2e-11], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 1e-55], t, t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} \cdot z\\
\mathbf{if}\;\frac{x}{y} \leq -2 \cdot 10^{-11}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq 10^{-55}:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 x y) < -1.99999999999999988e-11 or 9.99999999999999995e-56 < (/.f64 x y) Initial program 95.2%
+-commutativeN/A
+-lowering-+.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6491.9%
Simplified91.9%
Taylor expanded in t around 0
/-lowering-/.f64N/A
*-lowering-*.f6458.8%
Simplified58.8%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f6462.4%
Applied egg-rr62.4%
if -1.99999999999999988e-11 < (/.f64 x y) < 9.99999999999999995e-56Initial program 98.8%
+-commutativeN/A
+-lowering-+.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6493.2%
Simplified93.2%
Taylor expanded in x around 0
Simplified75.5%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* t (- 1.0 (/ x y))))) (if (<= t -8.5e-11) t_1 (if (<= t 1.5e-129) (/ 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 (t <= -8.5e-11) {
tmp = t_1;
} else if (t <= 1.5e-129) {
tmp = 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 (t <= (-8.5d-11)) then
tmp = t_1
else if (t <= 1.5d-129) then
tmp = 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 (t <= -8.5e-11) {
tmp = t_1;
} else if (t <= 1.5e-129) {
tmp = 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 t <= -8.5e-11: tmp = t_1 elif t <= 1.5e-129: tmp = 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 (t <= -8.5e-11) tmp = t_1; elseif (t <= 1.5e-129) tmp = Float64(z / Float64(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 (t <= -8.5e-11) tmp = t_1; elseif (t <= 1.5e-129) tmp = 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[t, -8.5e-11], t$95$1, If[LessEqual[t, 1.5e-129], N[(z / N[(y / x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{if}\;t \leq -8.5 \cdot 10^{-11}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.5 \cdot 10^{-129}:\\
\;\;\;\;\frac{z}{\frac{y}{x}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -8.50000000000000037e-11 or 1.4999999999999999e-129 < t Initial program 99.9%
+-commutativeN/A
+-lowering-+.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6491.1%
Simplified91.1%
Taylor expanded in t around inf
*-lowering-*.f64N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6479.2%
Simplified79.2%
if -8.50000000000000037e-11 < t < 1.4999999999999999e-129Initial program 92.0%
+-commutativeN/A
+-lowering-+.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6494.2%
Simplified94.2%
Taylor expanded in t around 0
/-lowering-/.f64N/A
*-lowering-*.f6469.8%
Simplified69.8%
*-commutativeN/A
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6470.6%
Applied egg-rr70.6%
(FPCore (x y z t) :precision binary64 (if (<= z 2.5e+131) (+ t (/ (* x (- z t)) y)) (+ t (* (/ x y) z))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 2.5e+131) {
tmp = t + ((x * (z - t)) / y);
} else {
tmp = t + ((x / 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 (z <= 2.5d+131) then
tmp = t + ((x * (z - t)) / y)
else
tmp = t + ((x / y) * z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 2.5e+131) {
tmp = t + ((x * (z - t)) / y);
} else {
tmp = t + ((x / y) * z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= 2.5e+131: tmp = t + ((x * (z - t)) / y) else: tmp = t + ((x / y) * z) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= 2.5e+131) tmp = Float64(t + Float64(Float64(x * Float64(z - t)) / y)); else tmp = Float64(t + Float64(Float64(x / y) * z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= 2.5e+131) tmp = t + ((x * (z - t)) / y); else tmp = t + ((x / y) * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, 2.5e+131], N[(t + N[(N[(x * N[(z - t), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(t + N[(N[(x / y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2.5 \cdot 10^{+131}:\\
\;\;\;\;t + \frac{x \cdot \left(z - t\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;t + \frac{x}{y} \cdot z\\
\end{array}
\end{array}
if z < 2.49999999999999998e131Initial program 96.0%
+-commutativeN/A
+-lowering-+.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6494.2%
Simplified94.2%
if 2.49999999999999998e131 < z Initial program 99.9%
Taylor expanded in z around inf
Simplified99.9%
Final simplification95.0%
(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 96.5%
+-commutativeN/A
+-lowering-+.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6492.4%
Simplified92.4%
Taylor expanded in x around 0
Simplified31.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (* (/ x y) (- z t)) t)))
(if (< z 2.759456554562692e-282)
t_1
(if (< z 2.326994450874436e-110) (+ (* x (/ (- z t) y)) t) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = ((x / y) * (z - t)) + t;
double tmp;
if (z < 2.759456554562692e-282) {
tmp = t_1;
} else if (z < 2.326994450874436e-110) {
tmp = (x * ((z - t) / y)) + t;
} 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) * (z - t)) + t
if (z < 2.759456554562692d-282) then
tmp = t_1
else if (z < 2.326994450874436d-110) then
tmp = (x * ((z - t) / y)) + t
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) * (z - t)) + t;
double tmp;
if (z < 2.759456554562692e-282) {
tmp = t_1;
} else if (z < 2.326994450874436e-110) {
tmp = (x * ((z - t) / y)) + t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = ((x / y) * (z - t)) + t tmp = 0 if z < 2.759456554562692e-282: tmp = t_1 elif z < 2.326994450874436e-110: tmp = (x * ((z - t) / y)) + t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(Float64(x / y) * Float64(z - t)) + t) tmp = 0.0 if (z < 2.759456554562692e-282) tmp = t_1; elseif (z < 2.326994450874436e-110) tmp = Float64(Float64(x * Float64(Float64(z - t) / y)) + t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = ((x / y) * (z - t)) + t; tmp = 0.0; if (z < 2.759456554562692e-282) tmp = t_1; elseif (z < 2.326994450874436e-110) tmp = (x * ((z - t) / y)) + t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(x / y), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]}, If[Less[z, 2.759456554562692e-282], t$95$1, If[Less[z, 2.326994450874436e-110], N[(N[(x * N[(N[(z - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} \cdot \left(z - t\right) + t\\
\mathbf{if}\;z < 2.759456554562692 \cdot 10^{-282}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z < 2.326994450874436 \cdot 10^{-110}:\\
\;\;\;\;x \cdot \frac{z - t}{y} + t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024158
(FPCore (x y z t)
:name "Numeric.Signal.Multichannel:$cget from hsignal-0.2.7.1"
:precision binary64
:alt
(! :herbie-platform default (if (< z 689864138640673/250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (* (/ x y) (- z t)) t) (if (< z 581748612718609/25000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (* x (/ (- z t) y)) t) (+ (* (/ x y) (- z t)) t))))
(+ (* (/ x y) (- z t)) t))