
(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 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(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 (fma y (/ (- z t) (- a t)) x))
double code(double x, double y, double z, double t, double a) {
return fma(y, ((z - t) / (a - t)), x);
}
function code(x, y, z, t, a) return fma(y, Float64(Float64(z - t) / Float64(a - t)), x) end
code[x_, y_, z_, t_, a_] := N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, \frac{z - t}{a - t}, x\right)
\end{array}
Initial program 83.0%
+-commutative83.0%
associate-/l*99.1%
fma-define99.1%
Simplified99.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.22e+74) (not (<= t 1.6e+107))) (+ y x) (+ x (/ z (/ (- a t) y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.22e+74) || !(t <= 1.6e+107)) {
tmp = y + x;
} else {
tmp = x + (z / ((a - t) / 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 <= (-1.22d+74)) .or. (.not. (t <= 1.6d+107))) then
tmp = y + x
else
tmp = x + (z / ((a - t) / 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 <= -1.22e+74) || !(t <= 1.6e+107)) {
tmp = y + x;
} else {
tmp = x + (z / ((a - t) / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.22e+74) or not (t <= 1.6e+107): tmp = y + x else: tmp = x + (z / ((a - t) / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.22e+74) || !(t <= 1.6e+107)) tmp = Float64(y + x); else tmp = Float64(x + Float64(z / Float64(Float64(a - t) / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.22e+74) || ~((t <= 1.6e+107))) tmp = y + x; else tmp = x + (z / ((a - t) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.22e+74], N[Not[LessEqual[t, 1.6e+107]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(z / N[(N[(a - t), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.22 \cdot 10^{+74} \lor \neg \left(t \leq 1.6 \cdot 10^{+107}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z}{\frac{a - t}{y}}\\
\end{array}
\end{array}
if t < -1.21999999999999989e74 or 1.60000000000000015e107 < t Initial program 67.1%
+-commutative67.1%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in t around inf 84.0%
+-commutative84.0%
Simplified84.0%
if -1.21999999999999989e74 < t < 1.60000000000000015e107Initial program 91.5%
associate-/l*98.7%
Simplified98.7%
clear-num98.6%
un-div-inv98.7%
Applied egg-rr98.7%
Taylor expanded in z around inf 87.1%
associate-/r/87.1%
Applied egg-rr87.1%
*-commutative87.1%
clear-num87.1%
un-div-inv87.1%
Applied egg-rr87.1%
Final simplification86.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.25e+74) (not (<= t 9.8e+107))) (+ y x) (+ x (* z (/ y (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.25e+74) || !(t <= 9.8e+107)) {
tmp = y + x;
} 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.25d+74)) .or. (.not. (t <= 9.8d+107))) then
tmp = y + x
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.25e+74) || !(t <= 9.8e+107)) {
tmp = y + x;
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.25e+74) or not (t <= 9.8e+107): tmp = y + x else: tmp = x + (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.25e+74) || !(t <= 9.8e+107)) tmp = Float64(y + x); 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 <= -1.25e+74) || ~((t <= 9.8e+107))) tmp = y + x; else tmp = x + (z * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.25e+74], N[Not[LessEqual[t, 9.8e+107]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.25 \cdot 10^{+74} \lor \neg \left(t \leq 9.8 \cdot 10^{+107}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if t < -1.24999999999999991e74 or 9.8000000000000003e107 < t Initial program 67.1%
+-commutative67.1%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in t around inf 84.0%
+-commutative84.0%
Simplified84.0%
if -1.24999999999999991e74 < t < 9.8000000000000003e107Initial program 91.5%
associate-/l*98.7%
Simplified98.7%
clear-num98.6%
un-div-inv98.7%
Applied egg-rr98.7%
Taylor expanded in z around inf 87.1%
associate-/r/87.1%
Applied egg-rr87.1%
Final simplification86.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.25e+74) (not (<= t 1.15e+107))) (+ y x) (+ x (* y (/ z (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.25e+74) || !(t <= 1.15e+107)) {
tmp = y + x;
} 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 <= (-1.25d+74)) .or. (.not. (t <= 1.15d+107))) then
tmp = y + x
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 <= -1.25e+74) || !(t <= 1.15e+107)) {
tmp = y + x;
} else {
tmp = x + (y * (z / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.25e+74) or not (t <= 1.15e+107): tmp = y + x else: tmp = x + (y * (z / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.25e+74) || !(t <= 1.15e+107)) tmp = Float64(y + x); 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 <= -1.25e+74) || ~((t <= 1.15e+107))) tmp = y + x; else tmp = x + (y * (z / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.25e+74], N[Not[LessEqual[t, 1.15e+107]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y * N[(z / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.25 \cdot 10^{+74} \lor \neg \left(t \leq 1.15 \cdot 10^{+107}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a - t}\\
\end{array}
\end{array}
if t < -1.24999999999999991e74 or 1.15e107 < t Initial program 67.1%
+-commutative67.1%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in t around inf 84.0%
+-commutative84.0%
Simplified84.0%
if -1.24999999999999991e74 < t < 1.15e107Initial program 91.5%
associate-/l*98.7%
Simplified98.7%
Taylor expanded in z around inf 82.1%
associate-/l*87.1%
Simplified87.1%
Final simplification86.0%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.1e+31) (+ x (/ y (/ (- a t) z))) (if (<= z 1.35e+43) (+ x (* y (/ t (- t a)))) (+ x (* z (/ y (- a t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.1e+31) {
tmp = x + (y / ((a - t) / z));
} else if (z <= 1.35e+43) {
tmp = x + (y * (t / (t - a)));
} 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 (z <= (-1.1d+31)) then
tmp = x + (y / ((a - t) / z))
else if (z <= 1.35d+43) then
tmp = x + (y * (t / (t - a)))
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 (z <= -1.1e+31) {
tmp = x + (y / ((a - t) / z));
} else if (z <= 1.35e+43) {
tmp = x + (y * (t / (t - a)));
} else {
tmp = x + (z * (y / (a - t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.1e+31: tmp = x + (y / ((a - t) / z)) elif z <= 1.35e+43: tmp = x + (y * (t / (t - a))) else: tmp = x + (z * (y / (a - t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.1e+31) tmp = Float64(x + Float64(y / Float64(Float64(a - t) / z))); elseif (z <= 1.35e+43) tmp = Float64(x + Float64(y * Float64(t / Float64(t - a)))); 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 (z <= -1.1e+31) tmp = x + (y / ((a - t) / z)); elseif (z <= 1.35e+43) tmp = x + (y * (t / (t - a))); else tmp = x + (z * (y / (a - t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.1e+31], N[(x + N[(y / N[(N[(a - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.35e+43], N[(x + N[(y * N[(t / N[(t - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+31}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z}}\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{+43}:\\
\;\;\;\;x + y \cdot \frac{t}{t - a}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{a - t}\\
\end{array}
\end{array}
if z < -1.10000000000000005e31Initial program 78.0%
associate-/l*98.2%
Simplified98.2%
clear-num98.1%
un-div-inv98.3%
Applied egg-rr98.3%
Taylor expanded in z around inf 85.6%
if -1.10000000000000005e31 < z < 1.3500000000000001e43Initial program 86.3%
+-commutative86.3%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around 0 77.9%
+-commutative77.9%
associate-*r/77.9%
mul-1-neg77.9%
distribute-lft-neg-out77.9%
*-commutative77.9%
*-lft-identity77.9%
times-frac90.9%
/-rgt-identity90.9%
distribute-neg-frac90.9%
distribute-neg-frac290.9%
neg-sub090.9%
sub-neg90.9%
+-commutative90.9%
associate--r+90.9%
neg-sub090.9%
remove-double-neg90.9%
Simplified90.9%
if 1.3500000000000001e43 < z Initial program 80.4%
associate-/l*98.0%
Simplified98.0%
clear-num98.0%
un-div-inv98.0%
Applied egg-rr98.0%
Taylor expanded in z around inf 93.9%
associate-/r/94.0%
Applied egg-rr94.0%
Final simplification90.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -3.8e+20) (not (<= t 1.6e+104))) (+ y x) (+ x (* y (/ z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -3.8e+20) || !(t <= 1.6e+104)) {
tmp = y + x;
} 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.8d+20)) .or. (.not. (t <= 1.6d+104))) then
tmp = y + x
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.8e+20) || !(t <= 1.6e+104)) {
tmp = y + x;
} else {
tmp = x + (y * (z / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -3.8e+20) or not (t <= 1.6e+104): tmp = y + x else: tmp = x + (y * (z / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -3.8e+20) || !(t <= 1.6e+104)) tmp = Float64(y + x); 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.8e+20) || ~((t <= 1.6e+104))) tmp = y + x; else tmp = x + (y * (z / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -3.8e+20], N[Not[LessEqual[t, 1.6e+104]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.8 \cdot 10^{+20} \lor \neg \left(t \leq 1.6 \cdot 10^{+104}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{a}\\
\end{array}
\end{array}
if t < -3.8e20 or 1.6e104 < t Initial program 68.2%
+-commutative68.2%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in t around inf 82.4%
+-commutative82.4%
Simplified82.4%
if -3.8e20 < t < 1.6e104Initial program 92.2%
+-commutative92.2%
associate-/l*98.6%
fma-define98.6%
Simplified98.6%
Taylor expanded in t around 0 73.6%
+-commutative73.6%
associate-/l*78.2%
Simplified78.2%
Final simplification79.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.8e+21) (not (<= t 2.3e+106))) (+ y x) (+ x (/ (* y z) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.8e+21) || !(t <= 2.3e+106)) {
tmp = y + x;
} 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 <= (-1.8d+21)) .or. (.not. (t <= 2.3d+106))) then
tmp = y + x
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 <= -1.8e+21) || !(t <= 2.3e+106)) {
tmp = y + x;
} else {
tmp = x + ((y * z) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.8e+21) or not (t <= 2.3e+106): tmp = y + x else: tmp = x + ((y * z) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.8e+21) || !(t <= 2.3e+106)) tmp = Float64(y + x); 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 <= -1.8e+21) || ~((t <= 2.3e+106))) tmp = y + x; else tmp = x + ((y * z) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.8e+21], N[Not[LessEqual[t, 2.3e+106]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.8 \cdot 10^{+21} \lor \neg \left(t \leq 2.3 \cdot 10^{+106}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{a}\\
\end{array}
\end{array}
if t < -1.8e21 or 2.3000000000000002e106 < t Initial program 68.2%
+-commutative68.2%
associate-/l*99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in t around inf 82.4%
+-commutative82.4%
Simplified82.4%
if -1.8e21 < t < 2.3000000000000002e106Initial program 92.2%
associate-/l*98.6%
Simplified98.6%
Taylor expanded in t around 0 73.6%
Final simplification77.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.1e+272) (not (<= z 4.5e+152))) (* y (- 1.0 (/ z t))) (+ y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.1e+272) || !(z <= 4.5e+152)) {
tmp = y * (1.0 - (z / t));
} else {
tmp = y + 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 ((z <= (-3.1d+272)) .or. (.not. (z <= 4.5d+152))) then
tmp = y * (1.0d0 - (z / t))
else
tmp = y + x
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.1e+272) || !(z <= 4.5e+152)) {
tmp = y * (1.0 - (z / t));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.1e+272) or not (z <= 4.5e+152): tmp = y * (1.0 - (z / t)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.1e+272) || !(z <= 4.5e+152)) tmp = Float64(y * Float64(1.0 - Float64(z / t))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.1e+272) || ~((z <= 4.5e+152))) tmp = y * (1.0 - (z / t)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.1e+272], N[Not[LessEqual[z, 4.5e+152]], $MachinePrecision]], N[(y * N[(1.0 - N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{+272} \lor \neg \left(z \leq 4.5 \cdot 10^{+152}\right):\\
\;\;\;\;y \cdot \left(1 - \frac{z}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if z < -3.09999999999999972e272 or 4.5000000000000001e152 < z Initial program 75.8%
+-commutative75.8%
associate-/l*99.7%
fma-define99.7%
Simplified99.7%
Taylor expanded in a around 0 49.9%
+-commutative49.9%
mul-1-neg49.9%
Simplified49.9%
Taylor expanded in x around 0 49.9%
Taylor expanded in y around inf 49.7%
if -3.09999999999999972e272 < z < 4.5000000000000001e152Initial program 84.3%
+-commutative84.3%
associate-/l*99.0%
fma-define99.0%
Simplified99.0%
Taylor expanded in t around inf 66.1%
+-commutative66.1%
Simplified66.1%
Final simplification63.6%
(FPCore (x y z t a) :precision binary64 (if (<= x -2.1e-152) x (if (<= x 6.2e-164) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (x <= -2.1e-152) {
tmp = x;
} else if (x <= 6.2e-164) {
tmp = 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 (x <= (-2.1d-152)) then
tmp = x
else if (x <= 6.2d-164) then
tmp = 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 (x <= -2.1e-152) {
tmp = x;
} else if (x <= 6.2e-164) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if x <= -2.1e-152: tmp = x elif x <= 6.2e-164: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (x <= -2.1e-152) tmp = x; elseif (x <= 6.2e-164) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (x <= -2.1e-152) tmp = x; elseif (x <= 6.2e-164) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -2.1e-152], x, If[LessEqual[x, 6.2e-164], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.1 \cdot 10^{-152}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 6.2 \cdot 10^{-164}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -2.09999999999999999e-152 or 6.2000000000000001e-164 < x Initial program 82.9%
+-commutative82.9%
associate-/l*98.9%
fma-define98.9%
Simplified98.9%
Taylor expanded in y around 0 57.7%
if -2.09999999999999999e-152 < x < 6.2000000000000001e-164Initial program 83.1%
+-commutative83.1%
associate-/l*99.7%
fma-define99.7%
Simplified99.7%
Taylor expanded in t around inf 41.1%
+-commutative41.1%
Simplified41.1%
Taylor expanded in y around inf 36.9%
(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 83.0%
associate-/l*99.1%
Simplified99.1%
(FPCore (x y z t a) :precision binary64 (if (<= a -1.12e+221) x (+ y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.12e+221) {
tmp = x;
} else {
tmp = y + 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 (a <= (-1.12d+221)) then
tmp = x
else
tmp = y + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.12e+221) {
tmp = x;
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.12e+221: tmp = x else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.12e+221) tmp = x; else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.12e+221) tmp = x; else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.12e+221], x, N[(y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.12 \cdot 10^{+221}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if a < -1.12e221Initial program 73.0%
+-commutative73.0%
associate-/l*99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in y around 0 72.7%
if -1.12e221 < a Initial program 84.2%
+-commutative84.2%
associate-/l*99.0%
fma-define99.0%
Simplified99.0%
Taylor expanded in t around inf 59.1%
+-commutative59.1%
Simplified59.1%
(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.0%
+-commutative83.0%
associate-/l*99.1%
fma-define99.1%
Simplified99.1%
Taylor expanded in y around 0 45.5%
(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 2024146
(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))))