
(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(y * Float64(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[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 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(y * Float64(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[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
(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}
Initial program 97.7%
clear-num97.7%
un-div-inv98.1%
Applied egg-rr98.1%
(FPCore (x y z t a)
:precision binary64
(if (<= t -3.2e+89)
(+ x y)
(if (<= t -6.2e-137)
(- x (/ (* y z) t))
(if (<= t 9.2e+97) (+ x (* z (/ y a))) (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -3.2e+89) {
tmp = x + y;
} else if (t <= -6.2e-137) {
tmp = x - ((y * z) / t);
} else if (t <= 9.2e+97) {
tmp = x + (z * (y / a));
} 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 (t <= (-3.2d+89)) then
tmp = x + y
else if (t <= (-6.2d-137)) then
tmp = x - ((y * z) / t)
else if (t <= 9.2d+97) then
tmp = x + (z * (y / a))
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 (t <= -3.2e+89) {
tmp = x + y;
} else if (t <= -6.2e-137) {
tmp = x - ((y * z) / t);
} else if (t <= 9.2e+97) {
tmp = x + (z * (y / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -3.2e+89: tmp = x + y elif t <= -6.2e-137: tmp = x - ((y * z) / t) elif t <= 9.2e+97: tmp = x + (z * (y / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -3.2e+89) tmp = Float64(x + y); elseif (t <= -6.2e-137) tmp = Float64(x - Float64(Float64(y * z) / t)); elseif (t <= 9.2e+97) tmp = Float64(x + Float64(z * Float64(y / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -3.2e+89) tmp = x + y; elseif (t <= -6.2e-137) tmp = x - ((y * z) / t); elseif (t <= 9.2e+97) tmp = x + (z * (y / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -3.2e+89], N[(x + y), $MachinePrecision], If[LessEqual[t, -6.2e-137], N[(x - N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.2e+97], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.2 \cdot 10^{+89}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -6.2 \cdot 10^{-137}:\\
\;\;\;\;x - \frac{y \cdot z}{t}\\
\mathbf{elif}\;t \leq 9.2 \cdot 10^{+97}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if t < -3.19999999999999987e89 or 9.20000000000000022e97 < t Initial program 100.0%
Taylor expanded in t around inf 85.9%
+-commutative85.9%
Simplified85.9%
if -3.19999999999999987e89 < t < -6.19999999999999955e-137Initial program 99.9%
Taylor expanded in a around 0 73.7%
mul-1-neg73.7%
unsub-neg73.7%
associate-/l*76.3%
div-sub76.4%
sub-neg76.4%
*-inverses76.4%
metadata-eval76.4%
Simplified76.4%
Taylor expanded in z around inf 68.8%
if -6.19999999999999955e-137 < t < 9.20000000000000022e97Initial program 94.8%
Taylor expanded in t around 0 77.6%
+-commutative77.6%
associate-/l*78.4%
Simplified78.4%
clear-num78.4%
un-div-inv78.4%
Applied egg-rr78.4%
associate-/r/80.9%
Applied egg-rr80.9%
Final simplification80.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.8e+92) (not (<= z 4.4e+32))) (+ x (* z (/ y (- a t)))) (+ x (* y (/ t (- t a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.8e+92) || !(z <= 4.4e+32)) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x + (y * (t / (t - a)));
}
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 <= (-3.8d+92)) .or. (.not. (z <= 4.4d+32))) then
tmp = x + (z * (y / (a - t)))
else
tmp = x + (y * (t / (t - a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.8e+92) || !(z <= 4.4e+32)) {
tmp = x + (z * (y / (a - t)));
} else {
tmp = x + (y * (t / (t - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.8e+92) or not (z <= 4.4e+32): tmp = x + (z * (y / (a - t))) else: tmp = x + (y * (t / (t - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.8e+92) || !(z <= 4.4e+32)) tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); else tmp = Float64(x + Float64(y * Float64(t / Float64(t - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.8e+92) || ~((z <= 4.4e+32))) tmp = x + (z * (y / (a - t))); else tmp = x + (y * (t / (t - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.8e+92], N[Not[LessEqual[z, 4.4e+32]], $MachinePrecision]], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+92} \lor \neg \left(z \leq 4.4 \cdot 10^{+32}\right):\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{t - a}\\
\end{array}
\end{array}
if z < -3.8e92 or 4.40000000000000002e32 < z Initial program 95.3%
clear-num95.3%
un-div-inv95.3%
Applied egg-rr95.3%
associate-/r/98.2%
Applied egg-rr98.2%
Taylor expanded in z around inf 92.4%
if -3.8e92 < z < 4.40000000000000002e32Initial program 99.3%
Taylor expanded in z around 0 76.8%
+-commutative76.8%
associate-*r/76.8%
mul-1-neg76.8%
distribute-lft-neg-out76.8%
*-commutative76.8%
*-lft-identity76.8%
times-frac91.6%
/-rgt-identity91.6%
distribute-neg-frac91.6%
distribute-neg-frac291.6%
neg-sub091.6%
sub-neg91.6%
+-commutative91.6%
associate--r+91.6%
neg-sub091.6%
remove-double-neg91.6%
Simplified91.6%
Final simplification91.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -5.5e+89) (not (<= t 2.9e+100))) (+ x y) (+ x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5.5e+89) || !(t <= 2.9e+100)) {
tmp = x + y;
} else {
tmp = x + (z * (y / (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 <= (-5.5d+89)) .or. (.not. (t <= 2.9d+100))) then
tmp = x + y
else
tmp = x + (z * (y / (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 <= -5.5e+89) || !(t <= 2.9e+100)) {
tmp = x + y;
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -5.5e+89) or not (t <= 2.9e+100): tmp = x + y else: tmp = x + (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -5.5e+89) || !(t <= 2.9e+100)) tmp = Float64(x + y); else tmp = Float64(x + Float64(z * Float64(y / Float64(a - t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -5.5e+89) || ~((t <= 2.9e+100))) tmp = x + y; else tmp = x + (z * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -5.5e+89], N[Not[LessEqual[t, 2.9e+100]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.5 \cdot 10^{+89} \lor \neg \left(t \leq 2.9 \cdot 10^{+100}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -5.49999999999999976e89 or 2.9e100 < t Initial program 100.0%
Taylor expanded in t around inf 85.9%
+-commutative85.9%
Simplified85.9%
if -5.49999999999999976e89 < t < 2.9e100Initial program 96.5%
clear-num96.5%
un-div-inv97.0%
Applied egg-rr97.0%
associate-/r/98.1%
Applied egg-rr98.1%
Taylor expanded in z around inf 87.7%
Final simplification87.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.6e+89) (not (<= t 1.8e+99))) (+ x y) (+ x (* y (/ z (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.6e+89) || !(t <= 1.8e+99)) {
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 <= (-3.6d+89)) .or. (.not. (t <= 1.8d+99))) 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 <= -3.6e+89) || !(t <= 1.8e+99)) {
tmp = x + y;
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.6e+89) or not (t <= 1.8e+99): tmp = x + y else: tmp = x + (y * (z / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.6e+89) || !(t <= 1.8e+99)) 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 <= -3.6e+89) || ~((t <= 1.8e+99))) 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, -3.6e+89], N[Not[LessEqual[t, 1.8e+99]], $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 -3.6 \cdot 10^{+89} \lor \neg \left(t \leq 1.8 \cdot 10^{+99}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\end{array}
\end{array}
if t < -3.6e89 or 1.8000000000000001e99 < t Initial program 100.0%
Taylor expanded in t around inf 85.9%
+-commutative85.9%
Simplified85.9%
if -3.6e89 < t < 1.8000000000000001e99Initial program 96.5%
Taylor expanded in z around inf 83.2%
associate-/l*85.0%
Simplified85.0%
Final simplification85.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.8e+89) (not (<= t 9.2e+97))) (+ x y) (+ x (* z (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.8e+89) || !(t <= 9.2e+97)) {
tmp = x + y;
} else {
tmp = x + (z * (y / a));
}
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 <= (-3.8d+89)) .or. (.not. (t <= 9.2d+97))) then
tmp = x + y
else
tmp = x + (z * (y / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.8e+89) || !(t <= 9.2e+97)) {
tmp = x + y;
} else {
tmp = x + (z * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.8e+89) or not (t <= 9.2e+97): tmp = x + y else: tmp = x + (z * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.8e+89) || !(t <= 9.2e+97)) tmp = Float64(x + y); else tmp = Float64(x + Float64(z * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -3.8e+89) || ~((t <= 9.2e+97))) tmp = x + y; else tmp = x + (z * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.8e+89], N[Not[LessEqual[t, 9.2e+97]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(z * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.8 \cdot 10^{+89} \lor \neg \left(t \leq 9.2 \cdot 10^{+97}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a}\\
\end{array}
\end{array}
if t < -3.80000000000000023e89 or 9.20000000000000022e97 < t Initial program 100.0%
Taylor expanded in t around inf 85.9%
+-commutative85.9%
Simplified85.9%
if -3.80000000000000023e89 < t < 9.20000000000000022e97Initial program 96.5%
Taylor expanded in t around 0 72.1%
+-commutative72.1%
associate-/l*73.4%
Simplified73.4%
clear-num73.3%
un-div-inv73.3%
Applied egg-rr73.3%
associate-/r/74.4%
Applied egg-rr74.4%
Final simplification78.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.2e+89) (not (<= t 9.2e+97))) (+ x y) (+ x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.2e+89) || !(t <= 9.2e+97)) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
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 <= (-3.2d+89)) .or. (.not. (t <= 9.2d+97))) then
tmp = x + y
else
tmp = x + (y * (z / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.2e+89) || !(t <= 9.2e+97)) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.2e+89) or not (t <= 9.2e+97): tmp = x + y else: tmp = x + (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.2e+89) || !(t <= 9.2e+97)) tmp = Float64(x + y); else tmp = Float64(x + Float64(y * Float64(z / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -3.2e+89) || ~((t <= 9.2e+97))) tmp = x + y; else tmp = x + (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.2e+89], N[Not[LessEqual[t, 9.2e+97]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.2 \cdot 10^{+89} \lor \neg \left(t \leq 9.2 \cdot 10^{+97}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -3.19999999999999987e89 or 9.20000000000000022e97 < t Initial program 100.0%
Taylor expanded in t around inf 85.9%
+-commutative85.9%
Simplified85.9%
if -3.19999999999999987e89 < t < 9.20000000000000022e97Initial program 96.5%
Taylor expanded in t around 0 72.1%
+-commutative72.1%
associate-/l*73.4%
Simplified73.4%
Final simplification77.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -6.8e-12) (not (<= t 6.2e-12))) (+ x y) (+ x (/ (* y z) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -6.8e-12) || !(t <= 6.2e-12)) {
tmp = x + y;
} else {
tmp = x + ((y * z) / a);
}
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 <= (-6.8d-12)) .or. (.not. (t <= 6.2d-12))) then
tmp = x + y
else
tmp = x + ((y * z) / a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -6.8e-12) || !(t <= 6.2e-12)) {
tmp = x + y;
} else {
tmp = x + ((y * z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -6.8e-12) or not (t <= 6.2e-12): tmp = x + y else: tmp = x + ((y * z) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -6.8e-12) || !(t <= 6.2e-12)) tmp = Float64(x + y); else tmp = Float64(x + Float64(Float64(y * z) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -6.8e-12) || ~((t <= 6.2e-12))) tmp = x + y; else tmp = x + ((y * z) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -6.8e-12], N[Not[LessEqual[t, 6.2e-12]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.8 \cdot 10^{-12} \lor \neg \left(t \leq 6.2 \cdot 10^{-12}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\end{array}
\end{array}
if t < -6.8000000000000001e-12 or 6.2000000000000002e-12 < t Initial program 99.9%
Taylor expanded in t around inf 74.1%
+-commutative74.1%
Simplified74.1%
if -6.8000000000000001e-12 < t < 6.2000000000000002e-12Initial program 95.4%
Taylor expanded in t around 0 80.8%
Final simplification77.3%
(FPCore (x y z t a) :precision binary64 (if (<= y -1.62e+242) (* y (/ z (- t))) (+ x y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -1.62e+242) {
tmp = y * (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.62d+242)) then
tmp = y * (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.62e+242) {
tmp = y * (z / -t);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -1.62e+242: tmp = y * (z / -t) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -1.62e+242) tmp = Float64(y * Float64(z / Float64(-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.62e+242) tmp = y * (z / -t); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -1.62e+242], N[(y * N[(z / (-t)), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.62 \cdot 10^{+242}:\\
\;\;\;\;y \cdot \frac{z}{-t}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if y < -1.61999999999999995e242Initial program 99.9%
Taylor expanded in a around 0 37.3%
mul-1-neg37.3%
unsub-neg37.3%
associate-/l*61.3%
div-sub61.3%
sub-neg61.3%
*-inverses61.3%
metadata-eval61.3%
Simplified61.3%
Taylor expanded in z around inf 36.1%
associate-*r/47.7%
neg-mul-147.7%
distribute-rgt-neg-in47.7%
distribute-frac-neg247.7%
Simplified47.7%
if -1.61999999999999995e242 < y Initial program 97.6%
Taylor expanded in t around inf 66.7%
+-commutative66.7%
Simplified66.7%
Final simplification65.6%
(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(y * Float64(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[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{a - t}
\end{array}
Initial program 97.7%
(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 97.7%
Taylor expanded in t around inf 63.8%
+-commutative63.8%
Simplified63.8%
Final simplification63.8%
(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 97.7%
Taylor expanded in x around inf 55.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* y (/ (- z t) (- a t))))))
(if (< y -8.508084860551241e-17)
t_1
(if (< y 2.894426862792089e-49)
(+ x (* (* y (- z t)) (/ 1.0 (- a t))))
t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * ((z - t) / (a - t)));
double tmp;
if (y < -8.508084860551241e-17) {
tmp = t_1;
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) * (1.0 / (a - t)));
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_1 = x + (y * ((z - t) / (a - t)))
if (y < (-8.508084860551241d-17)) then
tmp = t_1
else if (y < 2.894426862792089d-49) then
tmp = x + ((y * (z - t)) * (1.0d0 / (a - t)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (y * ((z - t) / (a - t)));
double tmp;
if (y < -8.508084860551241e-17) {
tmp = t_1;
} else if (y < 2.894426862792089e-49) {
tmp = x + ((y * (z - t)) * (1.0 / (a - t)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (y * ((z - t) / (a - t))) tmp = 0 if y < -8.508084860551241e-17: tmp = t_1 elif y < 2.894426862792089e-49: tmp = x + ((y * (z - t)) * (1.0 / (a - t))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(y * Float64(Float64(z - t) / Float64(a - t)))) tmp = 0.0 if (y < -8.508084860551241e-17) tmp = t_1; elseif (y < 2.894426862792089e-49) tmp = Float64(x + Float64(Float64(y * Float64(z - t)) * Float64(1.0 / Float64(a - t)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (y * ((z - t) / (a - t))); tmp = 0.0; if (y < -8.508084860551241e-17) tmp = t_1; elseif (y < 2.894426862792089e-49) tmp = x + ((y * (z - t)) * (1.0 / (a - t))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[y, -8.508084860551241e-17], t$95$1, If[Less[y, 2.894426862792089e-49], N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot \frac{z - t}{a - t}\\
\mathbf{if}\;y < -8.508084860551241 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y < 2.894426862792089 \cdot 10^{-49}:\\
\;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024132
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B"
:precision binary64
:alt
(! :herbie-platform default (if (< y -8508084860551241/100000000000000000000000000000000) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2894426862792089/10000000000000000000000000000000000000000000000000000000000000000) (+ x (* (* y (- z t)) (/ 1 (- a t)))) (+ x (* y (/ (- z t) (- a t)))))))
(+ x (* y (/ (- z t) (- a t)))))