
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{a - t}
\end{array}
(FPCore (x y z t a) :precision binary64 (- x (/ y (/ (- t a) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x - (y / ((t - a) / (z - t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x - (y / ((t - a) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - (y / ((t - a) / (z - t)));
}
def code(x, y, z, t, a): return x - (y / ((t - a) / (z - t)))
function code(x, y, z, t, a) return Float64(x - Float64(y / Float64(Float64(t - a) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x - (y / ((t - a) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x - N[(y / N[(N[(t - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{y}{\frac{t - a}{z - t}}
\end{array}
Initial program 83.7%
associate-/l*98.1%
Simplified98.1%
clear-num98.1%
un-div-inv98.2%
Applied egg-rr98.2%
Final simplification98.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -9e-20) (not (<= t 3.05e+103))) (+ x (* y (- 1.0 (/ z t)))) (+ x (/ y (/ (- a t) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -9e-20) || !(t <= 3.05e+103)) {
tmp = x + (y * (1.0 - (z / t)));
} else {
tmp = x + (y / ((a - t) / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-9d-20)) .or. (.not. (t <= 3.05d+103))) then
tmp = x + (y * (1.0d0 - (z / t)))
else
tmp = x + (y / ((a - t) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -9e-20) || !(t <= 3.05e+103)) {
tmp = x + (y * (1.0 - (z / t)));
} else {
tmp = x + (y / ((a - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -9e-20) or not (t <= 3.05e+103): tmp = x + (y * (1.0 - (z / t))) else: tmp = x + (y / ((a - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -9e-20) || !(t <= 3.05e+103)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(z / t)))); else tmp = Float64(x + Float64(y / Float64(Float64(a - t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -9e-20) || ~((t <= 3.05e+103))) tmp = x + (y * (1.0 - (z / t))); else tmp = x + (y / ((a - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -9e-20], N[Not[LessEqual[t, 3.05e+103]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9 \cdot 10^{-20} \lor \neg \left(t \leq 3.05 \cdot 10^{+103}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{z}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if t < -9.0000000000000003e-20 or 3.0500000000000001e103 < t Initial program 71.9%
+-commutative71.9%
*-commutative71.9%
associate-/l*94.4%
fma-define94.4%
Simplified94.4%
Taylor expanded in a around 0 61.7%
mul-1-neg61.7%
unsub-neg61.7%
associate-/l*85.1%
div-sub85.1%
sub-neg85.1%
*-inverses85.1%
metadata-eval85.1%
Simplified85.1%
if -9.0000000000000003e-20 < t < 3.0500000000000001e103Initial program 91.9%
associate-/l*96.9%
Simplified96.9%
clear-num96.9%
un-div-inv97.0%
Applied egg-rr97.0%
Taylor expanded in z around inf 87.7%
Final simplification86.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -9.2e+111) (not (<= t 3.5e+113))) (+ x y) (+ x (/ y (/ (- a t) z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -9.2e+111) || !(t <= 3.5e+113)) {
tmp = x + y;
} else {
tmp = x + (y / ((a - t) / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-9.2d+111)) .or. (.not. (t <= 3.5d+113))) then
tmp = x + y
else
tmp = x + (y / ((a - t) / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -9.2e+111) || !(t <= 3.5e+113)) {
tmp = x + y;
} else {
tmp = x + (y / ((a - t) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -9.2e+111) or not (t <= 3.5e+113): tmp = x + y else: tmp = x + (y / ((a - t) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -9.2e+111) || !(t <= 3.5e+113)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y / Float64(Float64(a - t) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -9.2e+111) || ~((t <= 3.5e+113))) tmp = x + y; else tmp = x + (y / ((a - t) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -9.2e+111], N[Not[LessEqual[t, 3.5e+113]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.2 \cdot 10^{+111} \lor \neg \left(t \leq 3.5 \cdot 10^{+113}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\end{array}
\end{array}
if t < -9.20000000000000008e111 or 3.5000000000000001e113 < t Initial program 62.8%
+-commutative62.8%
*-commutative62.8%
associate-/l*92.3%
fma-define92.3%
Simplified92.3%
Taylor expanded in t around inf 82.0%
+-commutative82.0%
Simplified82.0%
if -9.20000000000000008e111 < t < 3.5000000000000001e113Initial program 92.6%
associate-/l*97.4%
Simplified97.4%
clear-num97.3%
un-div-inv97.4%
Applied egg-rr97.4%
Taylor expanded in z around inf 85.7%
Final simplification84.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.9e+108) (not (<= t 3.3e+111))) (+ x y) (+ x (* y (/ z (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.9e+108) || !(t <= 3.3e+111)) {
tmp = x + y;
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-2.9d+108)) .or. (.not. (t <= 3.3d+111))) then
tmp = x + y
else
tmp = x + (y * (z / (a - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.9e+108) || !(t <= 3.3e+111)) {
tmp = x + y;
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.9e+108) or not (t <= 3.3e+111): tmp = x + y else: tmp = x + (y * (z / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.9e+108) || !(t <= 3.3e+111)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.9e+108) || ~((t <= 3.3e+111))) tmp = x + y; else tmp = x + (y * (z / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.9e+108], N[Not[LessEqual[t, 3.3e+111]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.9 \cdot 10^{+108} \lor \neg \left(t \leq 3.3 \cdot 10^{+111}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\end{array}
\end{array}
if t < -2.90000000000000007e108 or 3.3000000000000001e111 < t Initial program 62.8%
+-commutative62.8%
*-commutative62.8%
associate-/l*92.3%
fma-define92.3%
Simplified92.3%
Taylor expanded in t around inf 82.0%
+-commutative82.0%
Simplified82.0%
if -2.90000000000000007e108 < t < 3.3000000000000001e111Initial program 92.6%
associate-/l*97.4%
Simplified97.4%
Taylor expanded in z around inf 80.4%
associate-/l*85.7%
Simplified85.7%
Final simplification84.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -8e+20) (+ x (/ z (/ (- a t) y))) (if (<= z 1.7e-68) (+ x (* y (/ t (- t a)))) (+ x (* y (/ z (- a t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8e+20) {
tmp = x + (z / ((a - t) / y));
} else if (z <= 1.7e-68) {
tmp = x + (y * (t / (t - a)));
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-8d+20)) then
tmp = x + (z / ((a - t) / y))
else if (z <= 1.7d-68) then
tmp = x + (y * (t / (t - a)))
else
tmp = x + (y * (z / (a - t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -8e+20) {
tmp = x + (z / ((a - t) / y));
} else if (z <= 1.7e-68) {
tmp = x + (y * (t / (t - a)));
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -8e+20: tmp = x + (z / ((a - t) / y)) elif z <= 1.7e-68: tmp = x + (y * (t / (t - a))) else: tmp = x + (y * (z / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -8e+20) tmp = Float64(x + Float64(z / Float64(Float64(a - t) / y))); elseif (z <= 1.7e-68) tmp = Float64(x + Float64(y * Float64(t / Float64(t - a)))); else tmp = Float64(x + Float64(y * Float64(z / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -8e+20) tmp = x + (z / ((a - t) / y)); elseif (z <= 1.7e-68) tmp = x + (y * (t / (t - a))); else tmp = x + (y * (z / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8e+20], N[(x + N[(z / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.7e-68], N[(x + N[(y * N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{+20}:\\
\;\;\;\;x + \frac{z}{\frac{a - t}{y}}\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-68}:\\
\;\;\;\;x + y \cdot \frac{t}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\end{array}
\end{array}
if z < -8e20Initial program 78.4%
+-commutative78.4%
*-commutative78.4%
associate-/l*94.4%
fma-define94.4%
Simplified94.4%
fma-undefine94.4%
clear-num92.6%
un-div-inv92.7%
Applied egg-rr92.7%
Taylor expanded in z around inf 83.3%
if -8e20 < z < 1.70000000000000009e-68Initial program 87.7%
+-commutative87.7%
*-commutative87.7%
associate-/l*93.8%
fma-define93.8%
Simplified93.8%
Taylor expanded in z around 0 81.1%
mul-1-neg81.1%
unsub-neg81.1%
*-commutative81.1%
*-lft-identity81.1%
times-frac90.4%
/-rgt-identity90.4%
Simplified90.4%
if 1.70000000000000009e-68 < z Initial program 81.2%
associate-/l*98.7%
Simplified98.7%
Taylor expanded in z around inf 78.2%
associate-/l*89.9%
Simplified89.9%
Final simplification88.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -7.4e-22) (not (<= t 8.6e+64))) (+ x y) (+ x (/ y (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -7.4e-22) || !(t <= 8.6e+64)) {
tmp = x + y;
} else {
tmp = x + (y / (a / z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-7.4d-22)) .or. (.not. (t <= 8.6d+64))) then
tmp = x + y
else
tmp = x + (y / (a / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -7.4e-22) || !(t <= 8.6e+64)) {
tmp = x + y;
} else {
tmp = x + (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -7.4e-22) or not (t <= 8.6e+64): tmp = x + y else: tmp = x + (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -7.4e-22) || !(t <= 8.6e+64)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y / Float64(a / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -7.4e-22) || ~((t <= 8.6e+64))) tmp = x + y; else tmp = x + (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -7.4e-22], N[Not[LessEqual[t, 8.6e+64]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y / N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.4 \cdot 10^{-22} \lor \neg \left(t \leq 8.6 \cdot 10^{+64}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -7.4e-22 or 8.5999999999999995e64 < t Initial program 73.6%
+-commutative73.6%
*-commutative73.6%
associate-/l*94.0%
fma-define94.0%
Simplified94.0%
Taylor expanded in t around inf 75.8%
+-commutative75.8%
Simplified75.8%
if -7.4e-22 < t < 8.5999999999999995e64Initial program 91.9%
associate-/l*96.7%
Simplified96.7%
clear-num96.7%
un-div-inv96.7%
Applied egg-rr96.7%
Taylor expanded in t around 0 78.8%
Final simplification77.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -1.1e+152) (not (<= y 4.5e+239))) (* y (- 1.0 (/ z t))) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.1e+152) || !(y <= 4.5e+239)) {
tmp = y * (1.0 - (z / t));
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((y <= (-1.1d+152)) .or. (.not. (y <= 4.5d+239))) then
tmp = y * (1.0d0 - (z / t))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -1.1e+152) || !(y <= 4.5e+239)) {
tmp = y * (1.0 - (z / t));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -1.1e+152) or not (y <= 4.5e+239): tmp = y * (1.0 - (z / t)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -1.1e+152) || !(y <= 4.5e+239)) tmp = Float64(y * Float64(1.0 - Float64(z / t))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -1.1e+152) || ~((y <= 4.5e+239))) tmp = y * (1.0 - (z / t)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -1.1e+152], N[Not[LessEqual[y, 4.5e+239]], $MachinePrecision]], N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{+152} \lor \neg \left(y \leq 4.5 \cdot 10^{+239}\right):\\
\;\;\;\;y \cdot \left(1 - \frac{z}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if y < -1.0999999999999999e152 or 4.4999999999999998e239 < y Initial program 68.9%
associate-/l*98.1%
Simplified98.1%
clear-num98.0%
un-div-inv98.1%
Applied egg-rr98.1%
Taylor expanded in a around 0 37.9%
mul-1-neg37.9%
unsub-neg37.9%
associate-/l*61.0%
div-sub61.0%
*-inverses61.0%
Simplified61.0%
Taylor expanded in x around 0 57.7%
sub-neg57.7%
metadata-eval57.7%
neg-mul-157.7%
distribute-rgt-neg-in57.7%
+-commutative57.7%
distribute-neg-in57.7%
metadata-eval57.7%
sub-neg57.7%
Simplified57.7%
if -1.0999999999999999e152 < y < 4.4999999999999998e239Initial program 88.0%
+-commutative88.0%
*-commutative88.0%
associate-/l*94.5%
fma-define94.5%
Simplified94.5%
Taylor expanded in t around inf 66.4%
+-commutative66.4%
Simplified66.4%
Final simplification64.5%
(FPCore (x y z t a) :precision binary64 (if (<= y -5.1e+241) (/ t (/ (- a) y)) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -5.1e+241) {
tmp = t / (-a / y);
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= (-5.1d+241)) then
tmp = t / (-a / y)
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -5.1e+241) {
tmp = t / (-a / y);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -5.1e+241: tmp = t / (-a / y) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -5.1e+241) tmp = Float64(t / Float64(Float64(-a) / y)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -5.1e+241) tmp = t / (-a / y); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -5.1e+241], N[(t / N[((-a) / y), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.1 \cdot 10^{+241}:\\
\;\;\;\;\frac{t}{\frac{-a}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if y < -5.1000000000000002e241Initial program 76.2%
associate-/l*94.6%
Simplified94.6%
Taylor expanded in a around inf 63.7%
Taylor expanded in z around 0 44.5%
mul-1-neg44.5%
unsub-neg44.5%
associate-/l*53.0%
Simplified53.0%
Taylor expanded in x around 0 38.0%
neg-mul-138.0%
associate-/l*41.6%
distribute-lft-neg-out41.6%
*-commutative41.6%
Simplified41.6%
*-commutative41.6%
distribute-lft-neg-in41.6%
clear-num41.6%
un-div-inv42.6%
Applied egg-rr42.6%
if -5.1000000000000002e241 < y Initial program 84.4%
+-commutative84.4%
*-commutative84.4%
associate-/l*94.9%
fma-define94.9%
Simplified94.9%
Taylor expanded in t around inf 62.3%
+-commutative62.3%
Simplified62.3%
Final simplification60.8%
(FPCore (x y z t a) :precision binary64 (- x (* y (/ (- z t) (- t a)))))
double code(double x, double y, double z, double t, double a) {
return x - (y * ((z - t) / (t - a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x - (y * ((z - t) / (t - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x - (y * ((z - t) / (t - a)));
}
def code(x, y, z, t, a): return x - (y * ((z - t) / (t - a)))
function code(x, y, z, t, a) return Float64(x - Float64(y * Float64(Float64(z - t) / Float64(t - a)))) end
function tmp = code(x, y, z, t, a) tmp = x - (y * ((z - t) / (t - a))); end
code[x_, y_, z_, t_, a_] := N[(x - N[(y * N[(N[(z - t), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - y \cdot \frac{z - t}{t - a}
\end{array}
Initial program 83.7%
associate-/l*98.1%
Simplified98.1%
Final simplification98.1%
(FPCore (x y z t a) :precision binary64 (+ x y))
double code(double x, double y, double z, double t, double a) {
return x + y;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + y
end function
public static double code(double x, double y, double z, double t, double a) {
return x + y;
}
def code(x, y, z, t, a): return x + y
function code(x, y, z, t, a) return Float64(x + y) end
function tmp = code(x, y, z, t, a) tmp = x + y; end
code[x_, y_, z_, t_, a_] := N[(x + y), $MachinePrecision]
\begin{array}{l}
\\
x + y
\end{array}
Initial program 83.7%
+-commutative83.7%
*-commutative83.7%
associate-/l*93.9%
fma-define93.9%
Simplified93.9%
Taylor expanded in t around inf 58.7%
+-commutative58.7%
Simplified58.7%
Final simplification58.7%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 83.7%
+-commutative83.7%
*-commutative83.7%
associate-/l*93.9%
fma-define93.9%
Simplified93.9%
Taylor expanded in y around 0 51.2%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- a t) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (z - t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y / ((a - t) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((a - t) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((a - t) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(a - t) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((a - t) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{a - t}{z - t}}
\end{array}
herbie shell --seed 2024186
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
:precision binary64
:alt
(! :herbie-platform default (+ x (/ y (/ (- a t) (- z t)))))
(+ x (/ (* y (- z t)) (- a t))))