
(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 11 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.7%
+-commutativeN/A
+-lowering-+.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6493.5%
Simplified93.5%
associate-*l/N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f6498.8%
Applied egg-rr98.8%
Final simplification98.8%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -0.02) (* (- z t) (/ x y)) (if (<= (/ x y) 0.005) (+ t (/ z (/ y x))) (/ x (/ y (- z t))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -0.02) {
tmp = (z - t) * (x / y);
} else if ((x / y) <= 0.005) {
tmp = t + (z / (y / x));
} else {
tmp = x / (y / (z - 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 ((x / y) <= (-0.02d0)) then
tmp = (z - t) * (x / y)
else if ((x / y) <= 0.005d0) then
tmp = t + (z / (y / x))
else
tmp = x / (y / (z - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -0.02) {
tmp = (z - t) * (x / y);
} else if ((x / y) <= 0.005) {
tmp = t + (z / (y / x));
} else {
tmp = x / (y / (z - t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -0.02: tmp = (z - t) * (x / y) elif (x / y) <= 0.005: tmp = t + (z / (y / x)) else: tmp = x / (y / (z - t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -0.02) tmp = Float64(Float64(z - t) * Float64(x / y)); elseif (Float64(x / y) <= 0.005) tmp = Float64(t + Float64(z / Float64(y / x))); else tmp = Float64(x / Float64(y / Float64(z - t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x / y) <= -0.02) tmp = (z - t) * (x / y); elseif ((x / y) <= 0.005) tmp = t + (z / (y / x)); else tmp = x / (y / (z - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -0.02], N[(N[(z - t), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 0.005], N[(t + N[(z / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(y / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -0.02:\\
\;\;\;\;\left(z - t\right) \cdot \frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 0.005:\\
\;\;\;\;t + \frac{z}{\frac{y}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{y}{z - t}}\\
\end{array}
\end{array}
if (/.f64 x y) < -0.0200000000000000004Initial program 99.8%
+-commutativeN/A
+-lowering-+.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6495.1%
Simplified95.1%
Taylor expanded in x around inf
div-subN/A
associate-/l*N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6493.0%
Simplified93.0%
associate-*l/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6496.9%
Applied egg-rr96.9%
if -0.0200000000000000004 < (/.f64 x y) < 0.0050000000000000001Initial program 99.2%
+-commutativeN/A
+-lowering-+.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6495.1%
Simplified95.1%
associate-*l/N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f6499.2%
Applied egg-rr99.2%
Taylor expanded in z around inf
Simplified97.9%
if 0.0050000000000000001 < (/.f64 x y) Initial program 96.4%
+-commutativeN/A
+-lowering-+.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6487.8%
Simplified87.8%
Taylor expanded in x around inf
div-subN/A
associate-/l*N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6487.4%
Simplified87.4%
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6496.5%
Applied egg-rr96.5%
Final simplification97.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- z t) (/ x y))))
(if (<= (/ x y) -0.02)
t_1
(if (<= (/ x y) 0.005) (+ t (/ z (/ y x))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (z - t) * (x / y);
double tmp;
if ((x / y) <= -0.02) {
tmp = t_1;
} else if ((x / y) <= 0.005) {
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 = (z - t) * (x / y)
if ((x / y) <= (-0.02d0)) then
tmp = t_1
else if ((x / y) <= 0.005d0) 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 = (z - t) * (x / y);
double tmp;
if ((x / y) <= -0.02) {
tmp = t_1;
} else if ((x / y) <= 0.005) {
tmp = t + (z / (y / x));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (z - t) * (x / y) tmp = 0 if (x / y) <= -0.02: tmp = t_1 elif (x / y) <= 0.005: tmp = t + (z / (y / x)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z - t) * Float64(x / y)) tmp = 0.0 if (Float64(x / y) <= -0.02) tmp = t_1; elseif (Float64(x / y) <= 0.005) tmp = Float64(t + Float64(z / Float64(y / x))); 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) <= -0.02) tmp = t_1; elseif ((x / y) <= 0.005) tmp = t + (z / (y / x)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -0.02], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 0.005], N[(t + N[(z / N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z - t\right) \cdot \frac{x}{y}\\
\mathbf{if}\;\frac{x}{y} \leq -0.02:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq 0.005:\\
\;\;\;\;t + \frac{z}{\frac{y}{x}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 x y) < -0.0200000000000000004 or 0.0050000000000000001 < (/.f64 x y) Initial program 98.2%
+-commutativeN/A
+-lowering-+.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6491.6%
Simplified91.6%
Taylor expanded in x around inf
div-subN/A
associate-/l*N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6490.4%
Simplified90.4%
associate-*l/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6496.0%
Applied egg-rr96.0%
if -0.0200000000000000004 < (/.f64 x y) < 0.0050000000000000001Initial program 99.2%
+-commutativeN/A
+-lowering-+.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6495.1%
Simplified95.1%
associate-*l/N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f6499.2%
Applied egg-rr99.2%
Taylor expanded in z around inf
Simplified97.9%
Final simplification97.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- z t) (/ x y))))
(if (<= (/ x y) -200.0)
t_1
(if (<= (/ x y) 0.005) (+ 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) <= -200.0) {
tmp = t_1;
} else if ((x / y) <= 0.005) {
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) <= (-200.0d0)) then
tmp = t_1
else if ((x / y) <= 0.005d0) 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) <= -200.0) {
tmp = t_1;
} else if ((x / y) <= 0.005) {
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) <= -200.0: tmp = t_1 elif (x / y) <= 0.005: tmp = t + (z * (x / y)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z - t) * Float64(x / y)) tmp = 0.0 if (Float64(x / y) <= -200.0) tmp = t_1; elseif (Float64(x / y) <= 0.005) 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) <= -200.0) tmp = t_1; elseif ((x / y) <= 0.005) 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[(z - t), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -200.0], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 0.005], N[(t + N[(z * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z - t\right) \cdot \frac{x}{y}\\
\mathbf{if}\;\frac{x}{y} \leq -200:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq 0.005:\\
\;\;\;\;t + z \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 x y) < -200 or 0.0050000000000000001 < (/.f64 x y) Initial program 98.2%
+-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 inf
div-subN/A
associate-/l*N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6491.1%
Simplified91.1%
associate-*l/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6496.0%
Applied egg-rr96.0%
if -200 < (/.f64 x y) < 0.0050000000000000001Initial program 99.2%
Taylor expanded in z around inf
Simplified97.8%
Final simplification97.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- z t) (/ x y))))
(if (<= (/ x y) -5e-83)
t_1
(if (<= (/ x y) 50000000.0) (* t (- 1.0 (/ 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) <= -5e-83) {
tmp = t_1;
} else if ((x / y) <= 50000000.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 = (z - t) * (x / y)
if ((x / y) <= (-5d-83)) then
tmp = t_1
else if ((x / y) <= 50000000.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 = (z - t) * (x / y);
double tmp;
if ((x / y) <= -5e-83) {
tmp = t_1;
} else if ((x / y) <= 50000000.0) {
tmp = t * (1.0 - (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) <= -5e-83: tmp = t_1 elif (x / y) <= 50000000.0: tmp = t * (1.0 - (x / y)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z - t) * Float64(x / y)) tmp = 0.0 if (Float64(x / y) <= -5e-83) tmp = t_1; elseif (Float64(x / y) <= 50000000.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 = (z - t) * (x / y); tmp = 0.0; if ((x / y) <= -5e-83) tmp = t_1; elseif ((x / y) <= 50000000.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[(N[(z - t), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x / y), $MachinePrecision], -5e-83], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 50000000.0], N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z - t\right) \cdot \frac{x}{y}\\
\mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{-83}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq 50000000:\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 x y) < -5e-83 or 5e7 < (/.f64 x y) Initial program 98.4%
+-commutativeN/A
+-lowering-+.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6491.0%
Simplified91.0%
Taylor expanded in x around inf
div-subN/A
associate-/l*N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6486.3%
Simplified86.3%
associate-*l/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6492.6%
Applied egg-rr92.6%
if -5e-83 < (/.f64 x y) < 5e7Initial program 99.1%
+-commutativeN/A
+-lowering-+.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6496.1%
Simplified96.1%
Taylor expanded in t around inf
*-lowering-*.f64N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6481.0%
Simplified81.0%
Final simplification86.9%
(FPCore (x y z t) :precision binary64 (if (<= (/ x y) -5e-73) (* z (/ x y)) (if (<= (/ x y) 5e-45) t (/ z (/ y x)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x / y) <= -5e-73) {
tmp = z * (x / y);
} else if ((x / y) <= 5e-45) {
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) <= (-5d-73)) then
tmp = z * (x / y)
else if ((x / y) <= 5d-45) 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) <= -5e-73) {
tmp = z * (x / y);
} else if ((x / y) <= 5e-45) {
tmp = t;
} else {
tmp = z / (y / x);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x / y) <= -5e-73: tmp = z * (x / y) elif (x / y) <= 5e-45: tmp = t else: tmp = z / (y / x) return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(x / y) <= -5e-73) tmp = Float64(z * Float64(x / y)); elseif (Float64(x / y) <= 5e-45) 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) <= -5e-73) tmp = z * (x / y); elseif ((x / y) <= 5e-45) tmp = t; else tmp = z / (y / x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(x / y), $MachinePrecision], -5e-73], N[(z * N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x / y), $MachinePrecision], 5e-45], t, N[(z / N[(y / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{-73}:\\
\;\;\;\;z \cdot \frac{x}{y}\\
\mathbf{elif}\;\frac{x}{y} \leq 5 \cdot 10^{-45}:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{\frac{y}{x}}\\
\end{array}
\end{array}
if (/.f64 x y) < -4.9999999999999998e-73Initial program 99.9%
+-commutativeN/A
+-lowering-+.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6492.1%
Simplified92.1%
Taylor expanded in t around 0
/-lowering-/.f64N/A
*-lowering-*.f6449.2%
Simplified49.2%
associate-*l/N/A
*-lowering-*.f64N/A
/-lowering-/.f6450.5%
Applied egg-rr50.5%
if -4.9999999999999998e-73 < (/.f64 x y) < 4.99999999999999976e-45Initial program 99.1%
+-commutativeN/A
+-lowering-+.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6497.4%
Simplified97.4%
Taylor expanded in x around 0
Simplified82.8%
if 4.99999999999999976e-45 < (/.f64 x y) Initial program 97.0%
+-commutativeN/A
+-lowering-+.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6488.3%
Simplified88.3%
Taylor expanded in t around 0
/-lowering-/.f64N/A
*-lowering-*.f6443.9%
Simplified43.9%
*-commutativeN/A
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6448.3%
Applied egg-rr48.3%
Final simplification64.5%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* z (/ x y)))) (if (<= (/ x y) -5e-73) t_1 (if (<= (/ x y) 5e-45) t t_1))))
double code(double x, double y, double z, double t) {
double t_1 = z * (x / y);
double tmp;
if ((x / y) <= -5e-73) {
tmp = t_1;
} else if ((x / y) <= 5e-45) {
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) <= (-5d-73)) then
tmp = t_1
else if ((x / y) <= 5d-45) 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) <= -5e-73) {
tmp = t_1;
} else if ((x / y) <= 5e-45) {
tmp = t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (x / y) tmp = 0 if (x / y) <= -5e-73: tmp = t_1 elif (x / y) <= 5e-45: 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) <= -5e-73) tmp = t_1; elseif (Float64(x / y) <= 5e-45) 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) <= -5e-73) tmp = t_1; elseif ((x / y) <= 5e-45) 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], -5e-73], t$95$1, If[LessEqual[N[(x / y), $MachinePrecision], 5e-45], t, t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \frac{x}{y}\\
\mathbf{if}\;\frac{x}{y} \leq -5 \cdot 10^{-73}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\frac{x}{y} \leq 5 \cdot 10^{-45}:\\
\;\;\;\;t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 x y) < -4.9999999999999998e-73 or 4.99999999999999976e-45 < (/.f64 x y) Initial program 98.5%
+-commutativeN/A
+-lowering-+.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6490.3%
Simplified90.3%
Taylor expanded in t around 0
/-lowering-/.f64N/A
*-lowering-*.f6446.7%
Simplified46.7%
associate-*l/N/A
*-lowering-*.f64N/A
/-lowering-/.f6449.4%
Applied egg-rr49.4%
if -4.9999999999999998e-73 < (/.f64 x y) < 4.99999999999999976e-45Initial program 99.1%
+-commutativeN/A
+-lowering-+.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6497.4%
Simplified97.4%
Taylor expanded in x around 0
Simplified82.8%
Final simplification64.5%
(FPCore (x y z t) :precision binary64 (if (<= z -1e+148) (/ (* z x) y) (if (<= z 4.3e+92) (* t (- 1.0 (/ x y))) (/ z (/ y x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1e+148) {
tmp = (z * x) / y;
} else if (z <= 4.3e+92) {
tmp = t * (1.0 - (x / y));
} 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 (z <= (-1d+148)) then
tmp = (z * x) / y
else if (z <= 4.3d+92) then
tmp = t * (1.0d0 - (x / y))
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 (z <= -1e+148) {
tmp = (z * x) / y;
} else if (z <= 4.3e+92) {
tmp = t * (1.0 - (x / y));
} else {
tmp = z / (y / x);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1e+148: tmp = (z * x) / y elif z <= 4.3e+92: tmp = t * (1.0 - (x / y)) else: tmp = z / (y / x) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1e+148) tmp = Float64(Float64(z * x) / y); elseif (z <= 4.3e+92) tmp = Float64(t * Float64(1.0 - Float64(x / y))); else tmp = Float64(z / Float64(y / x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1e+148) tmp = (z * x) / y; elseif (z <= 4.3e+92) tmp = t * (1.0 - (x / y)); else tmp = z / (y / x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1e+148], N[(N[(z * x), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[z, 4.3e+92], N[(t * N[(1.0 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / N[(y / x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{+148}:\\
\;\;\;\;\frac{z \cdot x}{y}\\
\mathbf{elif}\;z \leq 4.3 \cdot 10^{+92}:\\
\;\;\;\;t \cdot \left(1 - \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{\frac{y}{x}}\\
\end{array}
\end{array}
if z < -1e148Initial program 96.4%
+-commutativeN/A
+-lowering-+.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6499.8%
Simplified99.8%
Taylor expanded in t around 0
/-lowering-/.f64N/A
*-lowering-*.f6479.8%
Simplified79.8%
if -1e148 < z < 4.2999999999999998e92Initial program 98.9%
+-commutativeN/A
+-lowering-+.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6492.7%
Simplified92.7%
Taylor expanded in t around inf
*-lowering-*.f64N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6482.5%
Simplified82.5%
if 4.2999999999999998e92 < z Initial program 99.7%
+-commutativeN/A
+-lowering-+.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6492.7%
Simplified92.7%
Taylor expanded in t around 0
/-lowering-/.f64N/A
*-lowering-*.f6472.5%
Simplified72.5%
*-commutativeN/A
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6477.2%
Applied egg-rr77.2%
Final simplification81.4%
(FPCore (x y z t) :precision binary64 (if (<= y 1.85e+153) (+ t (/ (* (- z t) x) y)) (+ t (* z (/ x y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.85e+153) {
tmp = t + (((z - t) * x) / y);
} else {
tmp = t + (z * (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 <= 1.85d+153) then
tmp = t + (((z - t) * x) / y)
else
tmp = t + (z * (x / y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.85e+153) {
tmp = t + (((z - t) * x) / y);
} else {
tmp = t + (z * (x / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 1.85e+153: tmp = t + (((z - t) * x) / y) else: tmp = t + (z * (x / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 1.85e+153) tmp = Float64(t + Float64(Float64(Float64(z - t) * x) / y)); else tmp = Float64(t + Float64(z * Float64(x / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 1.85e+153) tmp = t + (((z - t) * x) / y); else tmp = t + (z * (x / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 1.85e+153], N[(t + N[(N[(N[(z - t), $MachinePrecision] * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(t + N[(z * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.85 \cdot 10^{+153}:\\
\;\;\;\;t + \frac{\left(z - t\right) \cdot x}{y}\\
\mathbf{else}:\\
\;\;\;\;t + z \cdot \frac{x}{y}\\
\end{array}
\end{array}
if y < 1.8500000000000001e153Initial program 98.6%
+-commutativeN/A
+-lowering-+.f64N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6496.8%
Simplified96.8%
if 1.8500000000000001e153 < y Initial program 99.9%
Taylor expanded in z around inf
Simplified92.4%
Final simplification96.2%
(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.7%
Final simplification98.7%
(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.7%
+-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 0
Simplified42.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 2024138
(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))