
(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 13 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 (let* ((t_1 (/ (- t z) (- t a)))) (if (<= t_1 2e+207) (+ x (* y t_1)) (+ x (/ (* z y) (- a t))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - z) / (t - a);
double tmp;
if (t_1 <= 2e+207) {
tmp = x + (y * t_1);
} 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) :: t_1
real(8) :: tmp
t_1 = (t - z) / (t - a)
if (t_1 <= 2d+207) then
tmp = x + (y * t_1)
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 t_1 = (t - z) / (t - a);
double tmp;
if (t_1 <= 2e+207) {
tmp = x + (y * t_1);
} else {
tmp = x + ((z * y) / (a - t));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (t - z) / (t - a) tmp = 0 if t_1 <= 2e+207: tmp = x + (y * t_1) else: tmp = x + ((z * y) / (a - t)) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(t - z) / Float64(t - a)) tmp = 0.0 if (t_1 <= 2e+207) tmp = Float64(x + Float64(y * t_1)); else tmp = Float64(x + Float64(Float64(z * y) / Float64(a - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (t - z) / (t - a); tmp = 0.0; if (t_1 <= 2e+207) tmp = x + (y * t_1); else tmp = x + ((z * y) / (a - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - z), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 2e+207], N[(x + N[(y * t$95$1), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - z}{t - a}\\
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{+207}:\\
\;\;\;\;x + y \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z \cdot y}{a - t}\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 a t)) < 2.0000000000000001e207Initial program 98.7%
if 2.0000000000000001e207 < (/.f64 (-.f64 z t) (-.f64 a t)) Initial program 64.9%
Taylor expanded in z around inf 99.9%
Final simplification98.7%
(FPCore (x y z t a)
:precision binary64
(if (<= t -5.3e+101)
(+ x y)
(if (<= t -0.0115)
(- x (/ (* z y) t))
(if (or (<= t -4.2e-21) (not (<= t 3.9e-33)))
(+ x y)
(+ x (/ y (/ a z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -5.3e+101) {
tmp = x + y;
} else if (t <= -0.0115) {
tmp = x - ((z * y) / t);
} else if ((t <= -4.2e-21) || !(t <= 3.9e-33)) {
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 <= (-5.3d+101)) then
tmp = x + y
else if (t <= (-0.0115d0)) then
tmp = x - ((z * y) / t)
else if ((t <= (-4.2d-21)) .or. (.not. (t <= 3.9d-33))) 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 <= -5.3e+101) {
tmp = x + y;
} else if (t <= -0.0115) {
tmp = x - ((z * y) / t);
} else if ((t <= -4.2e-21) || !(t <= 3.9e-33)) {
tmp = x + y;
} else {
tmp = x + (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -5.3e+101: tmp = x + y elif t <= -0.0115: tmp = x - ((z * y) / t) elif (t <= -4.2e-21) or not (t <= 3.9e-33): tmp = x + y else: tmp = x + (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -5.3e+101) tmp = Float64(x + y); elseif (t <= -0.0115) tmp = Float64(x - Float64(Float64(z * y) / t)); elseif ((t <= -4.2e-21) || !(t <= 3.9e-33)) 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 <= -5.3e+101) tmp = x + y; elseif (t <= -0.0115) tmp = x - ((z * y) / t); elseif ((t <= -4.2e-21) || ~((t <= 3.9e-33))) tmp = x + y; else tmp = x + (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -5.3e+101], N[(x + y), $MachinePrecision], If[LessEqual[t, -0.0115], N[(x - N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -4.2e-21], N[Not[LessEqual[t, 3.9e-33]], $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 -5.3 \cdot 10^{+101}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -0.0115:\\
\;\;\;\;x - \frac{z \cdot y}{t}\\
\mathbf{elif}\;t \leq -4.2 \cdot 10^{-21} \lor \neg \left(t \leq 3.9 \cdot 10^{-33}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -5.30000000000000006e101 or -0.0115 < t < -4.20000000000000025e-21 or 3.89999999999999974e-33 < t Initial program 99.9%
Taylor expanded in t around inf 81.0%
+-commutative81.0%
Simplified81.0%
if -5.30000000000000006e101 < t < -0.0115Initial program 99.9%
Taylor expanded in z around inf 81.9%
associate-/l*81.8%
Simplified81.8%
Taylor expanded in a around 0 77.6%
+-commutative77.6%
associate-*r/77.6%
neg-mul-177.6%
distribute-rgt-neg-in77.6%
Simplified77.6%
if -4.20000000000000025e-21 < t < 3.89999999999999974e-33Initial program 92.9%
Taylor expanded in t around 0 74.6%
+-commutative74.6%
associate-/l*76.1%
Simplified76.1%
clear-num76.1%
un-div-inv76.2%
Applied egg-rr76.2%
Final simplification78.4%
(FPCore (x y z t a)
:precision binary64
(if (<= t -5.4e+104)
(+ x y)
(if (<= t -0.0013)
(- x (* y (/ z t)))
(if (or (<= t -2.5e-21) (not (<= t 4.4e-34)))
(+ x y)
(+ x (/ y (/ a z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -5.4e+104) {
tmp = x + y;
} else if (t <= -0.0013) {
tmp = x - (y * (z / t));
} else if ((t <= -2.5e-21) || !(t <= 4.4e-34)) {
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 <= (-5.4d+104)) then
tmp = x + y
else if (t <= (-0.0013d0)) then
tmp = x - (y * (z / t))
else if ((t <= (-2.5d-21)) .or. (.not. (t <= 4.4d-34))) 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 <= -5.4e+104) {
tmp = x + y;
} else if (t <= -0.0013) {
tmp = x - (y * (z / t));
} else if ((t <= -2.5e-21) || !(t <= 4.4e-34)) {
tmp = x + y;
} else {
tmp = x + (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -5.4e+104: tmp = x + y elif t <= -0.0013: tmp = x - (y * (z / t)) elif (t <= -2.5e-21) or not (t <= 4.4e-34): tmp = x + y else: tmp = x + (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -5.4e+104) tmp = Float64(x + y); elseif (t <= -0.0013) tmp = Float64(x - Float64(y * Float64(z / t))); elseif ((t <= -2.5e-21) || !(t <= 4.4e-34)) 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 <= -5.4e+104) tmp = x + y; elseif (t <= -0.0013) tmp = x - (y * (z / t)); elseif ((t <= -2.5e-21) || ~((t <= 4.4e-34))) tmp = x + y; else tmp = x + (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -5.4e+104], N[(x + y), $MachinePrecision], If[LessEqual[t, -0.0013], N[(x - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -2.5e-21], N[Not[LessEqual[t, 4.4e-34]], $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 -5.4 \cdot 10^{+104}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;t \leq -0.0013:\\
\;\;\;\;x - y \cdot \frac{z}{t}\\
\mathbf{elif}\;t \leq -2.5 \cdot 10^{-21} \lor \neg \left(t \leq 4.4 \cdot 10^{-34}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -5.39999999999999969e104 or -0.0012999999999999999 < t < -2.49999999999999986e-21 or 4.3999999999999998e-34 < t Initial program 99.9%
Taylor expanded in t around inf 81.0%
+-commutative81.0%
Simplified81.0%
if -5.39999999999999969e104 < t < -0.0012999999999999999Initial program 99.9%
Taylor expanded in z around inf 81.9%
associate-/l*81.8%
Simplified81.8%
Taylor expanded in a around 0 77.6%
mul-1-neg77.6%
unsub-neg77.6%
associate-/l*77.5%
Simplified77.5%
if -2.49999999999999986e-21 < t < 4.3999999999999998e-34Initial program 92.9%
Taylor expanded in t around 0 74.6%
+-commutative74.6%
associate-/l*76.1%
Simplified76.1%
clear-num76.1%
un-div-inv76.2%
Applied egg-rr76.2%
Final simplification78.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.2e+30) (not (<= t 1.8e-71))) (+ x (- y (* y (/ z t)))) (+ x (/ (* z y) (- a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.2e+30) || !(t <= 1.8e-71)) {
tmp = x + (y - (y * (z / t)));
} 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 <= (-1.2d+30)) .or. (.not. (t <= 1.8d-71))) then
tmp = x + (y - (y * (z / t)))
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 <= -1.2e+30) || !(t <= 1.8e-71)) {
tmp = x + (y - (y * (z / t)));
} else {
tmp = x + ((z * y) / (a - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.2e+30) or not (t <= 1.8e-71): tmp = x + (y - (y * (z / t))) else: tmp = x + ((z * y) / (a - t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.2e+30) || !(t <= 1.8e-71)) tmp = Float64(x + Float64(y - Float64(y * Float64(z / t)))); else tmp = Float64(x + Float64(Float64(z * y) / Float64(a - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.2e+30) || ~((t <= 1.8e-71))) tmp = x + (y - (y * (z / t))); else tmp = x + ((z * y) / (a - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.2e+30], N[Not[LessEqual[t, 1.8e-71]], $MachinePrecision]], N[(x + N[(y - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.2 \cdot 10^{+30} \lor \neg \left(t \leq 1.8 \cdot 10^{-71}\right):\\
\;\;\;\;x + \left(y - y \cdot \frac{z}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z \cdot y}{a - t}\\
\end{array}
\end{array}
if t < -1.2e30 or 1.8e-71 < t Initial program 99.9%
Taylor expanded in a around 0 65.3%
+-commutative65.3%
associate-*r/65.3%
mul-1-neg65.3%
*-commutative65.3%
distribute-rgt-neg-out65.3%
Simplified65.3%
Taylor expanded in z around 0 79.0%
mul-1-neg79.0%
unsub-neg79.0%
associate-/l*88.3%
Simplified88.3%
if -1.2e30 < t < 1.8e-71Initial program 92.9%
Taylor expanded in z around inf 89.9%
Final simplification89.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -5.8e+105) (not (<= t 6.4e-37))) (+ x y) (+ x (/ (* z y) (- a t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5.8e+105) || !(t <= 6.4e-37)) {
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.8d+105)) .or. (.not. (t <= 6.4d-37))) 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.8e+105) || !(t <= 6.4e-37)) {
tmp = x + y;
} else {
tmp = x + ((z * y) / (a - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -5.8e+105) or not (t <= 6.4e-37): 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.8e+105) || !(t <= 6.4e-37)) tmp = Float64(x + y); else tmp = Float64(x + Float64(Float64(z * y) / Float64(a - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -5.8e+105) || ~((t <= 6.4e-37))) 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.8e+105], N[Not[LessEqual[t, 6.4e-37]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(z * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.8 \cdot 10^{+105} \lor \neg \left(t \leq 6.4 \cdot 10^{-37}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z \cdot y}{a - t}\\
\end{array}
\end{array}
if t < -5.8000000000000002e105 or 6.3999999999999998e-37 < t Initial program 99.9%
Taylor expanded in t around inf 80.9%
+-commutative80.9%
Simplified80.9%
if -5.8000000000000002e105 < t < 6.3999999999999998e-37Initial program 94.1%
Taylor expanded in z around inf 88.4%
Final simplification85.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.8e+105) (not (<= t 4.9e+78))) (+ x y) (+ x (* y (/ z (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.8e+105) || !(t <= 4.9e+78)) {
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.8d+105)) .or. (.not. (t <= 4.9d+78))) 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.8e+105) || !(t <= 4.9e+78)) {
tmp = x + y;
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.8e+105) or not (t <= 4.9e+78): 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.8e+105) || !(t <= 4.9e+78)) 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.8e+105) || ~((t <= 4.9e+78))) 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.8e+105], N[Not[LessEqual[t, 4.9e+78]], $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.8 \cdot 10^{+105} \lor \neg \left(t \leq 4.9 \cdot 10^{+78}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\end{array}
\end{array}
if t < -3.8e105 or 4.9000000000000002e78 < t Initial program 99.9%
Taylor expanded in t around inf 84.7%
+-commutative84.7%
Simplified84.7%
if -3.8e105 < t < 4.9000000000000002e78Initial program 94.7%
Taylor expanded in z around inf 84.9%
associate-/l*84.2%
Simplified84.2%
Final simplification84.4%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.85e+30) (+ x (- y (* y (/ z t)))) (if (<= t 2.75e-33) (+ 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 (t <= -1.85e+30) {
tmp = x + (y - (y * (z / t)));
} else if (t <= 2.75e-33) {
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 (t <= (-1.85d+30)) then
tmp = x + (y - (y * (z / t)))
else if (t <= 2.75d-33) 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 (t <= -1.85e+30) {
tmp = x + (y - (y * (z / t)));
} else if (t <= 2.75e-33) {
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 t <= -1.85e+30: tmp = x + (y - (y * (z / t))) elif t <= 2.75e-33: 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 (t <= -1.85e+30) tmp = Float64(x + Float64(y - Float64(y * Float64(z / t)))); elseif (t <= 2.75e-33) tmp = Float64(x + Float64(Float64(z * 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 (t <= -1.85e+30) tmp = x + (y - (y * (z / t))); elseif (t <= 2.75e-33) 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[LessEqual[t, -1.85e+30], N[(x + N[(y - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.75e-33], N[(x + N[(N[(z * y), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.85 \cdot 10^{+30}:\\
\;\;\;\;x + \left(y - y \cdot \frac{z}{t}\right)\\
\mathbf{elif}\;t \leq 2.75 \cdot 10^{-33}:\\
\;\;\;\;x + \frac{z \cdot y}{a - t}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{t - a}\\
\end{array}
\end{array}
if t < -1.85000000000000008e30Initial program 99.9%
Taylor expanded in a around 0 67.8%
+-commutative67.8%
associate-*r/67.8%
mul-1-neg67.8%
*-commutative67.8%
distribute-rgt-neg-out67.8%
Simplified67.8%
Taylor expanded in z around 0 77.7%
mul-1-neg77.7%
unsub-neg77.7%
associate-/l*93.1%
Simplified93.1%
if -1.85000000000000008e30 < t < 2.75e-33Initial program 93.4%
Taylor expanded in z around inf 88.6%
if 2.75e-33 < t Initial program 99.9%
Taylor expanded in z around 0 66.7%
mul-1-neg66.7%
unsub-neg66.7%
*-commutative66.7%
associate-/l*87.7%
Simplified87.7%
Final simplification89.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.2e-21) (not (<= t 3.8e-33))) (+ x y) (+ x (/ y (/ a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.2e-21) || !(t <= 3.8e-33)) {
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 <= (-2.2d-21)) .or. (.not. (t <= 3.8d-33))) 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 <= -2.2e-21) || !(t <= 3.8e-33)) {
tmp = x + y;
} else {
tmp = x + (y / (a / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.2e-21) or not (t <= 3.8e-33): tmp = x + y else: tmp = x + (y / (a / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.2e-21) || !(t <= 3.8e-33)) 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 <= -2.2e-21) || ~((t <= 3.8e-33))) tmp = x + y; else tmp = x + (y / (a / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.2e-21], N[Not[LessEqual[t, 3.8e-33]], $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 -2.2 \cdot 10^{-21} \lor \neg \left(t \leq 3.8 \cdot 10^{-33}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\frac{a}{z}}\\
\end{array}
\end{array}
if t < -2.2000000000000001e-21 or 3.79999999999999994e-33 < t Initial program 99.9%
Taylor expanded in t around inf 77.5%
+-commutative77.5%
Simplified77.5%
if -2.2000000000000001e-21 < t < 3.79999999999999994e-33Initial program 92.9%
Taylor expanded in t around 0 74.6%
+-commutative74.6%
associate-/l*76.1%
Simplified76.1%
clear-num76.1%
un-div-inv76.2%
Applied egg-rr76.2%
Final simplification76.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.2e-25) (not (<= t 3.05e-33))) (+ x y) (+ x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.2e-25) || !(t <= 3.05e-33)) {
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 <= (-2.2d-25)) .or. (.not. (t <= 3.05d-33))) 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 <= -2.2e-25) || !(t <= 3.05e-33)) {
tmp = x + y;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.2e-25) or not (t <= 3.05e-33): tmp = x + y else: tmp = x + (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.2e-25) || !(t <= 3.05e-33)) 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 <= -2.2e-25) || ~((t <= 3.05e-33))) tmp = x + y; else tmp = x + (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.2e-25], N[Not[LessEqual[t, 3.05e-33]], $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 -2.2 \cdot 10^{-25} \lor \neg \left(t \leq 3.05 \cdot 10^{-33}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -2.2000000000000002e-25 or 3.0500000000000001e-33 < t Initial program 99.9%
Taylor expanded in t around inf 77.5%
+-commutative77.5%
Simplified77.5%
if -2.2000000000000002e-25 < t < 3.0500000000000001e-33Initial program 92.9%
Taylor expanded in t around 0 74.6%
+-commutative74.6%
associate-/l*76.1%
Simplified76.1%
Final simplification76.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -5.5e-27) (not (<= t 4.2e-71))) (+ x y) (+ x (/ (* z y) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -5.5e-27) || !(t <= 4.2e-71)) {
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 <= (-5.5d-27)) .or. (.not. (t <= 4.2d-71))) 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 <= -5.5e-27) || !(t <= 4.2e-71)) {
tmp = x + y;
} else {
tmp = x + ((z * y) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -5.5e-27) or not (t <= 4.2e-71): tmp = x + y else: tmp = x + ((z * y) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -5.5e-27) || !(t <= 4.2e-71)) tmp = Float64(x + y); else tmp = Float64(x + Float64(Float64(z * y) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -5.5e-27) || ~((t <= 4.2e-71))) tmp = x + y; else tmp = x + ((z * y) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -5.5e-27], N[Not[LessEqual[t, 4.2e-71]], $MachinePrecision]], N[(x + y), $MachinePrecision], N[(x + N[(N[(z * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.5 \cdot 10^{-27} \lor \neg \left(t \leq 4.2 \cdot 10^{-71}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z \cdot y}{a}\\
\end{array}
\end{array}
if t < -5.5000000000000002e-27 or 4.2000000000000002e-71 < t Initial program 99.9%
Taylor expanded in t around inf 76.1%
+-commutative76.1%
Simplified76.1%
if -5.5000000000000002e-27 < t < 4.2000000000000002e-71Initial program 92.4%
Taylor expanded in t around 0 76.6%
Final simplification76.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -29500.0) (not (<= t 8.2e-137))) (+ x y) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -29500.0) || !(t <= 8.2e-137)) {
tmp = x + y;
} else {
tmp = x;
}
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 <= (-29500.0d0)) .or. (.not. (t <= 8.2d-137))) then
tmp = x + y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -29500.0) || !(t <= 8.2e-137)) {
tmp = x + y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -29500.0) or not (t <= 8.2e-137): tmp = x + y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -29500.0) || !(t <= 8.2e-137)) tmp = Float64(x + y); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -29500.0) || ~((t <= 8.2e-137))) tmp = x + y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -29500.0], N[Not[LessEqual[t, 8.2e-137]], $MachinePrecision]], N[(x + y), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -29500 \lor \neg \left(t \leq 8.2 \cdot 10^{-137}\right):\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -29500 or 8.1999999999999997e-137 < t Initial program 99.9%
Taylor expanded in t around inf 73.5%
+-commutative73.5%
Simplified73.5%
if -29500 < t < 8.1999999999999997e-137Initial program 92.0%
Taylor expanded in x around inf 51.0%
Final simplification64.0%
(FPCore (x y z t a) :precision binary64 (+ x (* (- z t) (/ y (- a t)))))
double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / (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 + ((z - t) * (y / (a - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((z - t) * (y / (a - t)));
}
def code(x, y, z, t, a): return x + ((z - t) * (y / (a - t)))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(z - t) * Float64(y / Float64(a - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + ((z - t) * (y / (a - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(z - t\right) \cdot \frac{y}{a - t}
\end{array}
Initial program 96.6%
associate-*r/84.2%
Simplified84.2%
*-commutative84.2%
associate-/l*97.2%
Applied egg-rr97.2%
(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 96.6%
Taylor expanded in x around inf 46.3%
(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 2024107
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B"
:precision binary64
:alt
(if (< y -8.508084860551241e-17) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2.894426862792089e-49) (+ x (* (* y (- z t)) (/ 1.0 (- a t)))) (+ x (* y (/ (- z t) (- a t))))))
(+ x (* y (/ (- z t) (- a t)))))