
(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 9 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 (+ t (/ (- z t) (/ y x))))
double code(double x, double y, double z, double t) {
return t + ((z - t) / (y / x));
}
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 - t) / (y / x))
end function
public static double code(double x, double y, double z, double t) {
return t + ((z - t) / (y / x));
}
def code(x, y, z, t): return t + ((z - t) / (y / x))
function code(x, y, z, t) return Float64(t + Float64(Float64(z - t) / Float64(y / x))) end
function tmp = code(x, y, z, t) tmp = t + ((z - t) / (y / x)); end
code[x_, y_, z_, t_] := N[(t + N[(N[(z - t), $MachinePrecision] / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
t + \frac{z - t}{\frac{y}{x}}
\end{array}
Initial program 98.3%
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f6498.5%
Applied egg-rr98.5%
Final simplification98.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (* (- z t) x) y)))
(if (<= (/ x y) -1e+32)
t_1
(if (<= (/ x y) 2e+74) (+ t (* z (/ x y))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = ((z - t) * x) / y;
double tmp;
if ((x / y) <= -1e+32) {
tmp = t_1;
} else if ((x / y) <= 2e+74) {
tmp = t + (z * (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 = ((z - t) * x) / y
if ((x / y) <= (-1d+32)) then
tmp = t_1
else if ((x / y) <= 2d+74) then
tmp = t + (z * (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 = ((z - t) * x) / y;
double tmp;
if ((x / y) <= -1e+32) {
tmp = t_1;
} else if ((x / y) <= 2e+74) {
tmp = t + (z * (x / y));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = ((z - t) * x) / y tmp = 0 if (x / y) <= -1e+32: tmp = t_1 elif (x / y) <= 2e+74: tmp = t + (z * (x / y)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(Float64(z - t) * x) / y) tmp = 0.0 if (Float64(x / y) <= -1e+32) tmp = t_1; elseif (Float64(x / y) <= 2e+74) tmp = Float64(t + Float64(z * Float64(x / y))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = ((z - t) * x) / y; tmp = 0.0; if ((x / y) <= -1e+32) tmp = t_1; elseif ((x / y) <= 2e+74) tmp = t + (z * (x / y)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(z - t), $MachinePrecision] * x), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -1e+32], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 2e+74], N[(t + N[(z * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(z - t\right) \cdot x}{y}\\
\mathbf{if}\;\frac{x}{y} \leq -1 \cdot 10^{+32}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq 2 \cdot 10^{+74}:\\
\;\;\;\;t + z \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 x y) < -1.00000000000000005e32 or 1.9999999999999999e74 < (/.f64 x y) Initial program 97.2%
+-commutativeN/A
+-lowering-+.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6497.3%
Simplified97.3%
Taylor expanded in x around inf
div-subN/A
associate-/l*N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6497.3%
Simplified97.3%
if -1.00000000000000005e32 < (/.f64 x y) < 1.9999999999999999e74Initial program 99.2%
Taylor expanded in z around inf
Simplified96.7%
Final simplification96.9%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -1e-43) (* z (/ x y)) (if (<= (/ x y) 5e-52) t (/ z (/ y x)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -1e-43) {
tmp = z * (x / y);
} else if ((x / y) <= 5e-52) {
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) <= (-1d-43)) then
tmp = z * (x / y)
else if ((x / y) <= 5d-52) 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) <= -1e-43) {
tmp = z * (x / y);
} else if ((x / y) <= 5e-52) {
tmp = t;
} else {
tmp = z / (y / x);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -1e-43: tmp = z * (x / y) elif (x / y) <= 5e-52: tmp = t else: tmp = z / (y / x) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -1e-43) tmp = Float64(z * Float64(x / y)); elseif (Float64(x / y) <= 5e-52) 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) <= -1e-43) tmp = z * (x / y); elseif ((x / y) <= 5e-52) tmp = t; else tmp = z / (y / x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -1e-43], N[(z * N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 5e-52], t, N[(z / N[(y / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -1 \cdot 10^{-43}:\\
\;\;\;\;z \cdot \frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 5 \cdot 10^{-52}:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{\frac{y}{x}}\\
\end{array}
\end{array}
if (/.f64 x y) < -1.00000000000000008e-43Initial program 99.8%
+-commutativeN/A
+-lowering-+.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6490.9%
Simplified90.9%
Taylor expanded in t around 0
/-lowering-/.f64N/A
*-lowering-*.f6456.1%
Simplified56.1%
associate-*l/N/A
*-lowering-*.f64N/A
/-lowering-/.f6466.4%
Applied egg-rr66.4%
if -1.00000000000000008e-43 < (/.f64 x y) < 5e-52Initial program 99.0%
+-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 0
Simplified78.7%
if 5e-52 < (/.f64 x y) Initial program 95.7%
+-commutativeN/A
+-lowering-+.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6492.0%
Simplified92.0%
Taylor expanded in t around 0
/-lowering-/.f64N/A
*-lowering-*.f6463.1%
Simplified63.1%
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6467.1%
Applied egg-rr67.1%
Final simplification72.1%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* z (/ x y)))) (if (<= (/ x y) -1e-43) t_1 (if (<= (/ x y) 5e-52) t t_1))))
double code(double x, double y, double z, double t) {
double t_1 = z * (x / y);
double tmp;
if ((x / y) <= -1e-43) {
tmp = t_1;
} else if ((x / y) <= 5e-52) {
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 = z * (x / y)
if ((x / y) <= (-1d-43)) then
tmp = t_1
else if ((x / y) <= 5d-52) 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 = z * (x / y);
double tmp;
if ((x / y) <= -1e-43) {
tmp = t_1;
} else if ((x / y) <= 5e-52) {
tmp = t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (x / y) tmp = 0 if (x / y) <= -1e-43: tmp = t_1 elif (x / y) <= 5e-52: tmp = t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(x / y)) tmp = 0.0 if (Float64(x / y) <= -1e-43) tmp = t_1; elseif (Float64(x / y) <= 5e-52) tmp = t; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * (x / y); tmp = 0.0; if ((x / y) <= -1e-43) tmp = t_1; elseif ((x / y) <= 5e-52) tmp = t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -1e-43], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 5e-52], t, t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \frac{x}{y}\\
\mathbf{if}\;\frac{x}{y} \leq -1 \cdot 10^{-43}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq 5 \cdot 10^{-52}:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 x y) < -1.00000000000000008e-43 or 5e-52 < (/.f64 x y) Initial program 97.8%
+-commutativeN/A
+-lowering-+.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6491.5%
Simplified91.5%
Taylor expanded in t around 0
/-lowering-/.f64N/A
*-lowering-*.f6459.6%
Simplified59.6%
associate-*l/N/A
*-lowering-*.f64N/A
/-lowering-/.f6466.7%
Applied egg-rr66.7%
if -1.00000000000000008e-43 < (/.f64 x y) < 5e-52Initial program 99.0%
+-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 0
Simplified78.7%
Final simplification72.1%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* t (- 1.0 (/ x y))))) (if (<= t -1e+184) t_1 (if (<= t 6.5e+74) (+ t (* z (/ x y))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = t * (1.0 - (x / y));
double tmp;
if (t <= -1e+184) {
tmp = t_1;
} else if (t <= 6.5e+74) {
tmp = t + (z * (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 = t * (1.0d0 - (x / y))
if (t <= (-1d+184)) then
tmp = t_1
else if (t <= 6.5d+74) then
tmp = t + (z * (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 = t * (1.0 - (x / y));
double tmp;
if (t <= -1e+184) {
tmp = t_1;
} else if (t <= 6.5e+74) {
tmp = t + (z * (x / y));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = t * (1.0 - (x / y)) tmp = 0 if t <= -1e+184: tmp = t_1 elif t <= 6.5e+74: tmp = t + (z * (x / 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 (t <= -1e+184) tmp = t_1; elseif (t <= 6.5e+74) tmp = Float64(t + Float64(z * Float64(x / 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 (t <= -1e+184) tmp = t_1; elseif (t <= 6.5e+74) tmp = t + (z * (x / 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[t, -1e+184], t$95$1, If[LessEqual[t, 6.5e+74], N[(t + N[(z * N[(x / 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}\;t \leq -1 \cdot 10^{+184}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 6.5 \cdot 10^{+74}:\\
\;\;\;\;t + z \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.00000000000000002e184 or 6.49999999999999962e74 < t Initial program 100.0%
+-commutativeN/A
+-lowering-+.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6489.4%
Simplified89.4%
Taylor expanded in t around inf
*-lowering-*.f64N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6492.4%
Simplified92.4%
if -1.00000000000000002e184 < t < 6.49999999999999962e74Initial program 97.6%
Taylor expanded in z around inf
Simplified90.9%
Final simplification91.4%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* t (- 1.0 (/ x y))))) (if (<= t -1.16e-138) t_1 (if (<= t 320000.0) (* z (/ x y)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = t * (1.0 - (x / y));
double tmp;
if (t <= -1.16e-138) {
tmp = t_1;
} else if (t <= 320000.0) {
tmp = z * (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 = t * (1.0d0 - (x / y))
if (t <= (-1.16d-138)) then
tmp = t_1
else if (t <= 320000.0d0) then
tmp = z * (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 = t * (1.0 - (x / y));
double tmp;
if (t <= -1.16e-138) {
tmp = t_1;
} else if (t <= 320000.0) {
tmp = z * (x / y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = t * (1.0 - (x / y)) tmp = 0 if t <= -1.16e-138: tmp = t_1 elif t <= 320000.0: tmp = z * (x / 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 (t <= -1.16e-138) tmp = t_1; elseif (t <= 320000.0) tmp = Float64(z * Float64(x / 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 (t <= -1.16e-138) tmp = t_1; elseif (t <= 320000.0) tmp = z * (x / 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[t, -1.16e-138], t$95$1, If[LessEqual[t, 320000.0], N[(z * N[(x / y), $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 -1.16 \cdot 10^{-138}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 320000:\\
\;\;\;\;z \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.16e-138 or 3.2e5 < t Initial program 99.4%
+-commutativeN/A
+-lowering-+.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6490.8%
Simplified90.8%
Taylor expanded in t around inf
*-lowering-*.f64N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6477.2%
Simplified77.2%
if -1.16e-138 < t < 3.2e5Initial program 96.5%
+-commutativeN/A
+-lowering-+.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6495.0%
Simplified95.0%
Taylor expanded in t around 0
/-lowering-/.f64N/A
*-lowering-*.f6468.6%
Simplified68.6%
associate-*l/N/A
*-lowering-*.f64N/A
/-lowering-/.f6473.4%
Applied egg-rr73.4%
Final simplification75.8%
(FPCore (x y z t) :precision binary64 (if (<= y -3e+50) (+ t (/ x (/ y z))) (+ t (/ (* (- z t) x) y))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3e+50) {
tmp = t + (x / (y / z));
} else {
tmp = t + (((z - t) * 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 <= (-3d+50)) then
tmp = t + (x / (y / z))
else
tmp = t + (((z - t) * x) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3e+50) {
tmp = t + (x / (y / z));
} else {
tmp = t + (((z - t) * x) / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3e+50: tmp = t + (x / (y / z)) else: tmp = t + (((z - t) * x) / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3e+50) tmp = Float64(t + Float64(x / Float64(y / z))); else tmp = Float64(t + Float64(Float64(Float64(z - t) * x) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -3e+50) tmp = t + (x / (y / z)); else tmp = t + (((z - t) * x) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3e+50], N[(t + N[(x / N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t + N[(N[(N[(z - t), $MachinePrecision] * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{+50}:\\
\;\;\;\;t + \frac{x}{\frac{y}{z}}\\
\mathbf{else}:\\
\;\;\;\;t + \frac{\left(z - t\right) \cdot x}{y}\\
\end{array}
\end{array}
if y < -2.9999999999999998e50Initial program 98.1%
Taylor expanded in z around inf
Simplified96.6%
*-commutativeN/A
clear-numN/A
div-invN/A
+-lowering-+.f64N/A
associate-/r/N/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6498.4%
Applied egg-rr98.4%
if -2.9999999999999998e50 < y Initial program 98.4%
+-commutativeN/A
+-lowering-+.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6495.8%
Simplified95.8%
Final simplification96.3%
(FPCore (x y z t) :precision binary64 (+ t (* (- z t) (/ x y))))
double code(double x, double y, double z, double t) {
return t + ((z - t) * (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 - t) * (x / y))
end function
public static double code(double x, double y, double z, double t) {
return t + ((z - t) * (x / y));
}
def code(x, y, z, t): return t + ((z - t) * (x / y))
function code(x, y, z, t) return Float64(t + Float64(Float64(z - t) * Float64(x / y))) end
function tmp = code(x, y, z, t) tmp = t + ((z - t) * (x / y)); end
code[x_, y_, z_, t_] := N[(t + N[(N[(z - t), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
t + \left(z - t\right) \cdot \frac{x}{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%
+-commutativeN/A
+-lowering-+.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6492.3%
Simplified92.3%
Taylor expanded in x around 0
Simplified38.4%
(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 2024160
(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))