
(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 13 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 (if (<= z -1e+168) (- x (* z (/ (- x y) t))) (+ x (* (- y x) (/ z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1e+168) {
tmp = x - (z * ((x - y) / t));
} else {
tmp = x + ((y - x) * (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 (z <= (-1d+168)) then
tmp = x - (z * ((x - y) / t))
else
tmp = x + ((y - x) * (z / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1e+168) {
tmp = x - (z * ((x - y) / t));
} else {
tmp = x + ((y - x) * (z / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1e+168: tmp = x - (z * ((x - y) / t)) else: tmp = x + ((y - x) * (z / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1e+168) tmp = Float64(x - Float64(z * Float64(Float64(x - y) / t))); else tmp = Float64(x + Float64(Float64(y - x) * Float64(z / t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1e+168) tmp = x - (z * ((x - y) / t)); else tmp = x + ((y - x) * (z / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1e+168], N[(x - N[(z * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - x), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{+168}:\\
\;\;\;\;x - z \cdot \frac{x - y}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - x\right) \cdot \frac{z}{t}\\
\end{array}
\end{array}
if z < -9.9999999999999993e167Initial program 96.8%
associate-/l*84.8%
Simplified84.8%
Taylor expanded in y around 0 87.1%
mul-1-neg87.1%
associate-/l*65.4%
distribute-lft-neg-out65.4%
+-commutative65.4%
associate-*r/68.2%
distribute-rgt-out84.8%
sub-neg84.8%
associate-*l/96.8%
associate-*r/98.1%
Simplified98.1%
if -9.9999999999999993e167 < z Initial program 96.1%
associate-/l*99.5%
Simplified99.5%
Final simplification99.3%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.75e-167) (not (<= z 3.3e-94))) (- x (* z (/ (- x y) t))) (+ x (/ (* y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.75e-167) || !(z <= 3.3e-94)) {
tmp = x - (z * ((x - y) / t));
} 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 ((z <= (-1.75d-167)) .or. (.not. (z <= 3.3d-94))) then
tmp = x - (z * ((x - y) / t))
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 ((z <= -1.75e-167) || !(z <= 3.3e-94)) {
tmp = x - (z * ((x - y) / t));
} else {
tmp = x + ((y * z) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.75e-167) or not (z <= 3.3e-94): tmp = x - (z * ((x - y) / t)) else: tmp = x + ((y * z) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.75e-167) || !(z <= 3.3e-94)) tmp = Float64(x - Float64(z * Float64(Float64(x - y) / t))); else tmp = Float64(x + Float64(Float64(y * z) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.75e-167) || ~((z <= 3.3e-94))) tmp = x - (z * ((x - y) / t)); else tmp = x + ((y * z) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.75e-167], N[Not[LessEqual[z, 3.3e-94]], $MachinePrecision]], N[(x - N[(z * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{-167} \lor \neg \left(z \leq 3.3 \cdot 10^{-94}\right):\\
\;\;\;\;x - z \cdot \frac{x - y}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{t}\\
\end{array}
\end{array}
if z < -1.75e-167 or 3.3000000000000001e-94 < z Initial program 94.9%
associate-/l*97.2%
Simplified97.2%
Taylor expanded in y around 0 86.2%
mul-1-neg86.2%
associate-/l*82.2%
distribute-lft-neg-out82.2%
+-commutative82.2%
associate-*r/85.4%
distribute-rgt-out97.2%
sub-neg97.2%
associate-*l/94.9%
associate-*r/98.5%
Simplified98.5%
if -1.75e-167 < z < 3.3000000000000001e-94Initial program 98.8%
Taylor expanded in y around inf 95.3%
*-commutative95.3%
Simplified95.3%
Final simplification97.4%
(FPCore (x y z t) :precision binary64 (if (or (<= y -9.5e+23) (not (<= y 3e+51))) (+ x (* y (/ z t))) (* x (- 1.0 (/ z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -9.5e+23) || !(y <= 3e+51)) {
tmp = x + (y * (z / t));
} else {
tmp = x * (1.0 - (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 ((y <= (-9.5d+23)) .or. (.not. (y <= 3d+51))) then
tmp = x + (y * (z / t))
else
tmp = x * (1.0d0 - (z / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -9.5e+23) || !(y <= 3e+51)) {
tmp = x + (y * (z / t));
} else {
tmp = x * (1.0 - (z / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -9.5e+23) or not (y <= 3e+51): tmp = x + (y * (z / t)) else: tmp = x * (1.0 - (z / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -9.5e+23) || !(y <= 3e+51)) tmp = Float64(x + Float64(y * Float64(z / t))); else tmp = Float64(x * Float64(1.0 - Float64(z / t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -9.5e+23) || ~((y <= 3e+51))) tmp = x + (y * (z / t)); else tmp = x * (1.0 - (z / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -9.5e+23], N[Not[LessEqual[y, 3e+51]], $MachinePrecision]], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.5 \cdot 10^{+23} \lor \neg \left(y \leq 3 \cdot 10^{+51}\right):\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\
\end{array}
\end{array}
if y < -9.50000000000000038e23 or 3e51 < y Initial program 93.9%
associate-/l*99.0%
Simplified99.0%
Taylor expanded in y around inf 86.1%
associate-*r/90.5%
Simplified90.5%
if -9.50000000000000038e23 < y < 3e51Initial program 97.9%
associate-/l*96.7%
Simplified96.7%
Taylor expanded in y around 0 85.1%
mul-1-neg85.1%
associate-/l*86.3%
distribute-lft-neg-out86.3%
*-commutative86.3%
Simplified86.3%
Taylor expanded in x around 0 86.3%
mul-1-neg86.3%
unsub-neg86.3%
Simplified86.3%
Final simplification88.1%
(FPCore (x y z t) :precision binary64 (if (or (<= y -9e+23) (not (<= y 7.2e+49))) (+ x (/ y (/ t z))) (* x (- 1.0 (/ z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -9e+23) || !(y <= 7.2e+49)) {
tmp = x + (y / (t / z));
} else {
tmp = x * (1.0 - (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 ((y <= (-9d+23)) .or. (.not. (y <= 7.2d+49))) then
tmp = x + (y / (t / z))
else
tmp = x * (1.0d0 - (z / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -9e+23) || !(y <= 7.2e+49)) {
tmp = x + (y / (t / z));
} else {
tmp = x * (1.0 - (z / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -9e+23) or not (y <= 7.2e+49): tmp = x + (y / (t / z)) else: tmp = x * (1.0 - (z / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -9e+23) || !(y <= 7.2e+49)) tmp = Float64(x + Float64(y / Float64(t / z))); else tmp = Float64(x * Float64(1.0 - Float64(z / t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -9e+23) || ~((y <= 7.2e+49))) tmp = x + (y / (t / z)); else tmp = x * (1.0 - (z / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -9e+23], N[Not[LessEqual[y, 7.2e+49]], $MachinePrecision]], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{+23} \lor \neg \left(y \leq 7.2 \cdot 10^{+49}\right):\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\
\end{array}
\end{array}
if y < -8.99999999999999958e23 or 7.19999999999999993e49 < y Initial program 93.9%
associate-/l*99.0%
Simplified99.0%
Taylor expanded in y around inf 86.1%
associate-*r/90.5%
Simplified90.5%
clear-num90.4%
div-inv90.5%
Applied egg-rr90.5%
if -8.99999999999999958e23 < y < 7.19999999999999993e49Initial program 97.9%
associate-/l*96.7%
Simplified96.7%
Taylor expanded in y around 0 85.1%
mul-1-neg85.1%
associate-/l*86.3%
distribute-lft-neg-out86.3%
*-commutative86.3%
Simplified86.3%
Taylor expanded in x around 0 86.3%
mul-1-neg86.3%
unsub-neg86.3%
Simplified86.3%
Final simplification88.1%
(FPCore (x y z t) :precision binary64 (if (or (<= y -9e+23) (not (<= y 1.7e+50))) (+ x (/ y (/ t z))) (- x (/ x (/ t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -9e+23) || !(y <= 1.7e+50)) {
tmp = x + (y / (t / z));
} else {
tmp = x - (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 ((y <= (-9d+23)) .or. (.not. (y <= 1.7d+50))) then
tmp = x + (y / (t / z))
else
tmp = x - (x / (t / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -9e+23) || !(y <= 1.7e+50)) {
tmp = x + (y / (t / z));
} else {
tmp = x - (x / (t / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -9e+23) or not (y <= 1.7e+50): tmp = x + (y / (t / z)) else: tmp = x - (x / (t / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -9e+23) || !(y <= 1.7e+50)) tmp = Float64(x + Float64(y / Float64(t / z))); else tmp = Float64(x - Float64(x / Float64(t / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -9e+23) || ~((y <= 1.7e+50))) tmp = x + (y / (t / z)); else tmp = x - (x / (t / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -9e+23], N[Not[LessEqual[y, 1.7e+50]], $MachinePrecision]], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(x / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{+23} \lor \neg \left(y \leq 1.7 \cdot 10^{+50}\right):\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{x}{\frac{t}{z}}\\
\end{array}
\end{array}
if y < -8.99999999999999958e23 or 1.6999999999999999e50 < y Initial program 93.9%
associate-/l*99.0%
Simplified99.0%
Taylor expanded in y around inf 86.1%
associate-*r/90.5%
Simplified90.5%
clear-num90.4%
div-inv90.5%
Applied egg-rr90.5%
if -8.99999999999999958e23 < y < 1.6999999999999999e50Initial program 97.9%
associate-/l*96.7%
Simplified96.7%
Taylor expanded in y around 0 85.1%
mul-1-neg85.1%
associate-/l*86.3%
distribute-lft-neg-out86.3%
*-commutative86.3%
Simplified86.3%
distribute-rgt-neg-out86.3%
unsub-neg86.3%
*-commutative86.3%
Applied egg-rr86.3%
Taylor expanded in x around 0 85.1%
associate-*l/81.7%
associate-/r/86.3%
Simplified86.3%
Final simplification88.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -9e+39) (not (<= z 8.5e-72))) (* z (/ x (- t))) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -9e+39) || !(z <= 8.5e-72)) {
tmp = z * (x / -t);
} else {
tmp = 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 <= (-9d+39)) .or. (.not. (z <= 8.5d-72))) then
tmp = z * (x / -t)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -9e+39) || !(z <= 8.5e-72)) {
tmp = z * (x / -t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -9e+39) or not (z <= 8.5e-72): tmp = z * (x / -t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -9e+39) || !(z <= 8.5e-72)) tmp = Float64(z * Float64(x / Float64(-t))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -9e+39) || ~((z <= 8.5e-72))) tmp = z * (x / -t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -9e+39], N[Not[LessEqual[z, 8.5e-72]], $MachinePrecision]], N[(z * N[(x / (-t)), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{+39} \lor \neg \left(z \leq 8.5 \cdot 10^{-72}\right):\\
\;\;\;\;z \cdot \frac{x}{-t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -8.99999999999999991e39 or 8.50000000000000008e-72 < z Initial program 94.0%
associate-/l*96.7%
Simplified96.7%
Taylor expanded in y around 0 56.2%
mul-1-neg56.2%
associate-/l*58.7%
distribute-lft-neg-out58.7%
*-commutative58.7%
Simplified58.7%
Taylor expanded in x around 0 58.7%
mul-1-neg58.7%
unsub-neg58.7%
Simplified58.7%
Taylor expanded in z around inf 43.9%
*-commutative43.9%
associate-*r/44.5%
neg-mul-144.5%
distribute-rgt-neg-in44.5%
distribute-neg-frac244.5%
Simplified44.5%
if -8.99999999999999991e39 < z < 8.50000000000000008e-72Initial program 99.1%
associate-/l*99.0%
Simplified99.0%
Taylor expanded in y around 0 73.0%
mul-1-neg73.0%
associate-/l*73.8%
distribute-lft-neg-out73.8%
*-commutative73.8%
Simplified73.8%
Taylor expanded in z around 0 64.9%
Final simplification53.2%
(FPCore (x y z t) :precision binary64 (if (<= z -6.2e+35) (* z (/ x (- t))) (if (<= z 8.5e-72) x (* x (/ z (- t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6.2e+35) {
tmp = z * (x / -t);
} else if (z <= 8.5e-72) {
tmp = x;
} else {
tmp = x * (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 (z <= (-6.2d+35)) then
tmp = z * (x / -t)
else if (z <= 8.5d-72) then
tmp = x
else
tmp = x * (z / -t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6.2e+35) {
tmp = z * (x / -t);
} else if (z <= 8.5e-72) {
tmp = x;
} else {
tmp = x * (z / -t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -6.2e+35: tmp = z * (x / -t) elif z <= 8.5e-72: tmp = x else: tmp = x * (z / -t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -6.2e+35) tmp = Float64(z * Float64(x / Float64(-t))); elseif (z <= 8.5e-72) tmp = x; else tmp = Float64(x * Float64(z / Float64(-t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -6.2e+35) tmp = z * (x / -t); elseif (z <= 8.5e-72) tmp = x; else tmp = x * (z / -t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -6.2e+35], N[(z * N[(x / (-t)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.5e-72], x, N[(x * N[(z / (-t)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.2 \cdot 10^{+35}:\\
\;\;\;\;z \cdot \frac{x}{-t}\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{-72}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{z}{-t}\\
\end{array}
\end{array}
if z < -6.19999999999999973e35Initial program 95.3%
associate-/l*92.7%
Simplified92.7%
Taylor expanded in y around 0 59.9%
mul-1-neg59.9%
associate-/l*59.8%
distribute-lft-neg-out59.8%
*-commutative59.8%
Simplified59.8%
Taylor expanded in x around 0 59.8%
mul-1-neg59.8%
unsub-neg59.8%
Simplified59.8%
Taylor expanded in z around inf 45.0%
*-commutative45.0%
associate-*r/45.0%
neg-mul-145.0%
distribute-rgt-neg-in45.0%
distribute-neg-frac245.0%
Simplified45.0%
if -6.19999999999999973e35 < z < 8.50000000000000008e-72Initial program 99.1%
associate-/l*99.0%
Simplified99.0%
Taylor expanded in y around 0 73.0%
mul-1-neg73.0%
associate-/l*73.8%
distribute-lft-neg-out73.8%
*-commutative73.8%
Simplified73.8%
Taylor expanded in z around 0 64.9%
if 8.50000000000000008e-72 < z Initial program 93.0%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in y around 0 53.2%
mul-1-neg53.2%
associate-/l*57.8%
distribute-lft-neg-out57.8%
*-commutative57.8%
Simplified57.8%
Taylor expanded in x around 0 57.8%
mul-1-neg57.8%
unsub-neg57.8%
Simplified57.8%
Taylor expanded in z around inf 43.1%
mul-1-neg43.1%
associate-/l*46.5%
distribute-lft-neg-in46.5%
*-commutative46.5%
Simplified46.5%
Final simplification53.9%
(FPCore (x y z t) :precision binary64 (if (<= z -7.6e+37) (/ z (/ (- t) x)) (if (<= z 8.5e-72) x (* x (/ z (- t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -7.6e+37) {
tmp = z / (-t / x);
} else if (z <= 8.5e-72) {
tmp = x;
} else {
tmp = x * (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 (z <= (-7.6d+37)) then
tmp = z / (-t / x)
else if (z <= 8.5d-72) then
tmp = x
else
tmp = x * (z / -t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -7.6e+37) {
tmp = z / (-t / x);
} else if (z <= 8.5e-72) {
tmp = x;
} else {
tmp = x * (z / -t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -7.6e+37: tmp = z / (-t / x) elif z <= 8.5e-72: tmp = x else: tmp = x * (z / -t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -7.6e+37) tmp = Float64(z / Float64(Float64(-t) / x)); elseif (z <= 8.5e-72) tmp = x; else tmp = Float64(x * Float64(z / Float64(-t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -7.6e+37) tmp = z / (-t / x); elseif (z <= 8.5e-72) tmp = x; else tmp = x * (z / -t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -7.6e+37], N[(z / N[((-t) / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.5e-72], x, N[(x * N[(z / (-t)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.6 \cdot 10^{+37}:\\
\;\;\;\;\frac{z}{\frac{-t}{x}}\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{-72}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{z}{-t}\\
\end{array}
\end{array}
if z < -7.59999999999999979e37Initial program 95.3%
associate-/l*92.7%
Simplified92.7%
Taylor expanded in y around 0 59.9%
mul-1-neg59.9%
associate-/l*59.8%
distribute-lft-neg-out59.8%
*-commutative59.8%
Simplified59.8%
Taylor expanded in x around 0 59.8%
mul-1-neg59.8%
unsub-neg59.8%
Simplified59.8%
Taylor expanded in z around inf 45.0%
*-commutative45.0%
associate-*r/45.0%
neg-mul-145.0%
distribute-rgt-neg-in45.0%
distribute-neg-frac245.0%
Simplified45.0%
associate-*r/45.0%
distribute-frac-neg245.0%
associate-*l/43.5%
associate-/r/45.0%
distribute-neg-frac45.0%
Applied egg-rr45.0%
if -7.59999999999999979e37 < z < 8.50000000000000008e-72Initial program 99.1%
associate-/l*99.0%
Simplified99.0%
Taylor expanded in y around 0 73.0%
mul-1-neg73.0%
associate-/l*73.8%
distribute-lft-neg-out73.8%
*-commutative73.8%
Simplified73.8%
Taylor expanded in z around 0 64.9%
if 8.50000000000000008e-72 < z Initial program 93.0%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in y around 0 53.2%
mul-1-neg53.2%
associate-/l*57.8%
distribute-lft-neg-out57.8%
*-commutative57.8%
Simplified57.8%
Taylor expanded in x around 0 57.8%
mul-1-neg57.8%
unsub-neg57.8%
Simplified57.8%
Taylor expanded in z around inf 43.1%
mul-1-neg43.1%
associate-/l*46.5%
distribute-lft-neg-in46.5%
*-commutative46.5%
Simplified46.5%
Final simplification53.9%
(FPCore (x y z t) :precision binary64 (if (<= z -9e+29) (/ (* x z) (- t)) (if (<= z 2.05e-76) x (* x (/ z (- t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -9e+29) {
tmp = (x * z) / -t;
} else if (z <= 2.05e-76) {
tmp = x;
} else {
tmp = x * (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 (z <= (-9d+29)) then
tmp = (x * z) / -t
else if (z <= 2.05d-76) then
tmp = x
else
tmp = x * (z / -t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -9e+29) {
tmp = (x * z) / -t;
} else if (z <= 2.05e-76) {
tmp = x;
} else {
tmp = x * (z / -t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -9e+29: tmp = (x * z) / -t elif z <= 2.05e-76: tmp = x else: tmp = x * (z / -t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -9e+29) tmp = Float64(Float64(x * z) / Float64(-t)); elseif (z <= 2.05e-76) tmp = x; else tmp = Float64(x * Float64(z / Float64(-t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -9e+29) tmp = (x * z) / -t; elseif (z <= 2.05e-76) tmp = x; else tmp = x * (z / -t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -9e+29], N[(N[(x * z), $MachinePrecision] / (-t)), $MachinePrecision], If[LessEqual[z, 2.05e-76], x, N[(x * N[(z / (-t)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{+29}:\\
\;\;\;\;\frac{x \cdot z}{-t}\\
\mathbf{elif}\;z \leq 2.05 \cdot 10^{-76}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{z}{-t}\\
\end{array}
\end{array}
if z < -9.0000000000000005e29Initial program 95.3%
associate-/l*92.7%
Simplified92.7%
Taylor expanded in y around 0 59.9%
mul-1-neg59.9%
associate-/l*59.8%
distribute-lft-neg-out59.8%
*-commutative59.8%
Simplified59.8%
Taylor expanded in x around 0 59.8%
mul-1-neg59.8%
unsub-neg59.8%
Simplified59.8%
Taylor expanded in z around inf 45.0%
*-commutative45.0%
associate-*r/45.0%
neg-mul-145.0%
distribute-rgt-neg-in45.0%
distribute-neg-frac245.0%
Simplified45.0%
*-commutative45.0%
distribute-frac-neg245.0%
distribute-frac-neg45.0%
associate-*l/45.0%
Applied egg-rr45.0%
if -9.0000000000000005e29 < z < 2.0499999999999999e-76Initial program 99.1%
associate-/l*99.0%
Simplified99.0%
Taylor expanded in y around 0 73.0%
mul-1-neg73.0%
associate-/l*73.8%
distribute-lft-neg-out73.8%
*-commutative73.8%
Simplified73.8%
Taylor expanded in z around 0 64.9%
if 2.0499999999999999e-76 < z Initial program 93.0%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in y around 0 53.2%
mul-1-neg53.2%
associate-/l*57.8%
distribute-lft-neg-out57.8%
*-commutative57.8%
Simplified57.8%
Taylor expanded in x around 0 57.8%
mul-1-neg57.8%
unsub-neg57.8%
Simplified57.8%
Taylor expanded in z around inf 43.1%
mul-1-neg43.1%
associate-/l*46.5%
distribute-lft-neg-in46.5%
*-commutative46.5%
Simplified46.5%
Final simplification53.9%
(FPCore (x y z t) :precision binary64 (if (<= z 2.5e+163) x (* x (/ z t))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 2.5e+163) {
tmp = x;
} else {
tmp = x * (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 (z <= 2.5d+163) then
tmp = x
else
tmp = x * (z / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 2.5e+163) {
tmp = x;
} else {
tmp = x * (z / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= 2.5e+163: tmp = x else: tmp = x * (z / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= 2.5e+163) tmp = x; else tmp = Float64(x * Float64(z / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= 2.5e+163) tmp = x; else tmp = x * (z / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, 2.5e+163], x, N[(x * N[(z / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2.5 \cdot 10^{+163}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{z}{t}\\
\end{array}
\end{array}
if z < 2.5e163Initial program 96.4%
associate-/l*97.3%
Simplified97.3%
Taylor expanded in y around 0 65.1%
mul-1-neg65.1%
associate-/l*66.8%
distribute-lft-neg-out66.8%
*-commutative66.8%
Simplified66.8%
Taylor expanded in z around 0 42.0%
if 2.5e163 < z Initial program 94.7%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in y around 0 52.3%
mul-1-neg52.3%
associate-/l*55.0%
distribute-lft-neg-out55.0%
*-commutative55.0%
Simplified55.0%
Taylor expanded in x around 0 55.0%
mul-1-neg55.0%
unsub-neg55.0%
Simplified55.0%
Taylor expanded in z around inf 49.7%
mul-1-neg49.7%
associate-/l*52.3%
distribute-lft-neg-in52.3%
*-commutative52.3%
Simplified52.3%
*-commutative52.3%
clear-num52.4%
un-div-inv52.4%
add-sqr-sqrt40.2%
sqrt-unprod41.2%
sqr-neg41.2%
sqrt-unprod3.8%
add-sqr-sqrt21.6%
add021.6%
div-inv21.6%
clear-num21.6%
Applied egg-rr21.6%
add021.6%
Simplified21.6%
Final simplification39.2%
(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 96.2%
associate-/l*97.7%
Simplified97.7%
clear-num97.7%
un-div-inv98.0%
Applied egg-rr98.0%
Final simplification98.0%
(FPCore (x y z t) :precision binary64 (* x (- 1.0 (/ z t))))
double code(double x, double y, double z, double t) {
return x * (1.0 - (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 * (1.0d0 - (z / t))
end function
public static double code(double x, double y, double z, double t) {
return x * (1.0 - (z / t));
}
def code(x, y, z, t): return x * (1.0 - (z / t))
function code(x, y, z, t) return Float64(x * Float64(1.0 - Float64(z / t))) end
function tmp = code(x, y, z, t) tmp = x * (1.0 - (z / t)); end
code[x_, y_, z_, t_] := N[(x * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(1 - \frac{z}{t}\right)
\end{array}
Initial program 96.2%
associate-/l*97.7%
Simplified97.7%
Taylor expanded in y around 0 63.4%
mul-1-neg63.4%
associate-/l*65.1%
distribute-lft-neg-out65.1%
*-commutative65.1%
Simplified65.1%
Taylor expanded in x around 0 65.1%
mul-1-neg65.1%
unsub-neg65.1%
Simplified65.1%
Final simplification65.1%
(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 96.2%
associate-/l*97.7%
Simplified97.7%
Taylor expanded in y around 0 63.4%
mul-1-neg63.4%
associate-/l*65.1%
distribute-lft-neg-out65.1%
*-commutative65.1%
Simplified65.1%
Taylor expanded in z around 0 37.0%
Final simplification37.0%
(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 2024046
(FPCore (x y z t)
:name "Numeric.Histogram:binBounds from Chart-1.5.3"
:precision binary64
:alt
(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)))))
(+ x (/ (* (- y x) z) t)))