
(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 10 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 91.8%
associate-/l*98.0%
Simplified98.0%
clear-num98.0%
un-div-inv98.1%
Applied egg-rr98.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.4e-79) (not (<= z 1.12e-181))) (+ x (* z (/ (- y x) t))) (+ x (/ y (/ t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.4e-79) || !(z <= 1.12e-181)) {
tmp = x + (z * ((y - x) / t));
} else {
tmp = x + (y / (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 ((z <= (-2.4d-79)) .or. (.not. (z <= 1.12d-181))) then
tmp = x + (z * ((y - x) / t))
else
tmp = x + (y / (t / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.4e-79) || !(z <= 1.12e-181)) {
tmp = x + (z * ((y - x) / t));
} else {
tmp = x + (y / (t / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.4e-79) or not (z <= 1.12e-181): tmp = x + (z * ((y - x) / t)) else: tmp = x + (y / (t / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.4e-79) || !(z <= 1.12e-181)) tmp = Float64(x + Float64(z * Float64(Float64(y - x) / t))); else tmp = Float64(x + Float64(y / Float64(t / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2.4e-79) || ~((z <= 1.12e-181))) tmp = x + (z * ((y - x) / t)); else tmp = x + (y / (t / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.4e-79], N[Not[LessEqual[z, 1.12e-181]], $MachinePrecision]], N[(x + N[(z * N[(N[(y - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{-79} \lor \neg \left(z \leq 1.12 \cdot 10^{-181}\right):\\
\;\;\;\;x + z \cdot \frac{y - x}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\end{array}
\end{array}
if z < -2.40000000000000006e-79 or 1.11999999999999997e-181 < z Initial program 88.7%
associate-/l*97.6%
Simplified97.6%
Taylor expanded in y around 0 80.4%
+-commutative80.4%
associate-*r/80.2%
mul-1-neg80.2%
associate-/l*85.6%
distribute-lft-neg-out85.6%
distribute-rgt-out97.6%
sub-neg97.6%
associate-*l/88.7%
associate-*r/95.8%
Simplified95.8%
if -2.40000000000000006e-79 < z < 1.11999999999999997e-181Initial program 97.7%
associate-/l*98.9%
Simplified98.9%
clear-num98.8%
un-div-inv98.9%
Applied egg-rr98.9%
Taylor expanded in y around inf 94.4%
Final simplification95.3%
(FPCore (x y z t) :precision binary64 (if (or (<= x -3.6e+68) (not (<= x 4.2e-12))) (- x (* x (/ z t))) (+ x (* y (/ z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.6e+68) || !(x <= 4.2e-12)) {
tmp = x - (x * (z / 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 ((x <= (-3.6d+68)) .or. (.not. (x <= 4.2d-12))) then
tmp = x - (x * (z / 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 ((x <= -3.6e+68) || !(x <= 4.2e-12)) {
tmp = x - (x * (z / t));
} else {
tmp = x + (y * (z / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -3.6e+68) or not (x <= 4.2e-12): tmp = x - (x * (z / t)) else: tmp = x + (y * (z / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -3.6e+68) || !(x <= 4.2e-12)) tmp = Float64(x - Float64(x * Float64(z / t))); 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 <= -3.6e+68) || ~((x <= 4.2e-12))) tmp = x - (x * (z / t)); else tmp = x + (y * (z / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -3.6e+68], N[Not[LessEqual[x, 4.2e-12]], $MachinePrecision]], N[(x - N[(x * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.6 \cdot 10^{+68} \lor \neg \left(x \leq 4.2 \cdot 10^{-12}\right):\\
\;\;\;\;x - x \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if x < -3.5999999999999999e68 or 4.19999999999999988e-12 < x Initial program 89.5%
associate-/l*99.9%
Simplified99.9%
clear-num99.9%
un-div-inv99.9%
Applied egg-rr99.9%
Taylor expanded in x around inf 89.8%
mul-1-neg89.8%
unsub-neg89.8%
distribute-lft-out--89.8%
*-rgt-identity89.8%
Simplified89.8%
if -3.5999999999999999e68 < x < 4.19999999999999988e-12Initial program 94.4%
associate-/l*96.0%
Simplified96.0%
Taylor expanded in y around inf 83.4%
associate-*r/86.9%
Simplified86.9%
Final simplification88.4%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.28e+69) (not (<= x 1.08e-14))) (* x (- 1.0 (/ z t))) (+ x (* y (/ z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.28e+69) || !(x <= 1.08e-14)) {
tmp = x * (1.0 - (z / 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 ((x <= (-1.28d+69)) .or. (.not. (x <= 1.08d-14))) then
tmp = x * (1.0d0 - (z / 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 ((x <= -1.28e+69) || !(x <= 1.08e-14)) {
tmp = x * (1.0 - (z / t));
} else {
tmp = x + (y * (z / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.28e+69) or not (x <= 1.08e-14): tmp = x * (1.0 - (z / t)) else: tmp = x + (y * (z / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.28e+69) || !(x <= 1.08e-14)) tmp = Float64(x * Float64(1.0 - Float64(z / t))); 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 <= -1.28e+69) || ~((x <= 1.08e-14))) tmp = x * (1.0 - (z / t)); else tmp = x + (y * (z / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.28e+69], N[Not[LessEqual[x, 1.08e-14]], $MachinePrecision]], N[(x * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.28 \cdot 10^{+69} \lor \neg \left(x \leq 1.08 \cdot 10^{-14}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if x < -1.27999999999999998e69 or 1.08000000000000004e-14 < x Initial program 89.5%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in x around inf 89.8%
mul-1-neg89.8%
unsub-neg89.8%
Simplified89.8%
if -1.27999999999999998e69 < x < 1.08000000000000004e-14Initial program 94.4%
associate-/l*96.0%
Simplified96.0%
Taylor expanded in y around inf 83.4%
associate-*r/86.9%
Simplified86.9%
Final simplification88.4%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.65e-102) (not (<= x 1.08e-91))) (* x (- 1.0 (/ z t))) (* y (/ z t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.65e-102) || !(x <= 1.08e-91)) {
tmp = x * (1.0 - (z / t));
} else {
tmp = 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 <= (-2.65d-102)) .or. (.not. (x <= 1.08d-91))) then
tmp = x * (1.0d0 - (z / t))
else
tmp = 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 <= -2.65e-102) || !(x <= 1.08e-91)) {
tmp = x * (1.0 - (z / t));
} else {
tmp = y * (z / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -2.65e-102) or not (x <= 1.08e-91): tmp = x * (1.0 - (z / t)) else: tmp = y * (z / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -2.65e-102) || !(x <= 1.08e-91)) tmp = Float64(x * Float64(1.0 - Float64(z / t))); else tmp = Float64(y * Float64(z / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -2.65e-102) || ~((x <= 1.08e-91))) tmp = x * (1.0 - (z / t)); else tmp = y * (z / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -2.65e-102], N[Not[LessEqual[x, 1.08e-91]], $MachinePrecision]], N[(x * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.65 \cdot 10^{-102} \lor \neg \left(x \leq 1.08 \cdot 10^{-91}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{z}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if x < -2.6500000000000001e-102 or 1.07999999999999998e-91 < x Initial program 90.9%
associate-/l*99.4%
Simplified99.4%
Taylor expanded in x around inf 84.4%
mul-1-neg84.4%
unsub-neg84.4%
Simplified84.4%
if -2.6500000000000001e-102 < x < 1.07999999999999998e-91Initial program 93.8%
associate-/l*95.1%
Simplified95.1%
Taylor expanded in y around inf 85.9%
*-commutative85.9%
associate-/l*84.7%
Simplified84.7%
Taylor expanded in y around inf 86.0%
+-commutative86.0%
Simplified86.0%
Taylor expanded in z around inf 67.5%
Final simplification79.1%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.35e-33) (not (<= z 6.6e-90))) (* y (/ z t)) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.35e-33) || !(z <= 6.6e-90)) {
tmp = y * (z / 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 <= (-2.35d-33)) .or. (.not. (z <= 6.6d-90))) then
tmp = y * (z / 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 <= -2.35e-33) || !(z <= 6.6e-90)) {
tmp = y * (z / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.35e-33) or not (z <= 6.6e-90): tmp = y * (z / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.35e-33) || !(z <= 6.6e-90)) tmp = Float64(y * Float64(z / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -2.35e-33) || ~((z <= 6.6e-90))) tmp = y * (z / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.35e-33], N[Not[LessEqual[z, 6.6e-90]], $MachinePrecision]], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.35 \cdot 10^{-33} \lor \neg \left(z \leq 6.6 \cdot 10^{-90}\right):\\
\;\;\;\;y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.3500000000000001e-33 or 6.6e-90 < z Initial program 86.5%
associate-/l*97.8%
Simplified97.8%
Taylor expanded in y around inf 58.5%
*-commutative58.5%
associate-/l*63.8%
Simplified63.8%
Taylor expanded in y around inf 66.3%
+-commutative66.3%
Simplified66.3%
Taylor expanded in z around inf 51.6%
if -2.3500000000000001e-33 < z < 6.6e-90Initial program 98.2%
associate-/l*98.3%
Simplified98.3%
Taylor expanded in z around 0 72.2%
Final simplification60.9%
(FPCore (x y z t) :precision binary64 (if (<= z -185.0) (/ (* x (- z)) t) (if (<= z 5.5e-91) x (* y (/ z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -185.0) {
tmp = (x * -z) / t;
} else if (z <= 5.5e-91) {
tmp = x;
} else {
tmp = 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 <= (-185.0d0)) then
tmp = (x * -z) / t
else if (z <= 5.5d-91) then
tmp = x
else
tmp = 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 <= -185.0) {
tmp = (x * -z) / t;
} else if (z <= 5.5e-91) {
tmp = x;
} else {
tmp = y * (z / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -185.0: tmp = (x * -z) / t elif z <= 5.5e-91: tmp = x else: tmp = y * (z / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -185.0) tmp = Float64(Float64(x * Float64(-z)) / t); elseif (z <= 5.5e-91) tmp = x; else tmp = Float64(y * Float64(z / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -185.0) tmp = (x * -z) / t; elseif (z <= 5.5e-91) tmp = x; else tmp = y * (z / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -185.0], N[(N[(x * (-z)), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 5.5e-91], x, N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -185:\\
\;\;\;\;\frac{x \cdot \left(-z\right)}{t}\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-91}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if z < -185Initial program 87.2%
associate-/l*96.2%
Simplified96.2%
clear-num96.2%
un-div-inv96.1%
Applied egg-rr96.1%
Taylor expanded in t around 0 87.2%
Taylor expanded in z around -inf 77.2%
Taylor expanded in y around 0 50.0%
neg-mul-150.0%
*-commutative50.0%
distribute-rgt-neg-out50.0%
Simplified50.0%
if -185 < z < 5.49999999999999965e-91Initial program 98.3%
associate-/l*98.4%
Simplified98.4%
Taylor expanded in z around 0 69.9%
if 5.49999999999999965e-91 < z Initial program 84.9%
associate-/l*98.6%
Simplified98.6%
Taylor expanded in y around inf 60.6%
*-commutative60.6%
associate-/l*65.1%
Simplified65.1%
Taylor expanded in y around inf 69.1%
+-commutative69.1%
Simplified69.1%
Taylor expanded in z around inf 55.0%
Final simplification61.1%
(FPCore (x y z t) :precision binary64 (if (<= z -6.6e-37) (* z (/ y t)) (if (<= z 8.5e-89) x (* y (/ z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -6.6e-37) {
tmp = z * (y / t);
} else if (z <= 8.5e-89) {
tmp = x;
} else {
tmp = 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 <= (-6.6d-37)) then
tmp = z * (y / t)
else if (z <= 8.5d-89) then
tmp = x
else
tmp = 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 <= -6.6e-37) {
tmp = z * (y / t);
} else if (z <= 8.5e-89) {
tmp = x;
} else {
tmp = y * (z / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -6.6e-37: tmp = z * (y / t) elif z <= 8.5e-89: tmp = x else: tmp = y * (z / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -6.6e-37) tmp = Float64(z * Float64(y / t)); elseif (z <= 8.5e-89) tmp = x; else tmp = Float64(y * Float64(z / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -6.6e-37) tmp = z * (y / t); elseif (z <= 8.5e-89) tmp = x; else tmp = y * (z / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -6.6e-37], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.5e-89], x, N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.6 \cdot 10^{-37}:\\
\;\;\;\;z \cdot \frac{y}{t}\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{-89}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if z < -6.59999999999999964e-37Initial program 88.7%
associate-/l*96.7%
Simplified96.7%
clear-num96.6%
un-div-inv96.6%
Applied egg-rr96.6%
Taylor expanded in t around 0 88.7%
Taylor expanded in z around -inf 76.5%
Taylor expanded in y around inf 41.4%
associate-*l/47.7%
*-commutative47.7%
Simplified47.7%
if -6.59999999999999964e-37 < z < 8.49999999999999937e-89Initial program 98.2%
associate-/l*98.3%
Simplified98.3%
Taylor expanded in z around 0 72.2%
if 8.49999999999999937e-89 < z Initial program 84.9%
associate-/l*98.6%
Simplified98.6%
Taylor expanded in y around inf 60.6%
*-commutative60.6%
associate-/l*65.1%
Simplified65.1%
Taylor expanded in y around inf 69.1%
+-commutative69.1%
Simplified69.1%
Taylor expanded in z around inf 55.0%
(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 91.8%
associate-/l*98.0%
Simplified98.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 91.8%
associate-/l*98.0%
Simplified98.0%
Taylor expanded in z around 0 41.3%
(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 2024185
(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)))