
(FPCore (x y z t) :precision binary64 (* (/ (- x y) (- z y)) t))
double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * 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 - y)) * t
end function
public static double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * t;
}
def code(x, y, z, t): return ((x - y) / (z - y)) * t
function code(x, y, z, t) return Float64(Float64(Float64(x - y) / Float64(z - y)) * t) end
function tmp = code(x, y, z, t) tmp = ((x - y) / (z - y)) * t; end
code[x_, y_, z_, t_] := N[(N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{z - y} \cdot t
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (* (/ (- x y) (- z y)) t))
double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * 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 - y)) * t
end function
public static double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * t;
}
def code(x, y, z, t): return ((x - y) / (z - y)) * t
function code(x, y, z, t) return Float64(Float64(Float64(x - y) / Float64(z - y)) * t) end
function tmp = code(x, y, z, t) tmp = ((x - y) / (z - y)) * t; end
code[x_, y_, z_, t_] := N[(N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{z - y} \cdot t
\end{array}
(FPCore (x y z t) :precision binary64 (* (/ (- x y) (- z y)) t))
double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * 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 - y)) * t
end function
public static double code(double x, double y, double z, double t) {
return ((x - y) / (z - y)) * t;
}
def code(x, y, z, t): return ((x - y) / (z - y)) * t
function code(x, y, z, t) return Float64(Float64(Float64(x - y) / Float64(z - y)) * t) end
function tmp = code(x, y, z, t) tmp = ((x - y) / (z - y)) * t; end
code[x_, y_, z_, t_] := N[(N[(N[(x - y), $MachinePrecision] / N[(z - y), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y}{z - y} \cdot t
\end{array}
Initial program 97.3%
(FPCore (x y z t) :precision binary64 (if (<= y -3.75e+102) (* t (/ (- y x) y)) (if (<= y 2.6e+143) (* (- x y) (/ t (- z y))) (* t (/ y (- y z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.75e+102) {
tmp = t * ((y - x) / y);
} else if (y <= 2.6e+143) {
tmp = (x - y) * (t / (z - y));
} else {
tmp = t * (y / (y - 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 <= (-3.75d+102)) then
tmp = t * ((y - x) / y)
else if (y <= 2.6d+143) then
tmp = (x - y) * (t / (z - y))
else
tmp = t * (y / (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.75e+102) {
tmp = t * ((y - x) / y);
} else if (y <= 2.6e+143) {
tmp = (x - y) * (t / (z - y));
} else {
tmp = t * (y / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.75e+102: tmp = t * ((y - x) / y) elif y <= 2.6e+143: tmp = (x - y) * (t / (z - y)) else: tmp = t * (y / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.75e+102) tmp = Float64(t * Float64(Float64(y - x) / y)); elseif (y <= 2.6e+143) tmp = Float64(Float64(x - y) * Float64(t / Float64(z - y))); else tmp = Float64(t * Float64(y / Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -3.75e+102) tmp = t * ((y - x) / y); elseif (y <= 2.6e+143) tmp = (x - y) * (t / (z - y)); else tmp = t * (y / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.75e+102], N[(t * N[(N[(y - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.6e+143], N[(N[(x - y), $MachinePrecision] * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.75 \cdot 10^{+102}:\\
\;\;\;\;t \cdot \frac{y - x}{y}\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{+143}:\\
\;\;\;\;\left(x - y\right) \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\end{array}
\end{array}
if y < -3.75e102Initial program 99.9%
Taylor expanded in z around 0 84.3%
associate-*r/84.3%
neg-mul-184.3%
neg-sub084.3%
sub-neg84.3%
+-commutative84.3%
associate--r+84.3%
neg-sub084.3%
remove-double-neg84.3%
Simplified84.3%
if -3.75e102 < y < 2.5999999999999999e143Initial program 96.3%
associate-*l/90.0%
associate-/l*92.3%
Simplified92.3%
if 2.5999999999999999e143 < y Initial program 99.9%
Taylor expanded in x around 0 86.7%
neg-mul-186.7%
distribute-neg-frac286.7%
neg-sub086.7%
sub-neg86.7%
+-commutative86.7%
associate--r+86.7%
neg-sub086.7%
remove-double-neg86.7%
Simplified86.7%
Final simplification90.4%
(FPCore (x y z t) :precision binary64 (if (or (<= z -5.8e+64) (not (<= z 1.28e+36))) (/ t (/ z (- x y))) (* t (/ (- y x) y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -5.8e+64) || !(z <= 1.28e+36)) {
tmp = t / (z / (x - y));
} else {
tmp = t * ((y - 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 ((z <= (-5.8d+64)) .or. (.not. (z <= 1.28d+36))) then
tmp = t / (z / (x - y))
else
tmp = t * ((y - x) / 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+64) || !(z <= 1.28e+36)) {
tmp = t / (z / (x - y));
} else {
tmp = t * ((y - x) / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -5.8e+64) or not (z <= 1.28e+36): tmp = t / (z / (x - y)) else: tmp = t * ((y - x) / y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -5.8e+64) || !(z <= 1.28e+36)) tmp = Float64(t / Float64(z / Float64(x - y))); else tmp = Float64(t * Float64(Float64(y - x) / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -5.8e+64) || ~((z <= 1.28e+36))) tmp = t / (z / (x - y)); else tmp = t * ((y - x) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -5.8e+64], N[Not[LessEqual[z, 1.28e+36]], $MachinePrecision]], N[(t / N[(z / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(y - x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{+64} \lor \neg \left(z \leq 1.28 \cdot 10^{+36}\right):\\
\;\;\;\;\frac{t}{\frac{z}{x - y}}\\
\mathbf{else}:\\
\;\;\;\;t \cdot \frac{y - x}{y}\\
\end{array}
\end{array}
if z < -5.79999999999999986e64 or 1.27999999999999993e36 < z Initial program 97.4%
associate-*l/81.3%
associate-/l*81.9%
Simplified81.9%
associate-*r/81.3%
associate-*l/97.4%
*-commutative97.4%
clear-num96.2%
un-div-inv96.2%
Applied egg-rr96.2%
Taylor expanded in z around inf 82.8%
if -5.79999999999999986e64 < z < 1.27999999999999993e36Initial program 97.2%
Taylor expanded in z around 0 76.6%
associate-*r/76.6%
neg-mul-176.6%
neg-sub076.6%
sub-neg76.6%
+-commutative76.6%
associate--r+76.6%
neg-sub076.6%
remove-double-neg76.6%
Simplified76.6%
Final simplification79.3%
(FPCore (x y z t) :precision binary64 (if (or (<= y -5.8e+19) (not (<= y 8.2e-30))) (* t (/ y (- y z))) (* x (/ t (- z y)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -5.8e+19) || !(y <= 8.2e-30)) {
tmp = t * (y / (y - z));
} else {
tmp = x * (t / (z - 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 <= (-5.8d+19)) .or. (.not. (y <= 8.2d-30))) then
tmp = t * (y / (y - z))
else
tmp = x * (t / (z - y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -5.8e+19) || !(y <= 8.2e-30)) {
tmp = t * (y / (y - z));
} else {
tmp = x * (t / (z - y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -5.8e+19) or not (y <= 8.2e-30): tmp = t * (y / (y - z)) else: tmp = x * (t / (z - y)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -5.8e+19) || !(y <= 8.2e-30)) tmp = Float64(t * Float64(y / Float64(y - z))); else tmp = Float64(x * Float64(t / Float64(z - y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -5.8e+19) || ~((y <= 8.2e-30))) tmp = t * (y / (y - z)); else tmp = x * (t / (z - y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -5.8e+19], N[Not[LessEqual[y, 8.2e-30]], $MachinePrecision]], N[(t * N[(y / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.8 \cdot 10^{+19} \lor \neg \left(y \leq 8.2 \cdot 10^{-30}\right):\\
\;\;\;\;t \cdot \frac{y}{y - z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\end{array}
\end{array}
if y < -5.8e19 or 8.2000000000000007e-30 < y Initial program 99.8%
Taylor expanded in x around 0 75.6%
neg-mul-175.6%
distribute-neg-frac275.6%
neg-sub075.6%
sub-neg75.6%
+-commutative75.6%
associate--r+75.6%
neg-sub075.6%
remove-double-neg75.6%
Simplified75.6%
if -5.8e19 < y < 8.2000000000000007e-30Initial program 94.8%
associate-*l/90.1%
associate-/l*93.9%
Simplified93.9%
Taylor expanded in x around inf 79.4%
Final simplification77.5%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1150000000.0) (not (<= x 1.45e-46))) (* x (/ t (- z y))) (* y (/ t (- y z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1150000000.0) || !(x <= 1.45e-46)) {
tmp = x * (t / (z - y));
} else {
tmp = y * (t / (y - 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 <= (-1150000000.0d0)) .or. (.not. (x <= 1.45d-46))) then
tmp = x * (t / (z - y))
else
tmp = y * (t / (y - z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1150000000.0) || !(x <= 1.45e-46)) {
tmp = x * (t / (z - y));
} else {
tmp = y * (t / (y - z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1150000000.0) or not (x <= 1.45e-46): tmp = x * (t / (z - y)) else: tmp = y * (t / (y - z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1150000000.0) || !(x <= 1.45e-46)) tmp = Float64(x * Float64(t / Float64(z - y))); else tmp = Float64(y * Float64(t / Float64(y - z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1150000000.0) || ~((x <= 1.45e-46))) tmp = x * (t / (z - y)); else tmp = y * (t / (y - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1150000000.0], N[Not[LessEqual[x, 1.45e-46]], $MachinePrecision]], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(t / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1150000000 \lor \neg \left(x \leq 1.45 \cdot 10^{-46}\right):\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{t}{y - z}\\
\end{array}
\end{array}
if x < -1.15e9 or 1.45000000000000002e-46 < x Initial program 97.0%
associate-*l/85.8%
associate-/l*81.1%
Simplified81.1%
Taylor expanded in x around inf 70.1%
if -1.15e9 < x < 1.45000000000000002e-46Initial program 97.7%
associate-*l/84.9%
associate-/l*83.6%
Simplified83.6%
Taylor expanded in x around 0 72.7%
associate-*r/72.7%
mul-1-neg72.7%
distribute-rgt-neg-out72.7%
associate-*l/73.0%
*-commutative73.0%
distribute-lft-neg-out73.0%
distribute-rgt-neg-in73.0%
distribute-frac-neg273.0%
neg-sub073.0%
sub-neg73.0%
+-commutative73.0%
associate--r+73.0%
neg-sub073.0%
remove-double-neg73.0%
Simplified73.0%
Final simplification71.4%
(FPCore (x y z t) :precision binary64 (if (<= y -1e+139) t (if (<= y 1.8e+79) (* x (/ t (- z y))) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1e+139) {
tmp = t;
} else if (y <= 1.8e+79) {
tmp = x * (t / (z - y));
} else {
tmp = 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 <= (-1d+139)) then
tmp = t
else if (y <= 1.8d+79) then
tmp = x * (t / (z - y))
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1e+139) {
tmp = t;
} else if (y <= 1.8e+79) {
tmp = x * (t / (z - y));
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1e+139: tmp = t elif y <= 1.8e+79: tmp = x * (t / (z - y)) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1e+139) tmp = t; elseif (y <= 1.8e+79) tmp = Float64(x * Float64(t / Float64(z - y))); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1e+139) tmp = t; elseif (y <= 1.8e+79) tmp = x * (t / (z - y)); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1e+139], t, If[LessEqual[y, 1.8e+79], N[(x * N[(t / N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{+139}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{+79}:\\
\;\;\;\;x \cdot \frac{t}{z - y}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.00000000000000003e139 or 1.8e79 < y Initial program 99.9%
associate-*l/75.4%
associate-/l*61.6%
Simplified61.6%
Taylor expanded in y around inf 68.6%
if -1.00000000000000003e139 < y < 1.8e79Initial program 96.2%
associate-*l/89.7%
associate-/l*91.1%
Simplified91.1%
Taylor expanded in x around inf 69.0%
(FPCore (x y z t) :precision binary64 (if (<= y -1.35e+18) t (if (<= y 1.7e+82) (* t (/ x z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.35e+18) {
tmp = t;
} else if (y <= 1.7e+82) {
tmp = t * (x / z);
} else {
tmp = 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 <= (-1.35d+18)) then
tmp = t
else if (y <= 1.7d+82) then
tmp = t * (x / z)
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.35e+18) {
tmp = t;
} else if (y <= 1.7e+82) {
tmp = t * (x / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -1.35e+18: tmp = t elif y <= 1.7e+82: tmp = t * (x / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -1.35e+18) tmp = t; elseif (y <= 1.7e+82) tmp = Float64(t * Float64(x / z)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -1.35e+18) tmp = t; elseif (y <= 1.7e+82) tmp = t * (x / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.35e+18], t, If[LessEqual[y, 1.7e+82], N[(t * N[(x / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.35 \cdot 10^{+18}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{+82}:\\
\;\;\;\;t \cdot \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -1.35e18 or 1.69999999999999997e82 < y Initial program 99.9%
associate-*l/80.3%
associate-/l*67.0%
Simplified67.0%
Taylor expanded in y around inf 60.9%
if -1.35e18 < y < 1.69999999999999997e82Initial program 95.5%
Taylor expanded in y around 0 61.1%
Final simplification61.0%
(FPCore (x y z t) :precision binary64 (if (<= y -5.1e+17) t (if (<= y 1.45e+78) (* x (/ t z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.1e+17) {
tmp = t;
} else if (y <= 1.45e+78) {
tmp = x * (t / z);
} else {
tmp = 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 <= (-5.1d+17)) then
tmp = t
else if (y <= 1.45d+78) then
tmp = x * (t / z)
else
tmp = t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.1e+17) {
tmp = t;
} else if (y <= 1.45e+78) {
tmp = x * (t / z);
} else {
tmp = t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -5.1e+17: tmp = t elif y <= 1.45e+78: tmp = x * (t / z) else: tmp = t return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -5.1e+17) tmp = t; elseif (y <= 1.45e+78) tmp = Float64(x * Float64(t / z)); else tmp = t; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -5.1e+17) tmp = t; elseif (y <= 1.45e+78) tmp = x * (t / z); else tmp = t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -5.1e+17], t, If[LessEqual[y, 1.45e+78], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.1 \cdot 10^{+17}:\\
\;\;\;\;t\\
\mathbf{elif}\;y \leq 1.45 \cdot 10^{+78}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{else}:\\
\;\;\;\;t\\
\end{array}
\end{array}
if y < -5.1e17 or 1.45000000000000008e78 < y Initial program 99.9%
associate-*l/80.3%
associate-/l*67.0%
Simplified67.0%
Taylor expanded in y around inf 60.9%
if -5.1e17 < y < 1.45000000000000008e78Initial program 95.5%
associate-*l/89.0%
associate-/l*93.0%
Simplified93.0%
Taylor expanded in x around inf 74.4%
Taylor expanded in z around inf 59.8%
(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 97.3%
associate-*l/85.4%
associate-/l*82.2%
Simplified82.2%
Taylor expanded in y around inf 34.2%
(FPCore (x y z t) :precision binary64 (/ t (/ (- z y) (- x y))))
double code(double x, double y, double z, double t) {
return t / ((z - y) / (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 - y) / (x - y))
end function
public static double code(double x, double y, double z, double t) {
return t / ((z - y) / (x - y));
}
def code(x, y, z, t): return t / ((z - y) / (x - y))
function code(x, y, z, t) return Float64(t / Float64(Float64(z - y) / Float64(x - y))) end
function tmp = code(x, y, z, t) tmp = t / ((z - y) / (x - y)); end
code[x_, y_, z_, t_] := N[(t / N[(N[(z - y), $MachinePrecision] / N[(x - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{t}{\frac{z - y}{x - y}}
\end{array}
herbie shell --seed 2024137
(FPCore (x y z t)
:name "Numeric.Signal.Multichannel:$cput from hsignal-0.2.7.1"
:precision binary64
:alt
(! :herbie-platform default (/ t (/ (- z y) (- x y))))
(* (/ (- x y) (- z y)) t))