
(FPCore (x y z t) :precision binary64 (+ x (/ (* (- y x) z) t)))
double code(double x, double y, double z, double t) {
return x + (((y - x) * z) / 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 - x) * z) / t)
end function
public static double code(double x, double y, double z, double t) {
return x + (((y - x) * z) / t);
}
def code(x, y, z, t): return x + (((y - x) * z) / t)
function code(x, y, z, t) return Float64(x + Float64(Float64(Float64(y - x) * z) / t)) end
function tmp = code(x, y, z, t) tmp = x + (((y - x) * z) / t); end
code[x_, y_, z_, t_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - x\right) \cdot z}{t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ x (/ (* (- y x) z) t)))
double code(double x, double y, double z, double t) {
return x + (((y - x) * z) / 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 - x) * z) / t)
end function
public static double code(double x, double y, double z, double t) {
return x + (((y - x) * z) / t);
}
def code(x, y, z, t): return x + (((y - x) * z) / t)
function code(x, y, z, t) return Float64(x + Float64(Float64(Float64(y - x) * z) / t)) end
function tmp = code(x, y, z, t) tmp = x + (((y - x) * z) / t); end
code[x_, y_, z_, t_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - x\right) \cdot z}{t}
\end{array}
(FPCore (x y z t) :precision binary64 (+ x (/ (- y x) (/ t z))))
double code(double x, double y, double z, double t) {
return x + ((y - x) / (t / z));
}
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 - x) / (t / z))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - x) / (t / z));
}
def code(x, y, z, t): return x + ((y - x) / (t / z))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - x) / Float64(t / z))) end
function tmp = code(x, y, z, t) tmp = x + ((y - x) / (t / z)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - x), $MachinePrecision] / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y - x}{\frac{t}{z}}
\end{array}
Initial program 93.0%
+-commutativeN/A
+-lowering-+.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f6498.0%
Applied egg-rr98.0%
Final simplification98.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (/ y (/ t z)))))
(if (<= y -8e+125)
t_1
(if (<= y -1.75e-39)
(* (- y x) (/ z t))
(if (<= y 1.92e-62) (* x (- 1.0 (/ z t))) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x + (y / (t / z));
double tmp;
if (y <= -8e+125) {
tmp = t_1;
} else if (y <= -1.75e-39) {
tmp = (y - x) * (z / t);
} else if (y <= 1.92e-62) {
tmp = x * (1.0 - (z / 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 / (t / z))
if (y <= (-8d+125)) then
tmp = t_1
else if (y <= (-1.75d-39)) then
tmp = (y - x) * (z / t)
else if (y <= 1.92d-62) then
tmp = x * (1.0d0 - (z / 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 / (t / z));
double tmp;
if (y <= -8e+125) {
tmp = t_1;
} else if (y <= -1.75e-39) {
tmp = (y - x) * (z / t);
} else if (y <= 1.92e-62) {
tmp = x * (1.0 - (z / t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x + (y / (t / z)) tmp = 0 if y <= -8e+125: tmp = t_1 elif y <= -1.75e-39: tmp = (y - x) * (z / t) elif y <= 1.92e-62: tmp = x * (1.0 - (z / t)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(y / Float64(t / z))) tmp = 0.0 if (y <= -8e+125) tmp = t_1; elseif (y <= -1.75e-39) tmp = Float64(Float64(y - x) * Float64(z / t)); elseif (y <= 1.92e-62) tmp = Float64(x * Float64(1.0 - Float64(z / t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + (y / (t / z)); tmp = 0.0; if (y <= -8e+125) tmp = t_1; elseif (y <= -1.75e-39) tmp = (y - x) * (z / t); elseif (y <= 1.92e-62) tmp = x * (1.0 - (z / t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -8e+125], t$95$1, If[LessEqual[y, -1.75e-39], N[(N[(y - x), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.92e-62], N[(x * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y}{\frac{t}{z}}\\
\mathbf{if}\;y \leq -8 \cdot 10^{+125}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1.75 \cdot 10^{-39}:\\
\;\;\;\;\left(y - x\right) \cdot \frac{z}{t}\\
\mathbf{elif}\;y \leq 1.92 \cdot 10^{-62}:\\
\;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -7.9999999999999994e125 or 1.92e-62 < y Initial program 92.0%
Taylor expanded in y around inf
/-lowering-/.f64N/A
*-lowering-*.f6486.5%
Simplified86.5%
+-commutativeN/A
+-lowering-+.f64N/A
associate-/l*N/A
clear-numN/A
div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6492.8%
Applied egg-rr92.8%
if -7.9999999999999994e125 < y < -1.75e-39Initial program 86.5%
+-commutativeN/A
+-lowering-+.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f6499.8%
Applied egg-rr99.8%
Taylor expanded in t around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6472.5%
Simplified72.5%
clear-numN/A
associate-/l/N/A
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6485.8%
Applied egg-rr85.8%
if -1.75e-39 < y < 1.92e-62Initial program 95.6%
Taylor expanded in x around inf
*-lowering-*.f64N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6485.3%
Simplified85.3%
Final simplification88.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (* y (/ z t)))))
(if (<= y -1.2e+150)
t_1
(if (<= y -2.05e-39)
(* (- y x) (/ z t))
(if (<= y 1.52e-58) (* x (- 1.0 (/ z t))) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x + (y * (z / t));
double tmp;
if (y <= -1.2e+150) {
tmp = t_1;
} else if (y <= -2.05e-39) {
tmp = (y - x) * (z / t);
} else if (y <= 1.52e-58) {
tmp = x * (1.0 - (z / 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))
if (y <= (-1.2d+150)) then
tmp = t_1
else if (y <= (-2.05d-39)) then
tmp = (y - x) * (z / t)
else if (y <= 1.52d-58) then
tmp = x * (1.0d0 - (z / 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));
double tmp;
if (y <= -1.2e+150) {
tmp = t_1;
} else if (y <= -2.05e-39) {
tmp = (y - x) * (z / t);
} else if (y <= 1.52e-58) {
tmp = x * (1.0 - (z / t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x + (y * (z / t)) tmp = 0 if y <= -1.2e+150: tmp = t_1 elif y <= -2.05e-39: tmp = (y - x) * (z / t) elif y <= 1.52e-58: tmp = x * (1.0 - (z / t)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(y * Float64(z / t))) tmp = 0.0 if (y <= -1.2e+150) tmp = t_1; elseif (y <= -2.05e-39) tmp = Float64(Float64(y - x) * Float64(z / t)); elseif (y <= 1.52e-58) tmp = Float64(x * Float64(1.0 - Float64(z / t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + (y * (z / t)); tmp = 0.0; if (y <= -1.2e+150) tmp = t_1; elseif (y <= -2.05e-39) tmp = (y - x) * (z / t); elseif (y <= 1.52e-58) tmp = x * (1.0 - (z / t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.2e+150], t$95$1, If[LessEqual[y, -2.05e-39], N[(N[(y - x), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.52e-58], N[(x * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z}{t}\\
\mathbf{if}\;y \leq -1.2 \cdot 10^{+150}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -2.05 \cdot 10^{-39}:\\
\;\;\;\;\left(y - x\right) \cdot \frac{z}{t}\\
\mathbf{elif}\;y \leq 1.52 \cdot 10^{-58}:\\
\;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.20000000000000001e150 or 1.51999999999999993e-58 < y Initial program 91.7%
Taylor expanded in y around inf
/-lowering-/.f64N/A
*-lowering-*.f6486.1%
Simplified86.1%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f6492.5%
Applied egg-rr92.5%
if -1.20000000000000001e150 < y < -2.05e-39Initial program 87.9%
+-commutativeN/A
+-lowering-+.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f6499.7%
Applied egg-rr99.7%
Taylor expanded in t around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6475.2%
Simplified75.2%
clear-numN/A
associate-/l/N/A
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6487.2%
Applied egg-rr87.2%
if -2.05e-39 < y < 1.51999999999999993e-58Initial program 95.6%
Taylor expanded in x around inf
*-lowering-*.f64N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6485.3%
Simplified85.3%
Final simplification88.8%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (+ x (/ y (/ t z))))) (if (<= t -1.7e-32) t_1 (if (<= t 1.3e+51) (/ (* (- y x) z) t) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x + (y / (t / z));
double tmp;
if (t <= -1.7e-32) {
tmp = t_1;
} else if (t <= 1.3e+51) {
tmp = ((y - x) * z) / 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 / (t / z))
if (t <= (-1.7d-32)) then
tmp = t_1
else if (t <= 1.3d+51) then
tmp = ((y - x) * z) / 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 / (t / z));
double tmp;
if (t <= -1.7e-32) {
tmp = t_1;
} else if (t <= 1.3e+51) {
tmp = ((y - x) * z) / t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x + (y / (t / z)) tmp = 0 if t <= -1.7e-32: tmp = t_1 elif t <= 1.3e+51: tmp = ((y - x) * z) / t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(y / Float64(t / z))) tmp = 0.0 if (t <= -1.7e-32) tmp = t_1; elseif (t <= 1.3e+51) tmp = Float64(Float64(Float64(y - x) * z) / t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + (y / (t / z)); tmp = 0.0; if (t <= -1.7e-32) tmp = t_1; elseif (t <= 1.3e+51) tmp = ((y - x) * z) / t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.7e-32], t$95$1, If[LessEqual[t, 1.3e+51], N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y}{\frac{t}{z}}\\
\mathbf{if}\;t \leq -1.7 \cdot 10^{-32}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.3 \cdot 10^{+51}:\\
\;\;\;\;\frac{\left(y - x\right) \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.69999999999999989e-32 or 1.3000000000000001e51 < t Initial program 86.4%
Taylor expanded in y around inf
/-lowering-/.f64N/A
*-lowering-*.f6481.4%
Simplified81.4%
+-commutativeN/A
+-lowering-+.f64N/A
associate-/l*N/A
clear-numN/A
div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6489.3%
Applied egg-rr89.3%
if -1.69999999999999989e-32 < t < 1.3000000000000001e51Initial program 98.5%
+-commutativeN/A
+-lowering-+.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f6497.1%
Applied egg-rr97.1%
Taylor expanded in t around 0
/-lowering-/.f64N/A
*-lowering-*.f64N/A
--lowering--.f6486.1%
Simplified86.1%
Final simplification87.5%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* z (/ (- y x) t)))) (if (<= z -4.3e+24) t_1 (if (<= z 7.7e-115) (* x (- 1.0 (/ z t))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = z * ((y - x) / t);
double tmp;
if (z <= -4.3e+24) {
tmp = t_1;
} else if (z <= 7.7e-115) {
tmp = x * (1.0 - (z / 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 * ((y - x) / t)
if (z <= (-4.3d+24)) then
tmp = t_1
else if (z <= 7.7d-115) then
tmp = x * (1.0d0 - (z / 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 * ((y - x) / t);
double tmp;
if (z <= -4.3e+24) {
tmp = t_1;
} else if (z <= 7.7e-115) {
tmp = x * (1.0 - (z / t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * ((y - x) / t) tmp = 0 if z <= -4.3e+24: tmp = t_1 elif z <= 7.7e-115: tmp = x * (1.0 - (z / t)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(Float64(y - x) / t)) tmp = 0.0 if (z <= -4.3e+24) tmp = t_1; elseif (z <= 7.7e-115) tmp = Float64(x * Float64(1.0 - Float64(z / t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * ((y - x) / t); tmp = 0.0; if (z <= -4.3e+24) tmp = t_1; elseif (z <= 7.7e-115) tmp = x * (1.0 - (z / t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.3e+24], t$95$1, If[LessEqual[z, 7.7e-115], N[(x * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \frac{y - x}{t}\\
\mathbf{if}\;z \leq -4.3 \cdot 10^{+24}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.7 \cdot 10^{-115}:\\
\;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.29999999999999987e24 or 7.7000000000000002e-115 < z Initial program 89.3%
Taylor expanded in z around inf
div-subN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6485.8%
Simplified85.8%
if -4.29999999999999987e24 < z < 7.7000000000000002e-115Initial program 98.9%
Taylor expanded in x around inf
*-lowering-*.f64N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6478.3%
Simplified78.3%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ y (/ t z)))) (if (<= y -5.5e+67) t_1 (if (<= y 7.2e+33) (* x (- 1.0 (/ z t))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = y / (t / z);
double tmp;
if (y <= -5.5e+67) {
tmp = t_1;
} else if (y <= 7.2e+33) {
tmp = x * (1.0 - (z / 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 = y / (t / z)
if (y <= (-5.5d+67)) then
tmp = t_1
else if (y <= 7.2d+33) then
tmp = x * (1.0d0 - (z / 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 = y / (t / z);
double tmp;
if (y <= -5.5e+67) {
tmp = t_1;
} else if (y <= 7.2e+33) {
tmp = x * (1.0 - (z / t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y / (t / z) tmp = 0 if y <= -5.5e+67: tmp = t_1 elif y <= 7.2e+33: tmp = x * (1.0 - (z / t)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y / Float64(t / z)) tmp = 0.0 if (y <= -5.5e+67) tmp = t_1; elseif (y <= 7.2e+33) tmp = Float64(x * Float64(1.0 - Float64(z / t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y / (t / z); tmp = 0.0; if (y <= -5.5e+67) tmp = t_1; elseif (y <= 7.2e+33) tmp = x * (1.0 - (z / t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.5e+67], t$95$1, If[LessEqual[y, 7.2e+33], N[(x * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{\frac{t}{z}}\\
\mathbf{if}\;y \leq -5.5 \cdot 10^{+67}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{+33}:\\
\;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -5.49999999999999968e67 or 7.2000000000000005e33 < y Initial program 90.8%
+-commutativeN/A
+-lowering-+.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f6499.0%
Applied egg-rr99.0%
Taylor expanded in y around inf
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6465.5%
Simplified65.5%
associate-/l*N/A
*-commutativeN/A
/-rgt-identityN/A
associate-/r/N/A
associate-/l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
div-invN/A
/-lowering-/.f6472.0%
Applied egg-rr72.0%
if -5.49999999999999968e67 < y < 7.2000000000000005e33Initial program 94.6%
Taylor expanded in x around inf
*-lowering-*.f64N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6480.1%
Simplified80.1%
(FPCore (x y z t) :precision binary64 (if (<= z -5.8e+24) (/ y (/ t z)) (if (<= z 2e-115) x (/ z (/ t y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.8e+24) {
tmp = y / (t / z);
} else if (z <= 2e-115) {
tmp = x;
} else {
tmp = 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 (z <= (-5.8d+24)) then
tmp = y / (t / z)
else if (z <= 2d-115) then
tmp = x
else
tmp = z / (t / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.8e+24) {
tmp = y / (t / z);
} else if (z <= 2e-115) {
tmp = x;
} else {
tmp = z / (t / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -5.8e+24: tmp = y / (t / z) elif z <= 2e-115: tmp = x else: tmp = z / (t / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -5.8e+24) tmp = Float64(y / Float64(t / z)); elseif (z <= 2e-115) tmp = x; else tmp = Float64(z / Float64(t / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -5.8e+24) tmp = y / (t / z); elseif (z <= 2e-115) tmp = x; else tmp = z / (t / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -5.8e+24], N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2e-115], x, N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{+24}:\\
\;\;\;\;\frac{y}{\frac{t}{z}}\\
\mathbf{elif}\;z \leq 2 \cdot 10^{-115}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{\frac{t}{y}}\\
\end{array}
\end{array}
if z < -5.79999999999999958e24Initial program 86.0%
+-commutativeN/A
+-lowering-+.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f6498.5%
Applied egg-rr98.5%
Taylor expanded in y around inf
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6453.0%
Simplified53.0%
associate-/l*N/A
*-commutativeN/A
/-rgt-identityN/A
associate-/r/N/A
associate-/l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
div-invN/A
/-lowering-/.f6461.2%
Applied egg-rr61.2%
if -5.79999999999999958e24 < z < 2.0000000000000001e-115Initial program 98.9%
Taylor expanded in z around 0
Simplified65.8%
if 2.0000000000000001e-115 < z Initial program 91.6%
+-commutativeN/A
+-lowering-+.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f6496.7%
Applied egg-rr96.7%
Taylor expanded in y around inf
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6448.6%
Simplified48.6%
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f6453.7%
Applied egg-rr53.7%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ y (/ t z)))) (if (<= z -2.2e+25) t_1 (if (<= z 1.15e-114) x t_1))))
double code(double x, double y, double z, double t) {
double t_1 = y / (t / z);
double tmp;
if (z <= -2.2e+25) {
tmp = t_1;
} else if (z <= 1.15e-114) {
tmp = 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 = y / (t / z)
if (z <= (-2.2d+25)) then
tmp = t_1
else if (z <= 1.15d-114) then
tmp = 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 = y / (t / z);
double tmp;
if (z <= -2.2e+25) {
tmp = t_1;
} else if (z <= 1.15e-114) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y / (t / z) tmp = 0 if z <= -2.2e+25: tmp = t_1 elif z <= 1.15e-114: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y / Float64(t / z)) tmp = 0.0 if (z <= -2.2e+25) tmp = t_1; elseif (z <= 1.15e-114) tmp = x; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y / (t / z); tmp = 0.0; if (z <= -2.2e+25) tmp = t_1; elseif (z <= 1.15e-114) tmp = x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.2e+25], t$95$1, If[LessEqual[z, 1.15e-114], x, t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{\frac{t}{z}}\\
\mathbf{if}\;z \leq -2.2 \cdot 10^{+25}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{-114}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.2000000000000001e25 or 1.15e-114 < z Initial program 89.3%
+-commutativeN/A
+-lowering-+.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f6497.5%
Applied egg-rr97.5%
Taylor expanded in y around inf
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6450.4%
Simplified50.4%
associate-/l*N/A
*-commutativeN/A
/-rgt-identityN/A
associate-/r/N/A
associate-/l/N/A
/-lowering-/.f64N/A
*-commutativeN/A
div-invN/A
/-lowering-/.f6456.2%
Applied egg-rr56.2%
if -2.2000000000000001e25 < z < 1.15e-114Initial program 98.9%
Taylor expanded in z around 0
Simplified65.8%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* y (/ z t)))) (if (<= z -5.8e+24) t_1 (if (<= z 7.4e-115) x t_1))))
double code(double x, double y, double z, double t) {
double t_1 = y * (z / t);
double tmp;
if (z <= -5.8e+24) {
tmp = t_1;
} else if (z <= 7.4e-115) {
tmp = 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 = y * (z / t)
if (z <= (-5.8d+24)) then
tmp = t_1
else if (z <= 7.4d-115) then
tmp = 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 = y * (z / t);
double tmp;
if (z <= -5.8e+24) {
tmp = t_1;
} else if (z <= 7.4e-115) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = y * (z / t) tmp = 0 if z <= -5.8e+24: tmp = t_1 elif z <= 7.4e-115: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(y * Float64(z / t)) tmp = 0.0 if (z <= -5.8e+24) tmp = t_1; elseif (z <= 7.4e-115) tmp = x; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y * (z / t); tmp = 0.0; if (z <= -5.8e+24) tmp = t_1; elseif (z <= 7.4e-115) tmp = x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.8e+24], t$95$1, If[LessEqual[z, 7.4e-115], x, t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z}{t}\\
\mathbf{if}\;z \leq -5.8 \cdot 10^{+24}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.4 \cdot 10^{-115}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5.79999999999999958e24 or 7.4e-115 < z Initial program 89.3%
+-commutativeN/A
+-lowering-+.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f6497.5%
Applied egg-rr97.5%
Taylor expanded in y around inf
/-lowering-/.f64N/A
*-commutativeN/A
*-lowering-*.f6450.4%
Simplified50.4%
associate-*l/N/A
*-lowering-*.f64N/A
/-lowering-/.f6456.2%
Applied egg-rr56.2%
if -5.79999999999999958e24 < z < 7.4e-115Initial program 98.9%
Taylor expanded in z around 0
Simplified65.8%
Final simplification59.9%
(FPCore (x y z t) :precision binary64 (+ x (* (- y x) (/ z t))))
double code(double x, double y, double z, double t) {
return x + ((y - x) * (z / 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 - x) * (z / t))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - x) * (z / t));
}
def code(x, y, z, t): return x + ((y - x) * (z / t))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - x) * Float64(z / t))) end
function tmp = code(x, y, z, t) tmp = x + ((y - x) * (z / t)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - x), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - x\right) \cdot \frac{z}{t}
\end{array}
Initial program 93.0%
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6498.0%
Applied egg-rr98.0%
Final simplification98.0%
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
return 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 = x
end function
public static double code(double x, double y, double z, double t) {
return x;
}
def code(x, y, z, t): return x
function code(x, y, z, t) return x end
function tmp = code(x, y, z, t) tmp = x; end
code[x_, y_, z_, t_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 93.0%
Taylor expanded in z around 0
Simplified34.4%
(FPCore (x y z t)
:precision binary64
(if (< x -9.025511195533005e-135)
(- x (* (/ z t) (- x y)))
(if (< x 4.275032163700715e-250)
(+ x (* (/ (- y x) t) z))
(+ x (/ (- y x) (/ t z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (x < -9.025511195533005e-135) {
tmp = x - ((z / t) * (x - y));
} else if (x < 4.275032163700715e-250) {
tmp = x + (((y - x) / t) * z);
} else {
tmp = x + ((y - x) / (t / 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 (x < (-9.025511195533005d-135)) then
tmp = x - ((z / t) * (x - y))
else if (x < 4.275032163700715d-250) then
tmp = x + (((y - x) / t) * z)
else
tmp = x + ((y - x) / (t / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x < -9.025511195533005e-135) {
tmp = x - ((z / t) * (x - y));
} else if (x < 4.275032163700715e-250) {
tmp = x + (((y - x) / t) * z);
} else {
tmp = x + ((y - x) / (t / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x < -9.025511195533005e-135: tmp = x - ((z / t) * (x - y)) elif x < 4.275032163700715e-250: tmp = x + (((y - x) / t) * z) else: tmp = x + ((y - x) / (t / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (x < -9.025511195533005e-135) tmp = Float64(x - Float64(Float64(z / t) * Float64(x - y))); elseif (x < 4.275032163700715e-250) tmp = Float64(x + Float64(Float64(Float64(y - x) / t) * z)); else tmp = Float64(x + Float64(Float64(y - x) / Float64(t / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x < -9.025511195533005e-135) tmp = x - ((z / t) * (x - y)); elseif (x < 4.275032163700715e-250) tmp = x + (((y - x) / t) * z); else tmp = x + ((y - x) / (t / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Less[x, -9.025511195533005e-135], N[(x - N[(N[(z / t), $MachinePrecision] * N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Less[x, 4.275032163700715e-250], N[(x + N[(N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - x), $MachinePrecision] / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x < -9.025511195533005 \cdot 10^{-135}:\\
\;\;\;\;x - \frac{z}{t} \cdot \left(x - y\right)\\
\mathbf{elif}\;x < 4.275032163700715 \cdot 10^{-250}:\\
\;\;\;\;x + \frac{y - x}{t} \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y - x}{\frac{t}{z}}\\
\end{array}
\end{array}
herbie shell --seed 2024158
(FPCore (x y z t)
:name "Numeric.Histogram:binBounds from Chart-1.5.3"
:precision binary64
:alt
(! :herbie-platform default (if (< x -1805102239106601/200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- x (* (/ z t) (- x y))) (if (< x 855006432740143/2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ x (* (/ (- y x) t) z)) (+ x (/ (- y x) (/ t z))))))
(+ x (/ (* (- y x) z) t)))